diff --git a/business-services/.github/ISSUE_TEMPLATE/bug_report.md b/business-services/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea7824f..00000000000 --- a/business-services/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/business-services/.github/ISSUE_TEMPLATE/feature_request.md b/business-services/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d615..00000000000 --- a/business-services/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/business-services/.github/workflows/codeql-analysis.yml b/business-services/.github/workflows/codeql-analysis.yml deleted file mode 100644 index c158e9ff66b..00000000000 --- a/business-services/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master, *release-*, RELEASE*, develop ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '16 17 * * 3' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/business-services/.gitignore b/business-services/.gitignore deleted file mode 100644 index 5c2027f43d0..00000000000 --- a/business-services/.gitignore +++ /dev/null @@ -1,192 +0,0 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -# Java / Maven -.classpath -.project -.settings/ -.mvnw/ -target/ - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# next.js build output -.next - -# nuxt.js build output -.nuxt - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - - -# Macbook General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk \ No newline at end of file diff --git a/business-services/.sonarcloud.properties b/business-services/.sonarcloud.properties deleted file mode 100644 index 8b137891791..00000000000 --- a/business-services/.sonarcloud.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/business-services/CODEOWNERS b/business-services/CODEOWNERS deleted file mode 100644 index 9a9bb36ed04..00000000000 --- a/business-services/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @egovernments/services-pr-reviewer @talele08 @kavi-egov diff --git a/business-services/Jenkinsfile b/business-services/Jenkinsfile deleted file mode 100644 index 65396b22e12..00000000000 --- a/business-services/Jenkinsfile +++ /dev/null @@ -1,3 +0,0 @@ -library 'ci-libs' - -buildPipeline(configFile: './build/build-config.yml') \ No newline at end of file diff --git a/business-services/LICENSE b/business-services/LICENSE deleted file mode 100644 index 335fd5f8652..00000000000 --- a/business-services/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 eGovernments Foundation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/business-services/README.md b/business-services/README.md deleted file mode 100644 index 23e64b89c3d..00000000000 --- a/business-services/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# egov-java-template -template diff --git a/business-services/build/build-config.yml b/business-services/build/build-config.yml deleted file mode 100644 index 3e7071d16ed..00000000000 --- a/business-services/build/build-config.yml +++ /dev/null @@ -1,86 +0,0 @@ -# -# config: -# - name: < Name of the job, foo/bar would create job named bar inside folder foo > -# build: -# - work-dir: < Working directory of the app to be built > -# dockerfile: < Path to the dockerfile, optional, assumes dockerfile in working directory if not provided > -# image-name: < Docker image name > -# - -# - -# -# config: -# - name: < Name of the job, foo/bar would create job named bar inside folder foo > -# build: -# - work-dir: < Working directory of the app to be built > -# dockerfile: < Path to the dockerfile, optional, assumes dockerfile in working directory if not provided > -# image-name: < Docker image name > -# - -# - -config: - - name: "builds/business-services/billing-service" - build: - - work-dir: "billing-service" - image-name: "billing-service" - dockerfile: "build/maven/Dockerfile" - - work-dir: "billing-service/src/main/resources/db" - image-name: "billing-service-db" - - - name: "builds/business-services/collection-services" - build: - - work-dir: "collection-services" - image-name: "collection-services" - dockerfile: "build/maven/Dockerfile" - - work-dir: "collection-services/src/main/resources/db" - image-name: "collection-services-db" - - - name: "builds/business-services/egf-instrument" - build: - - work-dir: "egf-instrument" - image-name: "egf-instrument" - dockerfile: "build/maven/Dockerfile" - - work-dir: "egf-instrument/src/main/resources/db" - image-name: "egf-instrument-db" - - - name: "builds/business-services/egf-master" - build: - - work-dir: "egf-master" - image-name: "egf-master" - dockerfile: "build/maven/Dockerfile" - - work-dir: "egf-master/src/main/resources/db" - image-name: "egf-master-db" - - - name: "builds/business-services/egov-apportion-service" - build: - - work-dir: "egov-apportion-service" - image-name: "egov-apportion-service" - dockerfile: "build/maven/Dockerfile" - - work-dir: "egov-apportion-service/src/main/resources/db" - image-name: "egov-apportion-service-db" - - - name: "builds/business-services/egov-hrms" - build: - - work-dir: "egov-hrms" - image-name: "egov-hrms" - dockerfile: "build/maven/Dockerfile" - - work-dir: "egov-hrms/src/main/resources/db" - image-name: "egov-hrms-db" - - - name: "builds/business-services/finance-collections-voucher-consumer" - build: - - work-dir: "finance-collections-voucher-consumer" - image-name: "finance-collections-voucher-consumer" - dockerfile: "build/maven/Dockerfile" - - work-dir: "finance-collections-voucher-consumer/src/main/resources/db" - image-name: "finance-collections-voucher-consumer-db" - - - name: "builds/business-services/dashboard-analytics" - build: - - work-dir: "dashboard-analytics" - image-name: "dashboard-analytics" - dockerfile: "build/maven/Dockerfile" - - - name: "builds/business-services/dashboard-ingest" - build: - - work-dir: "dashboard-ingest" - image-name: "dashboard-ingest" - dockerfile: "build/maven/Dockerfile" diff --git a/business-services/build/maven/Dockerfile b/business-services/build/maven/Dockerfile deleted file mode 100644 index b97b9cdc49b..00000000000 --- a/business-services/build/maven/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ - -FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build -ARG WORK_DIR -WORKDIR /app - -# 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 - - -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"] diff --git a/business-services/build/maven/start.sh b/business-services/build/maven/start.sh deleted file mode 100644 index 08bdd8de28e..00000000000 --- a/business-services/build/maven/start.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if [[ -z "${JAVA_OPTS}" ]];then - export JAVA_OPTS="-Xmx64m -Xms64m" -fi - -if [ x"${JAVA_ENABLE_DEBUG}" != x ] && [ "${JAVA_ENABLE_DEBUG}" != "false" ]; then - java_debug_args="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUG_PORT:-5005}" -fi - -exec java ${java_debug_args} ${JAVA_OPTS} ${JAVA_ARGS} -jar /opt/egov/*.jar \ No newline at end of file diff --git a/business-services/dashboard-analytics/CHANGELOG.md b/business-services/dashboard-analytics/CHANGELOG.md deleted file mode 100644 index 1e69eb5d424..00000000000 --- a/business-services/dashboard-analytics/CHANGELOG.md +++ /dev/null @@ -1,57 +0,0 @@ -#Changelog - -All notable changes to this module will be documented in this file. - -## 1.1.8 - 2023-02-02 - -- Transition from 1.1.8-beta version to 1.1.8 version - -## 1.1.8-beta - 2022-11-04 - -- caching added to search API for performance improvement - -## 1.1.7 - 2022-03-02 -- LineChart ResponseHandler modified to consider the empty value for particular interval -- TodaysCollection property added to the Metric chart, when this property is true query response is expected to have todaysDate and lastUdatedTime aggreagations which would be returned as the plots -- Performance Chart response handler changes to consider only the value of the aggregations which does not have buckets -- AdvanceTable Response handler changes to consider valueType of the chart when pathTypeDataMapping is not configured -- preActionTheory property added to metric chart type, which help to run the computeHelper on the aggregation path before applying action of the chart - Ex: preActionTheory:{"ActualCollection":"repsonseToDifferenceOfDates"} - - - - -## 1.1.6 - 2022-01-13 -- Updated to log4j2 version 2.17.1 - - -## 1.1.5 - 2021-07-23 -- Code changes related to new properties. -- Here are the properties which are added - - isRoundOff from configuration will round off the specific number value. - - chartSpecificProperty, XtableColumnOrder to give the xtable column order as we mention in this configuration - -## 1.1.4 - 2021-05-11 -- security fixes - -## 1.1.3 - 2021-02-26 -- Updated egov mdms host name in application.properties - -## 1.1.2 - 2020-11-18 -- Removed default DDR hard coding - - -## 1.1.1 - 2020-09-01 - -- Added LOCALSETUP.md and README.md -- updated Plot object to support String dataType - -## 1.1.0 - 2020-06-24 - -- Added typescript definition generation plugin -- Upgraded to `tracer:2.0.0-SNAPSHOT` -- Upgraded to spring boot `2.2.6-RELEASE` - -## 1.0.0 - -- Base version diff --git a/business-services/dashboard-analytics/LOCALSETUP.md b/business-services/dashboard-analytics/LOCALSETUP.md deleted file mode 100644 index 909e2334630..00000000000 --- a/business-services/dashboard-analytics/LOCALSETUP.md +++ /dev/null @@ -1,35 +0,0 @@ -# Local Setup - -To setup the dss-analytics service in your local system, clone the [Business Service repository](https://github.com/egovernments/business-services). - -## Dependencies - -### Infra Dependency - -- [ ] Postgres DB -- [ ] Redis -- [x] Elasticsearch -- [ ] Kafka - - [ ] Consumer - - [ ] Producer - -## Running Locally - -To run the dss-analytics in local system, you need to port forward below services. - -```bash - kubectl port-forward -n egov {egov-mdms} 8088:8080 -``` - - -Update below listed properties in `application.properties` before running the project: - -```ini - -- services.esindexer.host=http://localhost:9200/ (elastic search host) -- services.esindexer.host.port=9200 (elastic search port) -- services.esindexer.username=changeme (elastic search db username) -- services.esindexer.password=changeme (elastic search db password) - -``` - diff --git a/business-services/dashboard-analytics/README.md b/business-services/dashboard-analytics/README.md deleted file mode 100644 index abb7b14ea94..00000000000 --- a/business-services/dashboard-analytics/README.md +++ /dev/null @@ -1,52 +0,0 @@ - - -# dashboard-analytics - - -DSS Analytics Module is used to return aggregated data from elastic search indexes which is displayed on UI to gain meaningful insights from the data - -### DSS Analytics -The analytics service creates/wraps queries based on the configuration provided and executes it on the elastic search to fetch the aggregated data. -This aggregated data is then transformed to AggregateDTO by Response Handlers. AggregateDTO contains list of object called Plots. This plot object are created based on the chart type defined in the configuration. The module also provides functionality to compare the data with previous time period,which can be configured -by defining insight in the chartAPI configuration for the required chart. - - - - -### Project Structure -*Packages* - - constant - Contains all the constant values - - controller - Controllers for the app. - - dao - DAO layer - - dto - contains POJO's which are used to manage data returned from queries - - enums - Enum definitions - - exception - POJO for the module. - - handler - Reponse Handlers which converts the aggregated data to AggregationDTO object based on chart type defined - - helper - Helper classes to do computations on data - - model - POJO's related to chart config - - org.service - Consists of all services containing the business logic. - - query.model - POJO's related to building query - - repository - Fetches data from elastic search - - service - Implementations of services which help with fetching data - - utils - Contains utility functions. - - -### Resources -- Granular details about the API's can be found in the [swagger api definition](https://raw.githubusercontent.com/egovernments/business-services/master/Docs/dss-dashboard/DSS%20Analytics%20Dashboard%20YAML%20Spec%201.0.0.yaml) -- Postman collection for all the API's can be found in the [postman collection](https://www.getpostman.com/collections/0894f347322bed5bea1a) - - -## Build & Run - - - mvn clean install - java -jar target/analytics-1.1.0-SNAPSHOT.jar - - -## Dependencies - - -- Elastic search database to fetch data from index. - - - diff --git a/business-services/dashboard-analytics/pom.xml b/business-services/dashboard-analytics/pom.xml deleted file mode 100644 index 6f99f6fbdc5..00000000000 --- a/business-services/dashboard-analytics/pom.xml +++ /dev/null @@ -1,199 +0,0 @@ - - 4.0.0 - com.tarento - analytics - 1.1.8-SNAPSHOT - - Analytic Service - Project for handling the data for analytics visualization - http://maven.apache.org - - org.springframework.boot - spring-boot-starter-parent - 2.2.6.RELEASE - - - - 2.17.1 - UTF-8 - UTF-8 - 1.8 - 3.4.2 - - - - - junit - junit - 3.8.1 - test - - - org.egov.services - tracer - 2.0.0-SNAPSHOT - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework - spring-beans - 5.2.20.RELEASE - - - - org.springframework.boot - spring-boot-starter-jdbc - 2.0.0.RELEASE - - - org.cache2k - cache2k-spring - 1.2.0.Final - compile - - - - com.google.code.gson - gson - 2.8.0 - - - - org.springframework.boot - spring-boot-starter-jersey - 1.2.0.RELEASE - - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - - - org.projectlombok - lombok - - - org.apache.poi - poi-ooxml - 3.10-FINAL - - - - javax.ws.rs - jsr311-api - 1.1.1 - - - org.apache.cxf - cxf-rt-frontend-jaxws - ${cxf.version} - - - org.apache.cxf - cxf-rt-transports-http - ${cxf.version} - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf.version} - - - org.apache.cxf - cxf-tools-java2ws - ${cxf.version} - - - org.apache.commons - commons-lang3 - 3.4 - - - - - org.elasticsearch.client - elasticsearch-rest-high-level-client - 6.2.4 - - - org.elasticsearch - elasticsearch - 6.2.4 - - - com.github.fge - json-schema-validator - 2.2.6 - - - - commons-io - commons-io - 2.6 - - - - org.json - json - 20180813 - - - com.googlecode.json-simple - json-simple - 1.1 - - - com.amazonaws - aws-java-sdk - 1.11.550 - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - cz.habarta.typescript-generator - typescript-generator-maven-plugin - 2.22.595 - - - generate - - generate - - process-classes - - - - jackson2 - - com.tarento.analytics.model.dashboardConfig.Chart - com.tarento.analytics.model.dashboardConfig.Dashboard - com.tarento.analytics.model.dashboardConfig.Header - com.tarento.analytics.model.dashboardConfig.Visualization - - - com.tarento.analytics.enums.ChartType$ChartType:ChartType - com.tarento.analytics.enums.ResponseCode$ResponseCode:ResponseCode - com.tarento.analytics.constant.Constants$ClienServiceType:ClienServiceType - com.tarento.analytics.constant.Constants$Interval:Interval - - Digit - true - module - - - - - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/AnalyticApp.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/AnalyticApp.java deleted file mode 100644 index a968bb02ec1..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/AnalyticApp.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.tarento.analytics; - -import org.cache2k.extra.spring.SpringCache2kCacheManager; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cache.CacheManager; -import org.springframework.cache.annotation.EnableCaching; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Profile; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import com.tarento.analytics.constant.Constants; - -import java.util.concurrent.TimeUnit; - - -@SpringBootApplication -@EnableCaching -public class AnalyticApp { - public static void main( String[] args ) { - SpringApplication.run(AnalyticApp.class, args); - } - - @Value("${cache.expiry.time.in.minutes}") - private int cacheExpiry; - - @Value("${cache.capacity}") - private int cacheCapacity; - - @Bean - public RestTemplate restTemplate() { - return new RestTemplate(); - } - - @Bean - public WebMvcConfigurer corsConfigurer() { - return new WebMvcConfigurerAdapter() { - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**").allowedMethods(Constants.GET, Constants.POST,Constants.PUT, Constants.DELETE, Constants.OPTIONS).allowedOrigins("*") - .allowedHeaders("*"); - } - }; - } - - @Bean - @Profile("!test") - public CacheManager cacheManager(){ - return new SpringCache2kCacheManager().addCaches(b->b.name("versions").expireAfterWrite(cacheExpiry, TimeUnit.MINUTES) - .entryCapacity(cacheCapacity)); - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/ConfigurationLoader.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/ConfigurationLoader.java deleted file mode 100644 index cd2bb9de3af..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/ConfigurationLoader.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.tarento.analytics; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.apache.commons.io.IOUtils; -import org.egov.tracer.config.TracerConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Import; -import org.springframework.core.io.Resource; -import org.springframework.core.io.ResourceLoader; -import org.springframework.core.io.support.ResourcePatternUtils; -import org.springframework.stereotype.Component; -import org.springframework.util.ObjectUtils; - -import javax.annotation.PostConstruct; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; -import java.util.HashMap; -import java.util.Map; - -@Import({TracerConfiguration.class}) -@Component("configurationLoader") -public class ConfigurationLoader { - - private static Logger logger = LoggerFactory.getLogger(ConfigurationLoader.class); - private Map nameContentMap = new HashMap<>(); - @Autowired - private ResourceLoader resourceLoader; - @Autowired - private ObjectMapper objectMapper; - - @Value("${config.schema.paths}") - private String RESOURCE_LOCATION; - - // private static final String RESOURCE_LOCATION = "file://home/darshan/Tarento/DataPlatform/analytics2/analytics/src/main/resources/schema/*.json"; - public static final String ROLE_DASHBOARD_CONFIG = "RoleDashboardMappingsConf.json"; - public static final String MASTER_DASHBOARD_CONFIG = "MasterDashboardConfig.json"; - - - /** - * Loads config resources - * @throws Exception - */ - @PostConstruct - public void loadResources() throws Exception { - Resource[] resources = getResources(RESOURCE_LOCATION); - - for (Resource resource : resources) { - String jsonContent = getContent(resource); - ObjectNode jsonNode = (ObjectNode) objectMapper.readTree(jsonContent); - nameContentMap.put(resource.getFilename(), jsonNode); - } - logger.info("Number of resources loaded " + nameContentMap.size()); - - } - - /** - * Obtains a ObjectNode w.r.t given resource/file name in classpath*:schema - * @param name - * @return - */ - public ObjectNode get(String name) { - return nameContentMap.get(name); - } - - /** - * Loads all the resources/files with a given pattern *.json - * @param pattern path with *json - * @return - * @throws IOException - */ - private Resource[] getResources(String pattern) throws IOException { - Resource[] resources = ResourcePatternUtils.getResourcePatternResolver(resourceLoader).getResources(pattern); - return resources; - } - - /** - * Returns a content of resource - * - * @param resource - * @return - */ - private String getContent(Resource resource) { - String content = null; - InputStream is = null; - try { - is = resource.getInputStream(); - byte[] encoded = IOUtils.toByteArray(is); - content = new String(encoded, Charset.forName("UTF-8")); - - } catch (IOException e) { - logger.error("Cannot load resource " + resource.getFilename()); - - } finally{ - try { - if(!ObjectUtils.isEmpty(is)) - is.close(); - }catch(IOException e){ - logger.error("Error while closing input stream."); - } - } - return content; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/Constants.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/Constants.java deleted file mode 100644 index 26624e5a21b..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/Constants.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.tarento.analytics.constant; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class Constants { - /** - * Allowed Origins for CORS Bean - */ - public static final String GET = "GET"; - public static final String POST = "POST"; - public static final String PUT = "PUT"; - public static final String DELETE = "DELETE"; - public static final String OPTIONS = "OPTIONS"; - - - public static int UNAUTHORIZED_ID = 401; - public static int SUCCESS_ID = 200; - public static int FAILURE_ID = 320; - public static String UNAUTHORIZED = "Invalid credentials. Please try again."; - public static String PROCESS_FAIL = "Process failed, Please try again."; - public static String SUCCESS= "success"; - - - //chart format - - public static final String D3 = "d3"; - public static final String CHARTJS = "chartjs"; - - //chart type - public static final String BAR = "bar"; - public static final String PIE ="pie"; - public static final String STACKEDBAR ="stackedbar"; - public static final String LINE ="line"; - public static final String HORIZONTAL_BAR="horizontalBar"; - public static final String DOUGHNUT="doughnut"; - public static final String Heat = "heat"; - public static final String RADAR ="radar"; - - public static final Long FEEDBACK_MESSAGE_TIMEOUT = 2000l; - - public static final String STORE_ID = "storeId"; - - public static final String PLACEMENTS_DASHBOARD = "DASHBOARD"; - public static final String PLACEMENTS_HOME = "HOME"; - - public static final List RATING_LIST = new ArrayList<>(Arrays.asList(1l,2l,3l,4l,5l)); - public static final List RATING_LIST_STRING = new ArrayList<>(Arrays.asList("1","2","3","4","5")); - public static final List RATING_LIST_STRING_STAR = new ArrayList<>(Arrays.asList("1 Star","2 Star","3 Star","4 Star","5 Star")); - - public interface Modules { - final static String HOME_REVENUE = "HOME_REVENUE"; - final static String HOME_SERVICES = "HOME_SERVICES"; - final static String COMMON = "COMMON"; - final static String PT = "PT"; - final static String TL = "TL"; - } - - public interface KafkaTopics { - final static String NEW_CONTENT_MESSAGE = "SaveContent"; - final static String SIMULATOR_TRANSACTION = "SaveTransaction"; - } - - public interface ConfigurationFiles { - final static String CHART_API_CONFIG = "ChartApiConfig.json"; - } - - public interface JsonPaths { - final static String CHART_TYPE = "chartType"; - final static String QUERIES = "queries"; - final static String AGGREGATION_QUERY= "aggrQuery"; - final static String INDEX_NAME = "indexName"; - final static String REQUEST_QUERY_MAP = "requestQueryMap"; - final static String DATE_REF_FIELD = "dateRefField"; - final static String AGGS = "aggs"; - final static String AGGREGATIONS = "aggregations" ; - final static String MODULE = "module"; - final static String INTERVAL_VAL = "intervalvalue"; - final static String INTERVAL = "interval"; - final static String IS_MDMS_ENABALED = "isMdmsEnabled"; - final static String INSIGHT = "insight"; - final static String DAYS = "days"; - final static String TRANSLATE_CODE = "translateTenantCode"; - - } - - public interface Filters { - final static String MODULE = "module"; - final static String FILTER_ALL = "*"; - } - - public interface Catagory { - final static String SEVICE = "service"; - final static String REVENUE = "revenue"; - } - - public interface DashBoardConfig { - final static String ROLES = "roles"; - final static String ROLE_ID = "roleId"; - final static String DASHBOARDS = "dashboards"; - final static String VISUALISATIONS = "visualizations"; - final static String NAME = "name"; - final static String ID = "id"; - final static String TITLE = "title"; - - } - public interface MDMSKeys { - final static String CODE = "code"; - final static String DISTRICT_CODE = "districtCode"; - final static String DDR_NAME = "ddrName"; - final static String TENANTS = "tenants"; - final static String KEY = "key"; - final static String TENANT_ID = "tenantId"; - - } - - public enum Interval { - week, month, year, day - } - public interface PostAggregationTheories { - final static String RESPONSE_DIFF_DATES = "repsonseToDifferenceOfDates"; - } - - public enum ClienServiceType { - DEFAULT_CLIENT , - MDMS_CLIENT - } - - public static final SimpleDateFormat DASHBOARD_DATE_FORMAT = new SimpleDateFormat("MMM dd, yyyy"); - - //data type - public static final String STRING_DATATYPE = "string"; - - public static final String MDMS_REQUESTINFO = "{\"RequestInfo\":{\"authToken\":\"\"},\"MdmsCriteria\":{\"tenantId\":\"{TENANTID_PLACEHOLDER}\",\"moduleDetails\":[{\"moduleName\":\"tenant\",\"masterDetails\":[{\"name\":\"tenants\"}]}]}}"; - - public static final String TENANTID_PLACEHOLDER = "{TENANTID_PLACEHOLDER}"; - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/ElasticSearchConstants.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/ElasticSearchConstants.java deleted file mode 100644 index 09963b4dce8..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/ElasticSearchConstants.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.tarento.analytics.constant; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class ElasticSearchConstants { - public static final String LTE = "<="; - public static final String LT = "<"; - public static final String GTE = ">="; - public static final String GT = ">"; - public static final String ASC_ORDER = "ASC"; - public static final String STARTS_WITH = "startsWith"; - public static final String ENDS_WITH = "endsWith"; - public static final List upsertResults = - new ArrayList<>(Arrays.asList("CREATED", "UPDATED", "NOOP")); - public static final String SOFT_MODE = "soft"; - public static final String RAW_APPEND = ".raw"; - public static final String DAY_OF_WEEK = "dayOfWeek"; - public static final String DAY = "day"; - public static final String HOUR = "hour"; -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/ErrorCode.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/ErrorCode.java deleted file mode 100644 index 56a8e5cc44a..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/constant/ErrorCode.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.tarento.analytics.constant; - -public class ErrorCode { - - public static final String ERR320= "320"; - - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/controllers/DashboardController.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/controllers/DashboardController.java deleted file mode 100644 index a019ad1de43..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/controllers/DashboardController.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.tarento.analytics.controllers; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.tarento.analytics.org.service.ClientServiceFactory; -import com.tarento.analytics.service.AmazonS3ClientService; -import org.apache.commons.lang3.StringUtils; -import org.json.JSONArray; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.ServletWebRequest; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.constant.ErrorCode; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.AggregateRequestDtoV3; -import com.tarento.analytics.dto.RequestDto; -import com.tarento.analytics.dto.RequestDtoV3; -import com.tarento.analytics.dto.RoleDto; -import com.tarento.analytics.dto.UserDto; -import com.tarento.analytics.exception.AINException; -import com.tarento.analytics.org.service.ClientService; -import com.tarento.analytics.service.MetadataService; -import com.tarento.analytics.utils.PathRoutes; -import com.tarento.analytics.utils.ResponseGenerator; -import org.springframework.web.multipart.MultipartFile; - -@RestController -@RequestMapping(PathRoutes.DashboardApi.DASHBOARD_ROOT_PATH) -public class DashboardController { - - public static final Logger logger = LoggerFactory.getLogger(DashboardController.class); - - @Autowired - private MetadataService metadataService; - @Autowired - private AmazonS3ClientService amazonS3ClientService; - @Autowired - private ObjectMapper objectMapper; - -/* @Autowired - private ClientService clientService;*/ - - @Autowired - private ClientServiceFactory clientServiceFactory; - - @RequestMapping(value = PathRoutes.DashboardApi.FILE_PATH, method = RequestMethod.POST) - public Map uploadFile(@RequestPart(value = "file") MultipartFile file) - { - Map response = new HashMap<>(); - try{ - String imgUrl = this.amazonS3ClientService.uploadFileToS3Bucket(file, true); - response.put("message", "file [" + file.getOriginalFilename() + "] uploading request submitted successfully."); - response.put("url", imgUrl); - }catch (Exception e){ - logger.error("S3 file upload : "+e.getMessage()); - response.put("message", e.getMessage()); - response.put("url", ""); - } - - return response; - } - - @DeleteMapping(value = PathRoutes.DashboardApi.FILE_PATH) - public Map deleteFile(@RequestParam("file_name") String fileName) - { - Map response = new HashMap<>(); - try{ - this.amazonS3ClientService.deleteFileFromS3Bucket(fileName); - response.put("message", "file [" + fileName + "] removing request submitted successfully."); - }catch (Exception e ){ - logger.error("S3 file upload : "+e.getMessage()); - response.put("message", e.getMessage()); - - } - return response; - - } - - @GetMapping(value = PathRoutes.DashboardApi.TEST_PATH, produces = MediaType.APPLICATION_JSON_VALUE) - public String getTest() throws JsonProcessingException { - return ResponseGenerator.successResponse("success"); - - } - - @RequestMapping(value = PathRoutes.DashboardApi.GET_DASHBOARD_CONFIG + "/{dashboardId}", method = RequestMethod.GET) - public String getDashboardConfiguration(@PathVariable String dashboardId, @RequestParam(value="catagory", required = false) String catagory, @RequestHeader(value = "x-user-info", required = false) String xUserInfo) - throws AINException, IOException { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - UserDto user = new UserDto(); - user.setId(new Long("10007")); - user.setOrgId("1"); - user.setCountryCode(""); - RoleDto role = new RoleDto(); - role.setId(new Long("6")); - role.setName("HR User"); - List roles = new ArrayList<>(); - roles.add(role); - user.setRoles(roles); - //gson.fromJson(xUserInfo, UserDto.class); - - return ResponseGenerator.successResponse(metadataService.getDashboardConfiguration(dashboardId, catagory, user.getRoles())); - } - - @RequestMapping(value = PathRoutes.DashboardApi.GET_CHART_V2, method = RequestMethod.POST) - public String getVisualizationChartV2( @RequestBody RequestDto requestDto, @RequestHeader(value = "x-user-info", required = false) String xUserInfo, ServletWebRequest request) - throws IOException { - - /*logger.info("Request Detail:" + requestDto); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - UserDto user = gson.fromJson(xUserInfo, UserDto.class);*/ - - UserDto user = new UserDto(); - logger.info("user"+xUserInfo); - - //Getting the request information only from the Full Request - AggregateRequestDto requestInfo = requestDto.getAggregationRequestDto(); - - // For performance enhancement, this creates a key which will cache the response - String requestBodyString = objectMapper.writeValueAsString(requestInfo); - String headersString = objectMapper.writeValueAsString(requestDto.getHeaders()); - StringBuilder finalString = new StringBuilder(requestBodyString).append(headersString); - requestInfo.setHashKey(finalString.toString().hashCode()); - - Map headers = requestDto.getHeaders(); - String response = ""; - try { - if (headers.isEmpty()) { - logger.error("Please provide header details"); - throw new AINException(ErrorCode.ERR320, "header is missing"); - } - if (headers.get("tenantId") == null) { - logger.error("Please provide tenant ID details"); - throw new AINException(ErrorCode.ERR320, "tenant is missing"); - - } - - if(requestDto.getAggregationRequestDto() == null) { - logger.error("Please provide requested Visualization Details"); - throw new AINException(ErrorCode.ERR320, "Visualization Request is missing"); - } - /*if(requestDto.getAggregationRequestDto().getRequestId() == null) { - logger.error("Please provide Request ID"); - throw new AINException(ErrorCode.ERR320, "Request ID is missing. Insights will not work"); - }*/ - - - // To be removed once the development is complete - if(StringUtils.isBlank(requestInfo.getModuleLevel())) { - requestInfo.setModuleLevel(Constants.Modules.HOME_REVENUE); - } - - Object responseData = clientServiceFactory.get(requestInfo.getVisualizationCode()).getAggregatedData(requestInfo, user.getRoles()); - response = ResponseGenerator.successResponse(responseData); - - } catch (AINException e) { - logger.error("error while executing api getVisualizationChart"); - response = ResponseGenerator.failureResponse(e.getErrorCode(), e.getErrorMessage()); - } - return response; - } - -/* - @RequestMapping(value = PathRoutes.DashboardApi.GET_CHART_V3, method = RequestMethod.POST) - public String getVisualizationChartV3(@RequestBody RequestDtoV3 requestDtoV3, @RequestHeader(value = "x-user-info", required = false) String xUserInfo, ServletWebRequest request) - throws IOException { - - */ -/*logger.info("Request Detail:" + requestDto); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - UserDto user = gson.fromJson(xUserInfo, UserDto.class);*//* - - - UserDto user = new UserDto(); - logger.info("user"+xUserInfo); - - //Getting the request information only from the Full Request - AggregateRequestDtoV3 requestInfoV3 = requestDtoV3.getAggregationRequestDto(); - Map headers = requestDtoV3.getHeaders(); - //requestInfo.getFilters().putAll(headers); - String response = ""; - try { - if (headers.isEmpty()) { - logger.error("Please provide header details"); - throw new AINException(ErrorCode.ERR320, "header is missing"); - } - if (headers.get("tenantId") == null) { - logger.error("Please provide tenant ID details"); - throw new AINException(ErrorCode.ERR320, "tenant is missing"); - } - // To be removed once the development is complete - if(StringUtils.isBlank(requestInfoV3.getModuleLevel())) { - requestInfoV3.setModuleLevel(Constants.Modules.HOME_REVENUE); - } - - List responseDataList = new ArrayList<>(); - if(requestInfoV3 !=null && requestInfoV3.getVisualizations() != null && requestInfoV3.getVisualizations().size() > 0) { - for (int i = 0; i < requestInfoV3.getVisualizations().size(); i++) { - AggregateRequestDto requestInfo = new AggregateRequestDto(requestInfoV3, - requestInfoV3.getVisualizations().get(i).getType(), requestInfoV3.getVisualizations().get(i).getCode()); - Object responseData = clientService.getAggregatedData(requestInfo, user.getRoles()); - responseDataList.add(responseData); - } - - } - response = ResponseGenerator.successResponse(responseDataList); - } catch (AINException e) { - logger.error("error while executing api getVisualizationChart"); - response = ResponseGenerator.failureResponse(e.getErrorCode(), e.getErrorMessage()); - } - return response; - } -*/ - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dao/ElasticSearchDao.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dao/ElasticSearchDao.java deleted file mode 100644 index 1d72b635775..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dao/ElasticSearchDao.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.tarento.analytics.dao; - -import java.util.List; -import java.util.Map; - -import org.elasticsearch.action.search.MultiSearchResponse; -import org.elasticsearch.action.search.SearchRequest; - -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.CummulativeDataRequestDto; -import com.tarento.analytics.dto.SearchDto; -import com.tarento.analytics.model.ElasticSearchDictator; - - -public interface ElasticSearchDao { - - public Map getDataByIdentifier(String index, String type, String identifier); - - public Map searchData(String index, String type, Map searchData); - - public Map complexSearch(SearchDto searchDTO, String index, String... type); - - public boolean healthCheck(); - - /*public ElasticSearchDictator createSearchDictator(AggregateRequestDto dto, String tenant) throws Exception ; - - public ElasticSearchDictator createSearchDictator(AggregateRequestDto dto, String indexName, String documentType, String filterDateField) throws Exception ; - */ - public ElasticSearchDictator createSearchDictatorV2(AggregateRequestDto dto, String indexName, String documentType, String filterDateField) throws Exception ; - - public SearchRequest buildElasticSearchQuery(ElasticSearchDictator dictator); - - public MultiSearchResponse executeMultiSearchRequest(List searchRequestList, String tenant); - - //public ElasticSearchDictator createSearchDictator(String indexName, String documentType, CummulativeDataRequestDto dto, String tenant) throws Exception ; - - MultiSearchResponse executeMultiSearchRequest(List searchRequestList, Boolean primaryOrNot); - -} - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dao/impl/ElasticSearchDaoImpl.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dao/impl/ElasticSearchDaoImpl.java deleted file mode 100644 index a8f124ed9c0..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dao/impl/ElasticSearchDaoImpl.java +++ /dev/null @@ -1,1307 +0,0 @@ -package com.tarento.analytics.dao.impl; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpHost; -import org.elasticsearch.action.get.GetRequest; -import org.elasticsearch.action.get.GetResponse; -import org.elasticsearch.action.search.MultiSearchRequest; -import org.elasticsearch.action.search.MultiSearchResponse; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.RestClient; -import org.elasticsearch.client.RestHighLevelClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.ExistsQueryBuilder; -import org.elasticsearch.index.query.MatchQueryBuilder; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.index.query.RangeQueryBuilder; -import org.elasticsearch.index.query.TermQueryBuilder; -import org.elasticsearch.index.query.TermsQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.SearchHits; -import org.elasticsearch.search.aggregations.AggregationBuilder; -import org.elasticsearch.search.aggregations.AggregationBuilders; -import org.elasticsearch.search.aggregations.BucketOrder; -import org.elasticsearch.search.aggregations.PipelineAggregationBuilder; -import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregationBuilder; -import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; -import org.elasticsearch.search.aggregations.bucket.histogram.ExtendedBounds; -import org.elasticsearch.search.aggregations.bucket.nested.NestedAggregationBuilder; -import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.avg.AvgAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.sum.SumAggregationBuilder; -import org.elasticsearch.search.aggregations.metrics.valuecount.ValueCountAggregationBuilder; -import org.elasticsearch.search.aggregations.pipeline.cumulativesum.CumulativeSumPipelineAggregationBuilder; -import org.elasticsearch.search.builder.SearchSourceBuilder; -import org.elasticsearch.search.sort.SortBuilder; -import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.tarento.analytics.constant.ElasticSearchConstants; -import com.tarento.analytics.dao.ElasticSearchDao; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.SearchDto; -import com.tarento.analytics.model.ElasticSearchDictator; -import com.tarento.analytics.utils.ElasticProperties; -import com.tarento.analytics.utils.ElasticSearchClient; - -@Component -public class ElasticSearchDaoImpl implements ElasticSearchDao { - - @Autowired - private ElasticSearchClient elasticSearchClient; - - @Autowired - public ObjectMapper mapper; - - private static String elasticHost; - private static int elasticPort; - private static String alternateHost; - private static int alternatePort; - private static final String REST_SCHEME = "http"; - private static final String REST_SCHEME2 = "https"; - private String transactionElasticIndexName; - private static String transactionElasticDocType; - private String ratingElasticIndexName; - private static String ratingElasticDocType; - private static RestHighLevelClient client; - private static RestHighLevelClient alternateClient; - private String indexName; - private String docType; - - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public String getDocType() { - return docType; - } - - public void setDocType(String docType) { - this.docType = docType; - } - - public static final Logger logger = LoggerFactory.getLogger(ElasticSearchDaoImpl.class); - - public ElasticSearchDaoImpl(@Value("${services.esindexer.host.name}") String elasticHost, - @Value("${services.esindexer.host.port}") int elasticPort) throws MalformedURLException { - this.elasticHost = elasticHost; - this.elasticPort = elasticPort; - this.client = getClientForElastic(); - - } - - @Override - public Map getDataByIdentifier(String index, String type, String identifier) { - RestHighLevelClient client = elasticSearchClient.getClient(); - long startTime = System.currentTimeMillis(); - logger.info("ElasticSearchUtil getDataByIdentifier method started at ==" + startTime + " for Type " + type); - GetResponse response = null; - - try { - if (StringUtils.isBlank(index) || StringUtils.isBlank(identifier)) { - logger.error("Invalid request is coming."); - return new HashMap<>(); - } else if (StringUtils.isBlank(type)) { - response = client.get(new GetRequest(index).type(type)); - - } else { - response = client.get(new GetRequest(index, type, identifier)); - } - if (response == null || null == response.getSource()) { - return new HashMap<>(); - } - long stopTime = System.currentTimeMillis(); - long elapsedTime = stopTime - startTime; - logger.info("ElasticSearchUtil getDataByIdentifier method end at ==" + stopTime + " for Type " + type - + " ,Total time elapsed = " + elapsedTime); - return response.getSource(); - } catch (IOException ex) { - - } finally { - try { - client.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - logger.error("Error while closing ES client"); - } - } - return null; - } - - @Override - public Map searchData(String index, String type, Map searchData) { - RestHighLevelClient client = elasticSearchClient.getClient(); - - long startTime = System.currentTimeMillis(); - logger.info("ElasticSearchUtil searchData method started at ==" + startTime + " for Type " + type); - SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); - Iterator> itr = searchData.entrySet().iterator(); - while (itr.hasNext()) { - Entry entry = itr.next(); - sourceBuilder.query(QueryBuilders.commonTermsQuery(entry.getKey(), entry.getValue())); - } - - SearchResponse sr = null; - try { - sr = client.search(new SearchRequest(index).types(type).source(sourceBuilder)); - - } catch (IOException ex) { - logger.error("Error while execution in Elasticsearch", ex); - } - - if (sr.getHits() == null || sr.getHits().getTotalHits() == 0) { - return new HashMap<>(); - } - sr.getHits().getAt(0).getSourceAsMap(); - long stopTime = System.currentTimeMillis(); - long elapsedTime = stopTime - startTime; - - logger.info("ElasticSearchUtil searchData method end at ==" + stopTime + " for Type " + type - + " ,Total time elapsed = " + elapsedTime); - try { - client.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - logger.error("Error while closing the client"); - } - return sr.getAggregations().asList().get(0).getMetaData(); - } - - @SuppressWarnings("rawtypes") - @Override - public Map complexSearch(SearchDto searchDTO, String index, String... type) { - RestHighLevelClient client = elasticSearchClient.getClient(); - - long startTime = System.currentTimeMillis(); - logger.info("ElasticSearchUtil complexSearch method started at ==" + startTime); - - // Map constraintsMap = getConstraints(searchDTO); - SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder().size(0); - BoolQueryBuilder query = new BoolQueryBuilder(); - - if (!StringUtils.isBlank(searchDTO.getQuery())) { - query.must(QueryBuilders.simpleQueryStringQuery(searchDTO.getQuery()).field("all_fields")); - } - - // apply sorting - if (searchDTO.getSortBy() != null && searchDTO.getSortBy().size() > 0) { - - for (Map.Entry entry : searchDTO.getSortBy().entrySet()) { - SortBuilder sortB = SortBuilders.fieldSort(entry.getKey()).order(getSortOrder(entry.getValue())); - searchSourceBuilder.sort(sortB); - - } - } - - // apply the fields filter - searchSourceBuilder.fetchSource( - searchDTO.getFields() != null ? searchDTO.getFields().stream().toArray(String[]::new) : null, - searchDTO.getExcludedFields() != null ? searchDTO.getExcludedFields().stream().toArray(String[]::new) - : null); - - // setting the offset - if (searchDTO.getOffset() != null) { - searchSourceBuilder.from(searchDTO.getOffset()); - } - - // setting the limit - if (searchDTO.getLimit() != null) { - searchSourceBuilder.size(searchDTO.getLimit()); - } - - // apply additional properties - if (searchDTO.getAdditionalProperties() != null && searchDTO.getAdditionalProperties().size() > 0) { - for (Map.Entry entry : searchDTO.getAdditionalProperties().entrySet()) { - addAdditionalProperties(query, entry); - } - } - - searchSourceBuilder.query(query); - List finalFacetList = new ArrayList(); - - if (null != searchDTO.getFacets() && !searchDTO.getFacets().isEmpty()) { - // addAggregations(searchSourceBuilder, searchDTO.getFacets()); - } - logger.info("calling search builder======" + searchSourceBuilder.toString()); - SearchResponse response = null; - SearchRequest searchReq = new SearchRequest(index).types(type).source(searchSourceBuilder); - List> esSource = new ArrayList<>(); - - try { - response = client.search(searchReq); - long count = 0; - - if (response != null) { - SearchHits hits = response.getHits(); - count = hits.getTotalHits(); - for (SearchHit hit : hits) { - esSource.add(hit.getSourceAsMap()); - } - } - } catch (IOException e) { - // TODO Auto-generated catch block - logger.info("Error occured while searching"); - } - return null; - - } - - @SuppressWarnings("unchecked") - private void addAggregations(SearchSourceBuilder searchSourceBuilder, Map aggregations) { - long startTime = System.currentTimeMillis(); - logger.info("ElasticSearchUtil addAggregations method started at ==" + startTime); - for (Map.Entry entry : aggregations.entrySet()) { - - String key = entry.getKey(); - Map aggregationInfo = (Map) entry.getValue(); - for (Map.Entry en : aggregations.entrySet()) { - if ("DATE_HISTOGRAM".equalsIgnoreCase(en.getKey())) { - Map aggsVal = (Map) en.getValue(); - DateHistogramInterval dateHistogramInterval = null; - if (aggsVal.get("interval").equals("day")) { - dateHistogramInterval = DateHistogramInterval.DAY; - } else if (aggsVal.get("interval").equals("hour")) { - dateHistogramInterval = DateHistogramInterval.HOUR; - - } else if (aggsVal.get("interval").equals("month")) { - dateHistogramInterval = DateHistogramInterval.MONTH; - - } else if (aggsVal.get("interval").equals("year")) { - dateHistogramInterval = DateHistogramInterval.YEAR; - - } - searchSourceBuilder.aggregation(AggregationBuilders.dateHistogram(key).field(aggsVal.get("field")) - .dateHistogramInterval(dateHistogramInterval)); - - } else if ("TERMS".equalsIgnoreCase(en.getKey())) { - Map aggVal = (Map) en.getValue(); - for (Map.Entry entryS : aggVal.entrySet()) { - - /* - * searchSourceBuilder.aggregation(AggregationBuilders. - * dateHistogram(key).field(aggsVal.get("field")) - * .dateHistogramInterval(Date)); - */ - - } - - } - } - - } - long stopTime = System.currentTimeMillis(); - long elapsedTime = stopTime - startTime; - logger.info("ElasticSearchUtil addAggregations method end at ==" + stopTime + " ,Total time elapsed = " - + elapsedTime); - } - - @SuppressWarnings("unchecked") - private void addAdditionalProperties(BoolQueryBuilder query, Entry entry) { - long startTime = System.currentTimeMillis(); - logger.info("ElasticSearchUtil addAdditionalProperties method started at ==" + startTime); - String key = entry.getKey(); - - if (key.equalsIgnoreCase("FILTERS")) { - - Map filters = (Map) entry.getValue(); - for (Map.Entry en : filters.entrySet()) { - createFilterESOpperation(en, query); - } - } else if (key.equalsIgnoreCase("EXISTS") || key.equalsIgnoreCase("NOT_EXISTS")) { - createESOpperation(entry, query); - } - long stopTime = System.currentTimeMillis(); - long elapsedTime = stopTime - startTime; - logger.info("ElasticSearchUtil addAdditionalProperties method end at ==" + stopTime + " ,Total time elapsed = " - + elapsedTime); - } - - /** Method to create EXISTS and NOT EXIST FILTER QUERY . */ - @SuppressWarnings("unchecked") - private void createESOpperation(Entry entry, BoolQueryBuilder query) { - - String operation = entry.getKey(); - List existsList = (List) entry.getValue(); - - if (operation.equalsIgnoreCase("EXISTS")) { - for (String name : existsList) { - query.must(createExistQuery(name)); - } - } else if (operation.equalsIgnoreCase("NOT_EXISTS")) { - for (String name : existsList) { - query.mustNot(createExistQuery(name)); - } - } - } - - /** Method to create CommonTermQuery , multimatch and Range Query. */ - @SuppressWarnings("unchecked") - private void createFilterESOpperation(Entry entry, BoolQueryBuilder query) { - - String key = entry.getKey(); - Object val = entry.getValue(); - if (val instanceof List) { - if (!((List) val).isEmpty()) { - if (((List) val).get(0) instanceof String) { - ((List) val).replaceAll(String::toLowerCase); - query.must(createTermsQuery(key, (List) val)); - } else { - query.must(createTermsQuery(key, (List) val)); - } - } - } else if (val instanceof Map) { - Map value = (Map) val; - Map rangeOperation = new HashMap<>(); - Map lexicalOperation = new HashMap<>(); - for (Map.Entry it : value.entrySet()) { - String operation = it.getKey(); - if (operation.startsWith(ElasticSearchConstants.LT) - || operation.startsWith(ElasticSearchConstants.GT)) { - rangeOperation.put(operation, it.getValue()); - } else if (operation.startsWith(ElasticSearchConstants.STARTS_WITH) - || operation.startsWith(ElasticSearchConstants.ENDS_WITH)) { - lexicalOperation.put(operation, it.getValue()); - } - } - if (!(rangeOperation.isEmpty())) { - query.must(createRangeQuery(key, rangeOperation)); - } - if (!(lexicalOperation.isEmpty())) { - query.must(createLexicalQuery(key, lexicalOperation)); - } - - } else if (val instanceof String) { - query.must(createTermQuery(key, ((String) val).toLowerCase())); - } else { - query.must(createTermQuery(key, val)); - } - } - - private static TermQueryBuilder createTermQuery(String name, Object text) { - - return QueryBuilders.termQuery(name, text); - - } - - @SuppressWarnings("unchecked") - private static TermsQueryBuilder createTermsQuery(String key, List values) { - - return QueryBuilders.termsQuery(key, (values).stream().toArray(Object[]::new)); - - } - - private static Map getConstraints(SearchDto searchDTO) { - if (null != searchDTO.getSoftConstraints() && !searchDTO.getSoftConstraints().isEmpty()) { - return searchDTO.getSoftConstraints().entrySet().stream() - .collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().floatValue())); - } - return Collections.emptyMap(); - } - - @Override - public boolean healthCheck() { - // TODO Auto-generated method stub - return false; - } - - /// New Methods for Elastic Search Query Builders - - private RangeQueryBuilder createRangeQuery(String name, Map rangeOperation) { - - RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(name); - for (Map.Entry it : rangeOperation.entrySet()) { - if (it.getKey().equalsIgnoreCase(ElasticSearchConstants.LTE)) { - rangeQueryBuilder.lte(it.getValue()); - } else if (it.getKey().equalsIgnoreCase(ElasticSearchConstants.LT)) { - rangeQueryBuilder.lt(it.getValue()); - } else if (it.getKey().equalsIgnoreCase(ElasticSearchConstants.GTE)) { - rangeQueryBuilder.gte(it.getValue()); - } else if (it.getKey().equalsIgnoreCase(ElasticSearchConstants.GT)) { - rangeQueryBuilder.gt(it.getValue()); - } - } - - return rangeQueryBuilder; - } - - private SortOrder getSortOrder(String value) { - return value.equalsIgnoreCase(ElasticSearchConstants.ASC_ORDER) ? SortOrder.ASC : SortOrder.DESC; - } - - private QueryBuilder createLexicalQuery(String key, Map rangeOperation) { - QueryBuilder queryBuilder = null; - for (Map.Entry it : rangeOperation.entrySet()) { - if (it.getKey().equalsIgnoreCase(ElasticSearchConstants.STARTS_WITH)) { - - queryBuilder = QueryBuilders.prefixQuery(key, (String) it.getValue()); - } else if (it.getKey().equalsIgnoreCase(ElasticSearchConstants.ENDS_WITH)) { - String endsWithRegex = "~" + it.getValue(); - queryBuilder = QueryBuilders.regexpQuery(key, endsWithRegex); - } - } - return queryBuilder; - } - - private ExistsQueryBuilder createExistQuery(String name) { - return QueryBuilders.existsQuery(name); - } -/* - - @SuppressWarnings("unchecked") - @Override - public ElasticSearchDictator createSearchDictator(AggregateRequestDto dto, String tenant) throws Exception { - ElasticSearchDictator dictator = new ElasticSearchDictator(); - if (dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_WRT_TIME) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_DAY_WISE) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_REASON) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_GENDER) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_AGEGROUP) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_TIME) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_TOP_PERFORMING) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_LEAST_PERFORMING)) { - dictator.setIndexName(tenant + ratingElasticIndexName); - dictator.setDocumentType(ratingElasticDocType); - } else { - dictator.setIndexName(tenant + transactionElasticIndexName); - dictator.setDocumentType(transactionElasticDocType); - } - if (StringUtils.isNotBlank(dto.getServiceApi())) { - dictator.setVisualisationName(dto.getServiceApi()); - } - Map>> queryMap = new HashMap<>(); - if (dto.getCustomData() != null) { - for (Map.Entry entry : dto.getCustomData().entrySet()) { - if (StringUtils.isNotBlank(entry.getKey()) && entry.getValue() != null) { - List valueList = new ArrayList<>(); - - if (entry.getValue() instanceof ArrayList) { - - List valueArray = (ArrayList) entry.getValue(); - - for (Object value : valueArray) { - valueList.add(value); - } - } else { - valueList.add(entry.getValue()); - } - if (!valueList.isEmpty()) { - String entryKey = entry.getKey(); - if (dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_WRT_TIME) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_DAY_WISE) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_REASON) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_GENDER) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_AGEGROUP) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_TIME) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_TOP_PERFORMING) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_LEAST_PERFORMING)) { - - entryKey = "storeId"; - } - if (queryMap.containsKey(ElasticProperties.Query.MATCH_CONDITION)) { - Map> queryInnerMap = queryMap - .get(ElasticProperties.Query.MATCH_CONDITION); - queryInnerMap.put(entryKey, valueList); - } else { - Map> queryInnerMap = new HashMap<>(); - queryInnerMap.put(entryKey, valueList); - queryMap.put(ElasticProperties.Query.MATCH_CONDITION, queryInnerMap); - } - } - } - } - } - - if (dto.getDates() != null) { - if (StringUtils.isNotBlank(dto.getDates().getStartDate()) - && StringUtils.isNotBlank(dto.getDates().getEndDate())) { - List valueList = new ArrayList<>(); - - valueList.add(dto.getDates().getStartDate()); - valueList.add(dto.getDates().getEndDate()); - Map> queryInnerMap = new HashMap<>(); - if (dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_WRT_TIME) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_REASON) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_GENDER) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_AGEGROUP) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_STORE_TIME) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_TOP_PERFORMING) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_LEAST_PERFORMING) - || dto.getServiceApi().equals(ServiceApiConstants.CSAT_DAY_WISE)) { - queryInnerMap.put(ElasticProperties.Query.FEEDBACK_DATE_TIME, valueList); - } else { - queryInnerMap.put(ElasticProperties.Query.TRANSACTION_DATE_FIELD, valueList); - } - - queryMap.put(ElasticProperties.Query.RANGE_CONDITION, queryInnerMap); - } - } - dictator.setQueryMap(queryMap); - - */ -/* - * Map>> aggregationMap = new - * HashMap<>(); Map> innerMap = new - * HashMap<>(); Map deepInnerMap = new HashMap<>(); - *//* - - - return dictator; - - } -*/ - - /** - * Performs request marshalling using elastic search client API - * @param dictator - * @return - */ - - @SuppressWarnings("unchecked") - @Override - public SearchRequest buildElasticSearchQuery(ElasticSearchDictator dictator) { - SearchSourceBuilder searchBuilder = buildSearchSourceBuilder(); - BoolQueryBuilder boolQuery = buildBoolQuery(); - String localDateStartRange = null; - String localDateEndRange = null; - if (dictator.getQueryMap().containsKey(ElasticProperties.Query.RANGE_CONDITION)) { - - String searchParamRange = null; - Map> innerMap = dictator.getQueryMap().get(ElasticProperties.Query.RANGE_CONDITION); - for (Entry> en : innerMap.entrySet()) { - searchParamRange = en.getKey(); - localDateStartRange = (String) en.getValue().get(0); - localDateEndRange = (String) en.getValue().get(1); - } - - addMustOnBoolQuery(boolQuery, buildRangeQuery(searchParamRange, localDateStartRange, localDateEndRange)); - - } - - if (dictator.getQueryMap().containsKey(ElasticProperties.Query.MATCH_CONDITION)) { - String searchTermField = null; - Map> innerMap = dictator.getQueryMap().get(ElasticProperties.Query.MATCH_CONDITION); - for (Entry> en : innerMap.entrySet()) { - searchTermField = en.getKey(); - addFilterTermsOnBoolQuery(boolQuery, buildTermsQuery(searchTermField, en.getValue())); - } - } - - addQueryToSearchBuilder(searchBuilder, boolQuery); - - DateHistogramAggregationBuilder dateAggBuilder = null; - AvgAggregationBuilder avgAggBuilder = null; - SumAggregationBuilder sumAggBuilder = null; - TermsAggregationBuilder termsAggBuilder = null; - NestedAggregationBuilder nestedAggBuilder = null; - ValueCountAggregationBuilder valueCountAggBuilder = null; - if(dictator.getQueryAggregationMap()==null) { - return new SearchRequest(dictator.getIndexName()).types(dictator.getDocumentType()).source(searchBuilder); - } - - for (Map.Entry itr : dictator.getQueryAggregationMap().entrySet()) { - - String aggregationType = itr.getKey(); - Object value = itr.getValue(); - if (ElasticProperties.Query.NESTED.equals(aggregationType.toUpperCase())) { - Map nestedMap = null; - if (value instanceof HashMap) { - nestedMap = (HashMap) value; - } else if (value instanceof LinkedHashMap) { - nestedMap = (LinkedHashMap) value; - } - String aggregationName = aggregationType + "of" - + nestedMap.get(ElasticProperties.Query.PATH.toLowerCase()); - aggregationName = String.valueOf(nestedMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - nestedAggBuilder = buildNestedAggregationBuilder(aggregationName, nestedMap); - - } else if (ElasticProperties.Query.SUM.equals(aggregationType.toUpperCase())) { - Map sumMap = null; - if (value instanceof HashMap) { - sumMap = (HashMap) value; - } else if (value instanceof LinkedHashMap) { - sumMap = (LinkedHashMap) value; - } - String aggregationName = aggregationType + "of" - + sumMap.get(ElasticProperties.Query.FIELD.toLowerCase()); - aggregationName = String.valueOf(sumMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - sumAggBuilder = buildSumAggregation(aggregationName, - String.valueOf(sumMap.get(ElasticProperties.Query.FIELD.toLowerCase()))); - } else if (ElasticProperties.Query.TERM.equals(aggregationType.toUpperCase())) { - Map termMap = null; - if (value instanceof HashMap) { - termMap = (HashMap) value; - } else if (value instanceof LinkedHashMap) { - termMap = (LinkedHashMap) value; - - } - String aggregationName = aggregationType + "of" - + termMap.get(ElasticProperties.Query.FIELD.toLowerCase()); - aggregationName = String.valueOf(termMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - termsAggBuilder = buildTermAggregation(aggregationName, termMap); - - } else if (ElasticProperties.Query.DATE_HISTOGRAM.equals(aggregationType.toUpperCase())) { - Map histogramMap = null; - - if (value instanceof HashMap) { - histogramMap = (HashMap) value; - } else if (value instanceof LinkedHashMap) { - histogramMap = (LinkedHashMap) value; - - } - String aggregationName = aggregationType + "of" - + histogramMap.get(ElasticProperties.Query.FIELD.toLowerCase()); - aggregationName = String.valueOf(histogramMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - dateAggBuilder = buildDateHistogramAggregation(aggregationName, - histogramMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString(), - histogramMap.get(ElasticProperties.Query.INTERVAL.toLowerCase()).toString().toUpperCase(), - Long.parseLong(localDateStartRange), Long.parseLong(localDateEndRange)); - - } else if (ElasticProperties.Query.COUNT.equals(aggregationType.toUpperCase())) { - Map countAggMap = null; - - if (value instanceof HashMap) { - countAggMap = (HashMap) value; - } else if (value instanceof LinkedHashMap) { - countAggMap = (LinkedHashMap) value; - - } - String countField = countAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString(); - String countAggName = aggregationType + "of" + countField; - countAggName = String.valueOf(countAggMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - valueCountAggBuilder = buildCountsAggregationQuery(countAggName, countField); - } else if (ElasticProperties.Query.AGGREGATION_CONDITION.equals(aggregationType.toUpperCase())) { - - Map firstLevelAggMap = (LinkedHashMap) value; - for (Map.Entry firstLevelItrEntry : firstLevelAggMap.entrySet()) { - - String firstLevelEntryKey = firstLevelItrEntry.getKey(); - Object firstLevelEntryValue = firstLevelItrEntry.getValue(); - if (ElasticProperties.Query.SUM.equals(firstLevelEntryKey.toUpperCase())) { - Map sumAggMap = (LinkedHashMap) firstLevelEntryValue; - String sumField = sumAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString(); - String sumAggName = firstLevelEntryKey + "of" + sumField; - sumAggName = String.valueOf(sumAggMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - if (termsAggBuilder != null) { - termsAggBuilder = buildSubSumAggreationForTerms(termsAggBuilder, sumAggName, sumField); - } else if (dateAggBuilder != null) { - dateAggBuilder = buildSubSumAggreationForDateHistogram(dateAggBuilder, sumAggName, - sumField); - } - } else if (ElasticProperties.Query.AVG.equals(firstLevelEntryKey.toUpperCase())) { - Map avgAggMap = (LinkedHashMap) firstLevelEntryValue; - String avgField = avgAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString(); - String avgAggName = firstLevelEntryKey + "of" + avgField; - avgAggName = String.valueOf(avgAggMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - if (termsAggBuilder != null) { - termsAggBuilder = buildSubAvgAggreationForTerms(termsAggBuilder, avgAggName, avgField); - } else if (dateAggBuilder != null) { - dateAggBuilder = buildSubSumAggreationForDateHistogram(dateAggBuilder, avgAggName, - avgField); - } - } else if (ElasticProperties.Query.COUNT.equals(firstLevelEntryKey.toUpperCase())) { - Map countAggMap = (LinkedHashMap) firstLevelEntryValue; - String countField = countAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString(); - String countAggName = firstLevelEntryKey + "of" + countField; - countAggName = String.valueOf(countAggMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - if (termsAggBuilder != null) { - termsAggBuilder = buildSubCountAggregationForTerms(termsAggBuilder, countAggName, - countField); - } else if (dateAggBuilder != null) { - dateAggBuilder = buildSubCountAggregationForDateHistogram(dateAggBuilder, countAggName, - countField); - } - } else if (ElasticProperties.Query.TERM.equals(firstLevelEntryKey.toUpperCase())) { - Map subTermAggMap = (LinkedHashMap) firstLevelEntryValue; - String subTermAggName = firstLevelEntryKey + "of" - + subTermAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString(); - subTermAggName = String.valueOf(subTermAggMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - if (nestedAggBuilder != null) { - buildSubTermsAggregationForNested(nestedAggBuilder, subTermAggName, - subTermAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString()); - } else if (dateAggBuilder != null) { - buildSubTermsAggregationForHistogram(dateAggBuilder, subTermAggName, - subTermAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString()); - } else if (termsAggBuilder != null) { - buildSubTermsAggregationForTerms(termsAggBuilder, subTermAggName, - subTermAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()).toString()); - } - - } else if (ElasticProperties.Query.AGGREGATION_CONDITION.equals(firstLevelEntryKey.toUpperCase())) { - - Map secondLevelAggMap = (LinkedHashMap) firstLevelEntryValue; - for (Map.Entry secondLevelItrEntry : secondLevelAggMap.entrySet()) { - String secondLevelItrEntryKey = secondLevelItrEntry.getKey(); - Object secondLevelItrEntryValue = secondLevelItrEntry.getValue(); - if (ElasticProperties.Query.SUM.equals(secondLevelItrEntryKey.toUpperCase())) { - Map subSumAggMap = (LinkedHashMap) secondLevelItrEntryValue; - - String subSumField = subSumAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()) - .toString(); - String subSumAggName = secondLevelItrEntryKey + "of" + subSumField; - subSumAggName = String.valueOf(subSumAggMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - - if (nestedAggBuilder != null) { - List aggBuilders = nestedAggBuilder.getSubAggregations(); - for (AggregationBuilder aggregationBuilder : aggBuilders) { - - if (aggregationBuilder instanceof TermsAggregationBuilder) { - TermsAggregationBuilder subTermAggBuilder = (TermsAggregationBuilder) aggregationBuilder; - subTermAggBuilder = buildSubSumAggreationForTerms(subTermAggBuilder, - subSumAggName, subSumField); - - } - } - } - } else if (ElasticProperties.Query.COUNT.equals(secondLevelItrEntryKey.toUpperCase())) { - Map subCountAggMap = (LinkedHashMap) secondLevelItrEntryValue; - - String subCountField = subCountAggMap.get(ElasticProperties.Query.FIELD.toLowerCase()) - .toString(); - String subCountAggName = secondLevelItrEntryKey + "of" + subCountField; - subCountAggName = String.valueOf(subCountAggMap.get(ElasticProperties.Query.LABEL.toLowerCase())); - - if (dateAggBuilder != null) { - List aggBuilders = dateAggBuilder.getSubAggregations(); - for (AggregationBuilder aggregationBuilder : aggBuilders) { - - if (aggregationBuilder instanceof TermsAggregationBuilder) { - TermsAggregationBuilder subTermAggBuilder = (TermsAggregationBuilder) aggregationBuilder; - subTermAggBuilder = buildSubCountAggregationForTerms(subTermAggBuilder, - subCountAggName, subCountField); - } - } - } - } - } - } - } - } - } - - if (dateAggBuilder != null) { - addAggregationToSearchBuilder(searchBuilder, dateAggBuilder); - } - if (sumAggBuilder != null) { - addSumAggregationToSearchBuilder(searchBuilder, sumAggBuilder); - } - if (avgAggBuilder != null) { - addAvgAggregationToSearchBuilder(searchBuilder, avgAggBuilder); - } - if (valueCountAggBuilder != null) { - addValueCountAggregationToSearchBuilder(searchBuilder, valueCountAggBuilder); - } - if (termsAggBuilder != null) { - addTermsAggregationToSearchBuilder(searchBuilder, termsAggBuilder); - } - if (nestedAggBuilder != null) { - addNestedAggregationToSearchBuilder(searchBuilder, nestedAggBuilder); - } - return new SearchRequest(dictator.getIndexName()).types(dictator.getDocumentType()).source(searchBuilder); - } - - private NestedAggregationBuilder buildSubTermsAggregationForNested(NestedAggregationBuilder nestedAggBuilder, - String subAggregationName, String fieldName) { - return nestedAggBuilder.subAggregation(AggregationBuilders.terms(subAggregationName).field(fieldName)); - - } - - private void addNestedAggregationToSearchBuilder(SearchSourceBuilder searchBuilder, - NestedAggregationBuilder nestedAggBuilder) { - searchBuilder.aggregation(nestedAggBuilder); - } - - private RangeQueryBuilder buildRangeQuery(String fieldName, Object startRange, Object endRange) { - return QueryBuilders.rangeQuery(fieldName).gte(startRange).lte(endRange); - } - - private TermQueryBuilder buildTermQuery(String fieldName, Object fieldValue) { - return QueryBuilders.termQuery(fieldName, fieldValue); - } - - private TermsQueryBuilder buildTermsQuery(String fieldName, List fieldValue) { - return QueryBuilders.termsQuery(fieldName, fieldValue); - } - - private MatchQueryBuilder buildMatchQuery(String fieldName, Object fieldValue) { - return QueryBuilders.matchQuery(fieldName, fieldValue); - } - - private ValueCountAggregationBuilder buildCountsAggregationQuery(String aggregationName, String fieldName) { - return AggregationBuilders.count(aggregationName).field(fieldName); - } - - private SumAggregationBuilder buildSumAggregation(String aggregationName, String fieldName) { - return AggregationBuilders.sum(aggregationName).field(fieldName); - } - - @SuppressWarnings("unchecked") - private TermsAggregationBuilder buildTermAggregation(String aggregationName, Map paramMap) { - TermsAggregationBuilder aggBuilder = AggregationBuilders.terms(aggregationName); - for (Map.Entry param : paramMap.entrySet()) { - if (param.getKey().toUpperCase().equals(ElasticProperties.Query.FIELD)) { - aggBuilder = aggBuilder.field((String) param.getValue()); - } else if (param.getKey().toUpperCase().equals(ElasticProperties.Query.SIZE)) { - aggBuilder = aggBuilder.size((Integer) param.getValue()); - } else if (param.getKey().toUpperCase().equals(ElasticProperties.Query.ORDER)) { - Map keyMap = (HashMap) param.getValue(); - BucketOrder order = null; - for (Map.Entry valueMap : keyMap.entrySet()) { - Map orderMap = (HashMap) valueMap.getValue(); - - String key = valueMap.getKey() + "of" + orderMap.get(ElasticProperties.Query.FIELD.toLowerCase()); - - order = BucketOrder.aggregation(key, - orderMap.get("orderBy").toUpperCase().equals(ElasticProperties.Query.ASC) ? true : false); - } - aggBuilder = aggBuilder.order(order); - } - } - return aggBuilder; - - } - - private AvgAggregationBuilder buildAvgAggregation(String aggregationName, String fieldName) { - return AggregationBuilders.avg(aggregationName).field(fieldName); - } - - private NestedAggregationBuilder buildNestedAggregationBuilder(String aggregationName, - Map paramMap) { - String pathName = paramMap.get(ElasticProperties.Query.PATH.toLowerCase()).toString(); - return AggregationBuilders.nested(aggregationName, pathName); - } - - private AggregationBuilder buildSubTermForNestedAggregation(NestedAggregationBuilder nestedBuilder, - String aggregationName, Map paramMap) { - return nestedBuilder.subAggregation(buildTermAggregation(aggregationName, paramMap)); - - } - - private DateHistogramAggregationBuilder buildDateHistogramAggregation(String aggregationName, String fieldName, - String interval, Long boundMin, Long boundMax) { - DateHistogramInterval dateHistogramInterval = null; - if (ElasticProperties.Query.HOUR.equals(interval)) { - dateHistogramInterval = DateHistogramInterval.HOUR; - } else if (ElasticProperties.Query.DAY.equals(interval)) { - dateHistogramInterval = DateHistogramInterval.DAY; - } else if (ElasticProperties.Query.MINUTE.equals(interval)) { - dateHistogramInterval = DateHistogramInterval.MINUTE; - } else if (ElasticProperties.Query.MONTH.equals(interval)) { - dateHistogramInterval = DateHistogramInterval.MONTH; - - } - return AggregationBuilders.dateHistogram(aggregationName).field(fieldName) - .dateHistogramInterval(dateHistogramInterval).format("epoch_millis") - .extendedBounds(new ExtendedBounds(boundMin, boundMax)); - } - - private DateHistogramAggregationBuilder buildSubSumAggreationForDateHistogram( - DateHistogramAggregationBuilder builder, String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.sum(aggregationName).field(fieldName)); - } - - private DateHistogramAggregationBuilder buildSubCummulativeSumAggreationForDateHistogram( - DateHistogramAggregationBuilder builder, String aggregationName, String fieldName) { - PipelineAggregationBuilder pipeLineAggregation = new CumulativeSumPipelineAggregationBuilder(aggregationName, - fieldName); - return builder.subAggregation(pipeLineAggregation); - } - - private DateHistogramAggregationBuilder buildSubAvgAggreationForDateHistogram( - DateHistogramAggregationBuilder builder, String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.avg(aggregationName).field(fieldName)); - } - - private DateHistogramAggregationBuilder buildSubCountAggregationForDateHistogram( - DateHistogramAggregationBuilder builder, String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.count(aggregationName).field(fieldName)); - } - - private TermsAggregationBuilder buildSubCountAggregationForTerms(TermsAggregationBuilder builder, - String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.count(aggregationName).field(fieldName)); - } - - private TermsAggregationBuilder buildSubTermsAggregationForTerms(TermsAggregationBuilder builder, - String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.terms(aggregationName).field(fieldName)); - } - - private DateHistogramAggregationBuilder buildSubTermsAggregationForHistogram( - DateHistogramAggregationBuilder builder, String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.terms(aggregationName).field(fieldName)); - } - - private TermsAggregationBuilder buildSubSumAggreationForTerms(TermsAggregationBuilder builder, - String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.sum(aggregationName).field(fieldName)); - } - - private TermsAggregationBuilder buildSubAvgAggreationForTerms(TermsAggregationBuilder builder, - String aggregationName, String fieldName) { - return builder.subAggregation(AggregationBuilders.avg(aggregationName).field(fieldName)); - } - - private SumAggregationBuilder buildSubSumAggregation(SumAggregationBuilder builder, String aggregationName, - String fieldName) { - return builder.subAggregation(AggregationBuilders.sum(aggregationName).field(fieldName)); - } - - private AvgAggregationBuilder buildSubAvgAggregation(AvgAggregationBuilder builder, String aggregationName, - String fieldName) { - return builder.subAggregation(AggregationBuilders.avg(aggregationName).field(fieldName)); - } - - private BoolQueryBuilder buildBoolQuery() { - return QueryBuilders.boolQuery(); - } - - private BoolQueryBuilder addMustOnBoolQuery(BoolQueryBuilder builder, RangeQueryBuilder rangeBuilder) { - return builder.must(rangeBuilder); - } - - private BoolQueryBuilder addFilterOnBoolQuery(BoolQueryBuilder builder, TermQueryBuilder termBuilder) { - return builder.filter(termBuilder); - } - - private BoolQueryBuilder addFilterTermsOnBoolQuery(BoolQueryBuilder builder, TermsQueryBuilder termBuilder) { - return builder.filter(termBuilder); - } - - private BoolQueryBuilder addMatchOnBoolQuery(BoolQueryBuilder builder, MatchQueryBuilder matchBuilder) { - return builder.filter(matchBuilder); - } - - private SearchSourceBuilder buildSearchSourceBuilder() { - return new SearchSourceBuilder().size(0); - } - - private SearchSourceBuilder addQueryToSearchBuilder(SearchSourceBuilder builder, BoolQueryBuilder queryBuilder) { - return builder.query(queryBuilder); - } - - private SearchSourceBuilder addAggregationToSearchBuilder(SearchSourceBuilder builder, - DateHistogramAggregationBuilder aggBuilder) { - return builder.aggregation(aggBuilder); - } - - private SearchSourceBuilder addSumAggregationToSearchBuilder(SearchSourceBuilder builder, - SumAggregationBuilder aggBuilder) { - return builder.aggregation(aggBuilder); - } - - private SearchSourceBuilder addAvgAggregationToSearchBuilder(SearchSourceBuilder builder, - AvgAggregationBuilder aggBuilder) { - return builder.aggregation(aggBuilder); - } - - private SearchSourceBuilder addValueCountAggregationToSearchBuilder(SearchSourceBuilder builder, - ValueCountAggregationBuilder aggBuilder) { - return builder.aggregation(aggBuilder); - } - private SearchSourceBuilder addTermsAggregationToSearchBuilder(SearchSourceBuilder builder, - TermsAggregationBuilder aggBuilder) { - return builder.aggregation(aggBuilder); - } - - @Override - public MultiSearchResponse executeMultiSearchRequest(List searchRequestList, String tenant) { - MultiSearchRequest multiRequest = new MultiSearchRequest(); - MultiSearchResponse response = null; - - for (SearchRequest request : searchRequestList) { - logger.info("ES Query is : " + request.source()); - multiRequest.add(request); - } - - try { - response = client.multiSearch(multiRequest); - } catch (IOException e) { - logger.error("Encountered an error while connecting : " + e); - logger.error("Error Message to report : " + e.getMessage()); - } - - return response; - } - - private RestHighLevelClient getClientForElastic() { - return new RestHighLevelClient(RestClient.builder(new HttpHost(elasticHost, elasticPort, REST_SCHEME))); - } - - private RestHighLevelClient getClientForAlternate() throws MalformedURLException { - URL url = new URL ("https://egov-micro-dev.egovernments.org/elasticsearch/"); - return new RestHighLevelClient(RestClient.builder(new HttpHost(url.getHost(), url.getPort(), REST_SCHEME2))); - } - -/* @SuppressWarnings("unchecked") - @Override - public ElasticSearchDictator createSearchDictator(String indexName, String documentType, - CummulativeDataRequestDto dto, String dateField) throws Exception { - ElasticSearchDictator dictator = new ElasticSearchDictator(); - - dictator.setIndexName(indexName); - dictator.setDocumentType(documentType); - - Map>> queryMap = new HashMap<>(); - if (dto.getCustomData() != null) { - for (Map.Entry entry : dto.getCustomData().entrySet()) { - if (StringUtils.isNotBlank(entry.getKey()) && entry.getValue() != null) { - List valueList = new ArrayList<>(); - - if (entry.getValue() instanceof ArrayList) { - - List valueArray = (ArrayList) entry.getValue(); - - for (Object value : valueArray) { - valueList.add(value); - } - } else { - valueList.add(entry.getValue()); - } - if (!valueList.isEmpty()) { - String entryKey = entry.getKey(); - if (queryMap.containsKey(ElasticProperties.Query.MATCH_CONDITION)) { - Map> queryInnerMap = queryMap - .get(ElasticProperties.Query.MATCH_CONDITION); - queryInnerMap.put(entryKey, valueList); - } else { - Map> queryInnerMap = new HashMap<>(); - queryInnerMap.put(entryKey, valueList); - queryMap.put(ElasticProperties.Query.MATCH_CONDITION, queryInnerMap); - } - } - } - } - } - - if (dto.getDates() != null) { - if (StringUtils.isNotBlank(dto.getDates().getStartDate()) - && StringUtils.isNotBlank(dto.getDates().getEndDate())) { - List valueList = new ArrayList<>(); - - valueList.add(dto.getDates().getStartDate()); - valueList.add(dto.getDates().getEndDate()); - Map> queryInnerMap = new HashMap<>(); - queryInnerMap.put(dateField, valueList); - queryMap.put(ElasticProperties.Query.RANGE_CONDITION, queryInnerMap); - } - } - dictator.setQueryMap(queryMap); - - *//* - * Map>> aggregationMap = new - * HashMap<>(); Map> innerMap = new - * HashMap<>(); Map deepInnerMap = new HashMap<>(); - *//* - - return dictator; - } - - @Override - public ElasticSearchDictator createSearchDictator(AggregateRequestDto dto, String indexName, String documentType, - String filterDateField) throws Exception { - ElasticSearchDictator dictator = new ElasticSearchDictator(); - - dictator.setIndexName(indexName); - dictator.setDocumentType(documentType); - if (StringUtils.isNotBlank(dto.getServiceApi())) { - dictator.setVisualisationName(dto.getServiceApi()); - } - - Map>> queryMap = new HashMap<>(); - if (dto.getCustomData() != null) { - for (Map.Entry entry : dto.getCustomData().entrySet()) { - if (StringUtils.isNotBlank(entry.getKey()) && entry.getValue() != null) { - List valueList = new ArrayList<>(); - - if (entry.getValue() instanceof ArrayList) { - - List valueArray = (ArrayList) entry.getValue(); - - for (Object value : valueArray) { - valueList.add(value); - } - } else { - valueList.add(entry.getValue()); - } - if (!valueList.isEmpty()) { - String entryKey = entry.getKey(); - if (queryMap.containsKey(ElasticProperties.Query.MATCH_CONDITION)) { - Map> queryInnerMap = queryMap - .get(ElasticProperties.Query.MATCH_CONDITION); - queryInnerMap.put(entryKey, valueList); - } else { - Map> queryInnerMap = new HashMap<>(); - queryInnerMap.put(entryKey, valueList); - queryMap.put(ElasticProperties.Query.MATCH_CONDITION, queryInnerMap); - } - } - } - } - } - - if (dto.getDates() != null) { - if (StringUtils.isNotBlank(dto.getDates().getStartDate()) - && StringUtils.isNotBlank(dto.getDates().getEndDate())) { - List valueList = new ArrayList<>(); - - valueList.add(dto.getDates().getStartDate()); - valueList.add(dto.getDates().getEndDate()); - Map> queryInnerMap = new HashMap<>(); - - queryInnerMap.put(filterDateField, valueList); - - queryMap.put(ElasticProperties.Query.RANGE_CONDITION, queryInnerMap); - } - } - dictator.setQueryMap(queryMap); - return dictator; - }*/ - - /** - * Creates a ElasticSearchDictator object creates a query map - * eg: if RequestDate is present the below map is added: - * {"RANGE": {"Data.dateOfComplaint" : [1585679400000,1617215399000]}} - * @param dto - * @param indexName - * @param documentType - * @param filterDateField - * @return - * @throws Exception - */ - - @Override - public ElasticSearchDictator createSearchDictatorV2(AggregateRequestDto dto, String indexName, String documentType, - String filterDateField) throws Exception { - ElasticSearchDictator dictator = new ElasticSearchDictator(); - - dictator.setIndexName(indexName); - dictator.setDocumentType(documentType); - - Map>> queryMap = new HashMap<>(); - if (dto.getEsFilters() != null && !dto.getEsFilters().isEmpty()) { - - for (Map.Entry entry : dto.getEsFilters().entrySet()) { - - if (StringUtils.isNotBlank(entry.getKey()) && entry.getValue() != null) { - List valueList = new ArrayList<>(); - - if (entry.getValue() instanceof ArrayList) { - - List valueArray = (ArrayList) entry.getValue(); - - for (Object value : valueArray) { - String valueString = ""; - if(entry.getKey().equals("dataObject.tenantId")) { - valueString = String.valueOf(value); - valueString = valueString.replace("uat: ", ""); - } - if(StringUtils.isBlank(valueString)) valueList.add(value); - else valueList.add(valueString); - } - } else { - String valueString = ""; - if(entry.getKey().equals("dataObject.tenantId")) { - valueString = String.valueOf(entry.getValue()); - valueString = valueString.replace("uat: ", ""); - } - if(StringUtils.isBlank(valueString)) valueList.add(entry.getValue()); - else valueList.add(valueString); - } - if (!valueList.isEmpty()) { - String entryKey = entry.getKey(); - if (queryMap.containsKey(ElasticProperties.Query.MATCH_CONDITION)) { - Map> queryInnerMap = queryMap - .get(ElasticProperties.Query.MATCH_CONDITION); - queryInnerMap.put(entryKey, valueList); - } else { - Map> queryInnerMap = new HashMap<>(); - queryInnerMap.put(entryKey, valueList); - queryMap.put(ElasticProperties.Query.MATCH_CONDITION, queryInnerMap); - } - } - } - } - } - - Map queryAggregationMap = new HashMap<>(); - if (dto.getAggregationFactors() != null && !dto.getAggregationFactors().isEmpty()) { - for (Map.Entry entry : dto.getAggregationFactors().entrySet()) { - if (StringUtils.isNotBlank(entry.getKey()) && entry.getValue() != null) { - Map innerAggregationMap = new HashMap<>(); - innerAggregationMap.put("field", entry.getValue()); - queryAggregationMap.put(entry.getKey(), innerAggregationMap); - } - } - } - dictator.setQueryAggregationMap(queryAggregationMap); - if (dto.getRequestDate() != null) { - if (StringUtils.isNotBlank(dto.getRequestDate().getStartDate()) - && StringUtils.isNotBlank(dto.getRequestDate().getEndDate())) { - List valueList = new ArrayList<>(); - - valueList.add(dto.getRequestDate().getStartDate()); - valueList.add(dto.getRequestDate().getEndDate()); - Map> queryInnerMap = new HashMap<>(); - - if(StringUtils.isNotBlank(filterDateField)) { - queryInnerMap.put(filterDateField, valueList); - queryMap.put(ElasticProperties.Query.RANGE_CONDITION, queryInnerMap); - } - } - } - dictator.setQueryMap(queryMap); - return dictator; - } - - @Override - public MultiSearchResponse executeMultiSearchRequest(List searchRequestList, Boolean primaryOrNot) { - MultiSearchRequest multiRequest = new MultiSearchRequest(); - MultiSearchResponse response = null; - for (SearchRequest request : searchRequestList) { - logger.info("ES Query is : " + request.source()); - multiRequest.add(request); - } - - try { - if(primaryOrNot) { - response = client.multiSearch(multiRequest); - } else { - logger.info("Alternate Client URL : " + alternateClient.toString()); - response = alternateClient.multiSearch(multiRequest); - } - - } catch (IOException e) { - logger.error("Encountered an error while connecting : " + e); - logger.error("Error Message to report : " + e.getMessage()); - } - return response; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateDto.java deleted file mode 100644 index 09f225ebccf..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateDto.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import com.tarento.analytics.enums.ChartType; - -/** - * @author Darshan Nagesh - * - */ -public class AggregateDto { - - private ChartType chartType; - - private String visualizationCode; - - private String chartFormat; - - private String drillDownChartId; - - public String getVisualizationCode() { - return visualizationCode; - } - - public void setVisualizationCode(String visualizationCode) { - this.visualizationCode = visualizationCode; - } - - public String getDrillDownChartId() { - return drillDownChartId; - } - - public void setDrillDownChartId(String drillDownChartId) { - this.drillDownChartId = drillDownChartId; - } - - private Map customData; - - private RequestDate dates; - - private Object filter; - - private List data = new ArrayList<>(); - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - public ChartType getChartType() { - return chartType; - } - - public void setChartType(ChartType chartType) { - this.chartType = chartType; - } - - public String getChartFormat() { - return chartFormat; - } - - public void setChartFormat(String chartFormat) { - this.chartFormat = chartFormat; - } - - - public Map getCustomData() { - return customData; - } - - public void setCustomData(Map customData) { - this.customData = customData; - } - - public RequestDate getDates() { - return dates; - } - - public void setDates(RequestDate dates) { - this.dates = dates; - } - - public Object getFilter() { - return filter; - } - - public void setFilter(Object filter) { - this.filter = filter; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateRequestDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateRequestDto.java deleted file mode 100644 index 859cdd5de15..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateRequestDto.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.tarento.analytics.dto; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.utils.ResponseRecorder; - -import java.util.Map; - -public class AggregateRequestDto { - - private String requestId; - private String visualizationType; - private String visualizationCode; - private String moduleLevel; - private String queryType; - private Map filters; - private Map esFilters; - private Map aggregationFactors; - private RequestDate requestDate; - private String interval; - private ObjectNode chartNode; - private ResponseRecorder responseRecorder; - - @JsonIgnore - private int hashKey; - - public AggregateRequestDto() {} - public AggregateRequestDto(AggregateRequestDtoV3 requestDtoV3, String visualizationType, String visualizationCode) { - this.visualizationCode = visualizationCode; - this.visualizationType = visualizationType; - this.moduleLevel = requestDtoV3.getModuleLevel(); - this.queryType = requestDtoV3.getQueryType(); - this.filters = requestDtoV3.getFilters(); - this.esFilters = requestDtoV3.getEsFilters(); - this.aggregationFactors = requestDtoV3.getAggregationFactors(); - this.requestDate = requestDtoV3.getRequestDate(); - this.interval = requestDtoV3.getInterval(); - this.chartNode = requestDtoV3.getChartNode(); - this.requestId= requestDtoV3.getRequestId(); - } - - - public String getRequestId() { - return requestId; - } - public void setRequestId(String requestId) { - this.requestId = requestId; - } - public ObjectNode getChartNode() { - return chartNode; - } - - public void setChartNode(ObjectNode chartNode) { - this.chartNode = chartNode; - } - - public String getModuleLevel() { - return moduleLevel; - } - public void setModuleLevel(String moduleLevel) { - this.moduleLevel = moduleLevel; - } - public Map getEsFilters() { - return esFilters; - } - public void setEsFilters(Map esFilters) { - this.esFilters = esFilters; - } - public String getVisualizationCode() { - return visualizationCode; - } - public void setVisualizationCode(String visualizationCode) { - this.visualizationCode = visualizationCode; - } - public String getVisualizationType() { - return visualizationType; - } - public void setVisualizationType(String visualizationType) { - this.visualizationType = visualizationType; - } - public String getQueryType() { - return queryType; - } - public void setQueryType(String queryType) { - this.queryType = queryType; - } - public Map getFilters() { - return filters; - } - public void setFilters(Map filters) { - this.filters = filters; - } - public Map getAggregationFactors() { - return aggregationFactors; - } - public void setAggregationFactors(Map aggregationFactors) { - this.aggregationFactors = aggregationFactors; - } - public RequestDate getRequestDate() { - return requestDate; - } - public void setRequestDate(RequestDate requestDate) { - this.requestDate = requestDate; - } - public String getInterval() { - return interval; - } - public void setInterval(String interval) { - this.interval = interval; - } - public ResponseRecorder getResponseRecorder() { - return responseRecorder; - } - public void setResponseRecorder(ResponseRecorder responseRecorder) { - this.responseRecorder = responseRecorder; - } - public int getHashKey() { return hashKey; } - public void setHashKey(int hashKey) { - this.hashKey = hashKey; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateRequestDtoV3.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateRequestDtoV3.java deleted file mode 100644 index 13b3a31f19a..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/AggregateRequestDtoV3.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.List; -import java.util.Map; - -import com.fasterxml.jackson.databind.node.ObjectNode; - -public class AggregateRequestDtoV3 { - - private String requestId; - private List visualizations; - private String moduleLevel; - private String queryType; - private Map filters; - private Map esFilters; - private Map aggregationFactors; - private RequestDate requestDate; - private String interval; - private ObjectNode chartNode; - - public ObjectNode getChartNode() { - return chartNode; - } - - public void setChartNode(ObjectNode chartNode) { - this.chartNode = chartNode; - } - public String getRequestId() { - return requestId; - } - - public void setRequestId(String requestId) { - this.requestId = requestId; - } - public String getModuleLevel() { - return moduleLevel; - } - public void setModuleLevel(String moduleLevel) { - this.moduleLevel = moduleLevel; - } - public Map getEsFilters() { - return esFilters; - } - public void setEsFilters(Map esFilters) { - this.esFilters = esFilters; - } - public String getQueryType() { - return queryType; - } - public void setQueryType(String queryType) { - this.queryType = queryType; - } - public Map getFilters() { - return filters; - } - public void setFilters(Map filters) { - this.filters = filters; - } - public Map getAggregationFactors() { - return aggregationFactors; - } - public void setAggregationFactors(Map aggregationFactors) { - this.aggregationFactors = aggregationFactors; - } - public RequestDate getRequestDate() { - return requestDate; - } - public void setRequestDate(RequestDate requestDate) { - this.requestDate = requestDate; - } - public String getInterval() { - return interval; - } - public void setInterval(String interval) { - this.interval = interval; - } - - public List getVisualizations() { - return visualizations; - } - - public void setVisualizations(List visualizations) { - this.visualizations = visualizations; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/City.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/City.java deleted file mode 100644 index f436509efb2..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/City.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "name", "localName", "districtCode", "districtName", "regionName", "ulbGrade", "longitude", - "latitude", "shapeFileLocation", "captcha", "code", "regionCode", "municipalityName" }) -public class City { - - @JsonProperty("name") - private String name; - @JsonProperty("localName") - private String localName; - @JsonProperty("districtCode") - private String districtCode; - @JsonProperty("districtName") - private String districtName; - @JsonProperty("regionName") - private String regionName; - @JsonProperty("ulbGrade") - private String ulbGrade; - @JsonProperty("longitude") - private Double longitude; - @JsonProperty("latitude") - private Double latitude; - @JsonProperty("shapeFileLocation") - private Object shapeFileLocation; - @JsonProperty("captcha") - private Object captcha; - @JsonProperty("code") - private String code; - @JsonProperty("regionCode") - private String regionCode; - @JsonProperty("municipalityName") - private String municipalityName; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - @JsonProperty("localName") - public String getLocalName() { - return localName; - } - - @JsonProperty("localName") - public void setLocalName(String localName) { - this.localName = localName; - } - - @JsonProperty("districtCode") - public String getDistrictCode() { - return districtCode; - } - - @JsonProperty("districtCode") - public void setDistrictCode(String districtCode) { - this.districtCode = districtCode; - } - - @JsonProperty("districtName") - public String getDistrictName() { - return districtName; - } - - @JsonProperty("districtName") - public void setDistrictName(String districtName) { - this.districtName = districtName; - } - - @JsonProperty("regionName") - public String getRegionName() { - return regionName; - } - - @JsonProperty("regionName") - public void setRegionName(String regionName) { - this.regionName = regionName; - } - - @JsonProperty("ulbGrade") - public String getUlbGrade() { - return ulbGrade; - } - - @JsonProperty("ulbGrade") - public void setUlbGrade(String ulbGrade) { - this.ulbGrade = ulbGrade; - } - - @JsonProperty("longitude") - public Double getLongitude() { - return longitude; - } - - @JsonProperty("longitude") - public void setLongitude(Double longitude) { - this.longitude = longitude; - } - - @JsonProperty("latitude") - public Double getLatitude() { - return latitude; - } - - @JsonProperty("latitude") - public void setLatitude(Double latitude) { - this.latitude = latitude; - } - - @JsonProperty("shapeFileLocation") - public Object getShapeFileLocation() { - return shapeFileLocation; - } - - @JsonProperty("shapeFileLocation") - public void setShapeFileLocation(Object shapeFileLocation) { - this.shapeFileLocation = shapeFileLocation; - } - - @JsonProperty("captcha") - public Object getCaptcha() { - return captcha; - } - - @JsonProperty("captcha") - public void setCaptcha(Object captcha) { - this.captcha = captcha; - } - - @JsonProperty("code") - public String getCode() { - return code; - } - - @JsonProperty("code") - public void setCode(String code) { - this.code = code; - } - - @JsonProperty("regionCode") - public String getRegionCode() { - return regionCode; - } - - @JsonProperty("regionCode") - public void setRegionCode(String regionCode) { - this.regionCode = regionCode; - } - - @JsonProperty("municipalityName") - public String getMunicipalityName() { - return municipalityName; - } - - @JsonProperty("municipalityName") - public void setMunicipalityName(String municipalityName) { - this.municipalityName = municipalityName; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/CummulativeDataRequestDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/CummulativeDataRequestDto.java deleted file mode 100644 index 3ba4bf8e7da..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/CummulativeDataRequestDto.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.List; -import java.util.Map; - -public class CummulativeDataRequestDto { - private Map customData; - private RequestDate dates; - private String dashCode; - - - - public String getDashCode() { - return dashCode; - } - public void setDashCode(String dashCode) { - this.dashCode = dashCode; - } - public Map getCustomData() { - return customData; - } - public void setCustomData(Map customData) { - this.customData = customData; - } - public RequestDate getDates() { - return dates; - } - public void setDates(RequestDate dates) { - this.dates = dates; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/DashboardDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/DashboardDto.java deleted file mode 100644 index 1ff82a8da07..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/DashboardDto.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.tarento.analytics.dto; - -public class DashboardDto { - - private Long id; - private String name; - private String code; - private String description; - private String placement; - - public String getPlacement() { - return placement; - } - public void setPlacement(String placement) { - this.placement = placement; - } - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getCode() { - return code; - } - public void setCode(String code) { - this.code = code; - } - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/DashboardHeaderDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/DashboardHeaderDto.java deleted file mode 100644 index 33db8b1a262..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/DashboardHeaderDto.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.tarento.analytics.dto; - -import com.tarento.analytics.model.LineData; - -public class DashboardHeaderDto { - - private String type; - private Object data; - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - public Object getData() { - return data; - } - public void setData(Object data) { - this.data = data; - } - public LineData getLineData() { - return lineData; - } - public void setLineData(LineData lineData) { - this.lineData = lineData; - } - private LineData lineData; -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Data.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Data.java deleted file mode 100644 index 2673cbf75ef..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Data.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.ArrayList; -import java.util.List; - -public class Data { - - private String headerName; - private Object headerValue; - private String headerSymbol; - private InsightsWidget insight; - - public InsightsWidget getInsight() { - return insight; - } - - public void setInsight(InsightsWidget insight) { - this.insight = insight; - } - - public void setHeaderName(String headerName) { - this.headerName = headerName; - } - - public void setHeaderSymbol(String headerSymbol) { - this.headerSymbol = headerSymbol; - } - - - public Data(String name, Object value, String symbol) { - this.headerName = name; - this.headerValue = value; - this.headerSymbol = symbol; - } - - public Data(String name, Object value, String symbol, List plots) { - this.headerName = name; - this.headerValue = value; - this.headerSymbol = symbol; - this.plots = plots; - } - - private List plots = new ArrayList<>(); - - public List getPlots() { - return plots; - } - - public void setPlots(List plots) { - this.plots = plots; - } - - public void setHeaderValue(Object headerValue) { - this.headerValue = headerValue; - } - - public String getHeaderName() { - return headerName; - } - - public Object getHeaderValue() { - return headerValue; - } - - public String getHeaderSymbol() { - return headerSymbol; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/InsightsWidget.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/InsightsWidget.java deleted file mode 100644 index 0eed70f97fa..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/InsightsWidget.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.tarento.analytics.dto; - -public class InsightsWidget { - - private String name; - private Object value; - private String indicator; - private String colorCode; - - public InsightsWidget() {} - public InsightsWidget(String name, Object value, String indicator, String colorCode) { - this.name = name; - this.value = value; - this.indicator = indicator; - this.colorCode = colorCode; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public Object getValue() { - return value; - } - public void setValue(Object value) { - this.value = value; - } - public String getIndicator() { - return indicator; - } - public void setIndicator(String indicator) { - this.indicator = indicator; - } - public String getColorCode() { - return colorCode; - } - public void setColorCode(String colorCode) { - this.colorCode = colorCode; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/MappingDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/MappingDto.java deleted file mode 100644 index 1bb98d2d1e5..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/MappingDto.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.tarento.analytics.dto; - -public class MappingDto { - - private Object mappings; - - public Object getMappings() { - return mappings; - } - - public void setMappings(Object mappings) { - this.mappings = mappings; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Plot.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Plot.java deleted file mode 100644 index f2d30924ac0..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Plot.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.tarento.analytics.dto; - - -public class Plot { - - private String label; - private String name; - private Double value; - private String strValue; - private String symbol; - - public Plot(String name, Double value, String symbol) { - this.name = name; - this.value = value; - this.symbol = symbol; - } - - public Plot(String name, String strValue, String symbol) { - this.name = name; - this.strValue = strValue; - this.symbol = symbol; - this.value = 0d; - } - - public Plot(String name, String symbol) { - this.name = name; - this.symbol = symbol; - this.value = null; - } - - public String getName() { - return name; - } - - public Double getValue() { - return value; - } - - public String getSymbol() { - return symbol; - } - - public String getLabel() { - return label; - } - - public String getStrValue() { - return strValue; - } - - public void setLabel(String label) { - this.label = label; - } - public void setValue(Double value) { - this.value = value; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDate.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDate.java deleted file mode 100644 index 3e615493aa2..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDate.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.tarento.analytics.dto; - -public class RequestDate { - private String targetDate; - private String startDate; - private String endDate; - private String interval; - public String getInterval() { - return interval; - } - public void setInterval(String interval) { - this.interval = interval; - } - public String getTargetDate() { - return targetDate; - } - public void setTargetDate(String targetDate) { - this.targetDate = targetDate; - } - public String getStartDate() { - return startDate; - } - public void setStartDate(String startDate) { - this.startDate = startDate; - } - public String getEndDate() { - return endDate; - } - public void setEndDate(String endDate) { - this.endDate = endDate; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDto.java deleted file mode 100644 index 02e4b86f2a6..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDto.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.Map; - -public class RequestDto { - - private Map headers; - private AggregateRequestDto aggregationRequestDto; - - public Map getHeaders() { - return headers; - } - public void setHeaders(Map headers) { - this.headers = headers; - } - public AggregateRequestDto getAggregationRequestDto() { - return aggregationRequestDto; - } - public void setAggregationRequestDto(AggregateRequestDto aggregationRequestDto) { - this.aggregationRequestDto = aggregationRequestDto; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDtoV3.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDtoV3.java deleted file mode 100644 index f152384027a..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RequestDtoV3.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.Map; - -public class RequestDtoV3 { - - private Map headers; - private AggregateRequestDtoV3 aggregationRequestDto; - - public Map getHeaders() { - return headers; - } - public void setHeaders(Map headers) { - this.headers = headers; - } - public AggregateRequestDtoV3 getAggregationRequestDto() { - return aggregationRequestDto; - } - public void setAggregationRequestDto(AggregateRequestDtoV3 aggregationRequestDto) { - this.aggregationRequestDto = aggregationRequestDto; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/ResponseDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/ResponseDto.java deleted file mode 100644 index 13ac1356976..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/ResponseDto.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.tarento.analytics.dto; - -import org.springframework.http.HttpStatus; - -public class ResponseDto { - - private int statusCode; - private String statusMessage; - private Object response; - - public ResponseDto(int statusCode, String statusMessage, Object response) { - this.statusCode = statusCode; - this.statusMessage = statusMessage; - this.response = response; - } - - public int getStatusCode() { - return statusCode; - } - - public void setStatusCode(int statusCode) { - this.statusCode = statusCode; - } - - public String getStatusMessage() { - return statusMessage; - } - - public void setStatusMessage(String statusMessage) { - this.statusMessage = statusMessage; - } - - public Object getResponse() { - return response; - } - - public void setResponse(Object response) { - this.response = response; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RoleDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RoleDto.java deleted file mode 100644 index 85fee2ee57c..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/RoleDto.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.tarento.analytics.dto; - -public class RoleDto { - - public Long id; - - public String description; - - public String name; - - public String orgId; - - public boolean isSuperAdmin; - - public String getOrgId() { - return orgId; - } - - public void setOrgId(String orgId) { - this.orgId = orgId; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/SearchDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/SearchDto.java deleted file mode 100644 index 14687f398b7..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/SearchDto.java +++ /dev/null @@ -1,165 +0,0 @@ -package com.tarento.analytics.dto; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * This class will take input for elastic search query - * - * @author - */ -public class SearchDto { - - @SuppressWarnings("rawtypes") - private List properties; - - private List> facets = new ArrayList<>(); - private List fields; - private List excludedFields; - private Map sortBy = new HashMap<>(); - private String operation; - private String query; - private Integer limit = 250; - private Integer offset = 0; - private boolean fuzzySearch = false; - // additional properties will hold , filters, exist , not exist - private Map additionalProperties = new HashMap<>(); - private Map softConstraints = new HashMap<>(); - private List> groupQuery = new ArrayList<>(); - private List mode = new ArrayList<>(); - - public List> getGroupQuery() { - return groupQuery; - } - - public void setGroupQuery(List> groupQuery) { - this.groupQuery = groupQuery; - } - - public SearchDto() { - super(); - } - - @SuppressWarnings("rawtypes") - public SearchDto(List properties, String operation, int limit) { - super(); - this.properties = properties; - this.operation = operation; - this.limit = limit; - } - - @SuppressWarnings("rawtypes") - public List getProperties() { - return properties; - } - - @SuppressWarnings("rawtypes") - public void setProperties(List properties) { - this.properties = properties; - } - - public String getOperation() { - return operation; - } - - public void setOperation(String operation) { - this.operation = operation; - } - - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public List> getFacets() { - return facets; - } - - public void setFacets(List> facets) { - this.facets = facets; - } - - public Map getSortBy() { - return sortBy; - } - - public void setSortBy(Map sortBy) { - this.sortBy = sortBy; - } - - public boolean isFuzzySearch() { - return fuzzySearch; - } - - public void setFuzzySearch(boolean fuzzySearch) { - this.fuzzySearch = fuzzySearch; - } - - public Map getAdditionalProperties() { - return additionalProperties; - } - - public void setAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - } - - public Object getAdditionalProperty(String key) { - return additionalProperties.get(key); - } - - public void addAdditionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - } - - public List getFields() { - return fields; - } - - public void setFields(List fields) { - this.fields = fields; - } - - public Integer getOffset() { - return offset; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Map getSoftConstraints() { - return softConstraints; - } - - public void setSoftConstraints(Map softConstraints) { - this.softConstraints = softConstraints; - } - - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - - public List getMode() { - return mode; - } - - public void setMode(List mode) { - this.mode = mode; - } - - public List getExcludedFields() { - return excludedFields; - } - - public void setExcludedFields(List excludedFields) { - this.excludedFields = excludedFields; - } -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Tenant.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Tenant.java deleted file mode 100644 index a76e519ee34..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Tenant.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.HashMap; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "code", "name", "description", "logoId", "imageId", "domainUrl", "type", "twitterUrl", - "facebookUrl", "emailId", "OfficeTimings", "city", "address", "contactNumber" }) -public class Tenant { - - @JsonProperty("code") - private String code; - @JsonProperty("name") - private String name; - @JsonProperty("description") - private String description; - @JsonProperty("logoId") - private String logoId; - @JsonProperty("imageId") - private Object imageId; - @JsonProperty("domainUrl") - private String domainUrl; - @JsonProperty("type") - private String type; - @JsonProperty("twitterUrl") - private Object twitterUrl; - @JsonProperty("facebookUrl") - private Object facebookUrl; - @JsonProperty("emailId") - private String emailId; - @JsonProperty("city") - private City city; - @JsonProperty("address") - private String address; - @JsonProperty("contactNumber") - private String contactNumber; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("code") - public String getCode() { - return code; - } - - @JsonProperty("code") - public void setCode(String code) { - this.code = code; - } - - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - @JsonProperty("logoId") - public String getLogoId() { - return logoId; - } - - @JsonProperty("logoId") - public void setLogoId(String logoId) { - this.logoId = logoId; - } - - @JsonProperty("imageId") - public Object getImageId() { - return imageId; - } - - @JsonProperty("imageId") - public void setImageId(Object imageId) { - this.imageId = imageId; - } - - @JsonProperty("domainUrl") - public String getDomainUrl() { - return domainUrl; - } - - @JsonProperty("domainUrl") - public void setDomainUrl(String domainUrl) { - this.domainUrl = domainUrl; - } - - @JsonProperty("type") - public String getType() { - return type; - } - - @JsonProperty("type") - public void setType(String type) { - this.type = type; - } - - @JsonProperty("twitterUrl") - public Object getTwitterUrl() { - return twitterUrl; - } - - @JsonProperty("twitterUrl") - public void setTwitterUrl(Object twitterUrl) { - this.twitterUrl = twitterUrl; - } - - @JsonProperty("facebookUrl") - public Object getFacebookUrl() { - return facebookUrl; - } - - @JsonProperty("facebookUrl") - public void setFacebookUrl(Object facebookUrl) { - this.facebookUrl = facebookUrl; - } - - @JsonProperty("emailId") - public String getEmailId() { - return emailId; - } - - @JsonProperty("emailId") - public void setEmailId(String emailId) { - this.emailId = emailId; - } - - @JsonProperty("city") - public City getCity() { - return city; - } - - @JsonProperty("city") - public void setCity(City city) { - this.city = city; - } - - @JsonProperty("address") - public String getAddress() { - return address; - } - - @JsonProperty("address") - public void setAddress(String address) { - this.address = address; - } - - @JsonProperty("contactNumber") - public String getContactNumber() { - return contactNumber; - } - - @JsonProperty("contactNumber") - public void setContactNumber(String contactNumber) { - this.contactNumber = contactNumber; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - - @Override - public String toString() { - return "Tenant [code=" + code + ", name=" + name + ", description=" + description + ", logoId=" + logoId - + ", imageId=" + imageId + ", domainUrl=" + domainUrl + ", type=" + type + ", twitterUrl=" + twitterUrl - + ", facebookUrl=" + facebookUrl + ", emailId=" + emailId - + ", city=" + city + ", address=" + address + ", contactNumber=" + contactNumber - + ", additionalProperties=" + additionalProperties + ", getCode()=" + getCode() + ", getName()=" - + getName() + ", getDescription()=" + getDescription() + ", getLogoId()=" + getLogoId() - + ", getImageId()=" + getImageId() + ", getDomainUrl()=" + getDomainUrl() + ", getType()=" + getType() - + ", getTwitterUrl()=" + getTwitterUrl() + ", getFacebookUrl()=" + getFacebookUrl() + ", getEmailId()=" - + getEmailId() + ", getCity()=" + getCity() - + ", getAddress()=" + getAddress() + ", getContactNumber()=" + getContactNumber() - + ", getAdditionalProperties()=" + getAdditionalProperties() + ", getClass()=" + getClass() - + ", hashCode()=" + hashCode() + ", toString()=" + super.toString() + "]"; - } - - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Tenants.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Tenants.java deleted file mode 100644 index a41b82e830f..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Tenants.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "tenantId", "moduleName", "tenants" }) -public class Tenants { - - @JsonProperty("tenantId") - private String tenantId; - @JsonProperty("moduleName") - private String moduleName; - @JsonProperty("tenants") - private List tenants = null; - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("tenantId") - public String getTenantId() { - return tenantId; - } - - @JsonProperty("tenantId") - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - @JsonProperty("moduleName") - public String getModuleName() { - return moduleName; - } - - @JsonProperty("moduleName") - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - @JsonProperty("tenants") - public List getTenants() { - return tenants; - } - - @JsonProperty("tenants") - public void setTenants(List tenants) { - this.tenants = tenants; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/UserDto.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/UserDto.java deleted file mode 100644 index e548e8b4caa..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/UserDto.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.tarento.analytics.dto; - -import java.util.List; - -public class UserDto { - - private long id; - - private String userName; - - private String emailId; - - private List roles; - - private String orgId; - - private String countryCode; - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getEmailId() { - return emailId; - } - - public void setEmailId(String emailId) { - this.emailId = emailId; - } - - public List getRoles() { - return roles; - } - - public void setRoles(List roles) { - this.roles = roles; - } - - public String getOrgId() { - return orgId; - } - - public void setOrgId(String orgId) { - this.orgId = orgId; - } - - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String countryCode) { - this.countryCode = countryCode; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Visualization.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Visualization.java deleted file mode 100644 index 41a9cd6544a..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/dto/Visualization.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.tarento.analytics.dto; - -public class Visualization { - - private String type; - private String code; - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - public String getCode() { - return code; - } - public void setCode(String code) { - this.code = code; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/enums/ChartType.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/enums/ChartType.java deleted file mode 100644 index 4e1377e630b..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/enums/ChartType.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.tarento.analytics.enums; - -import org.apache.commons.lang3.StringUtils; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public enum ChartType { - - XTABLE("xtable"), TABLE("table"), PERFORM("perform"), METRIC("metric"), PIE("pie"), LINE("line"); - - private String value; - - ChartType(final String value) { - this.value = value; - } - - - @JsonValue - public String toString() { - return value; - } - - @JsonCreator - public static ChartType fromValue(final String passedValue) { - for (final ChartType obj : ChartType.values()) - if (String.valueOf(obj.value).toLowerCase().equals(passedValue.toLowerCase())) - return obj; - return null; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/exception/AINException.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/exception/AINException.java deleted file mode 100644 index 6e86721c377..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/exception/AINException.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.tarento.analytics.exception; - -public class AINException extends Exception{ - - - //TODO- wrapped up with other exceptions. - private static final long serialVersionUID = 1L; - - String errorCode; - - String errorMessage; - - public AINException(String errorCode, String errorMessage) { - this.errorCode= errorCode; - this.errorMessage = errorMessage; - } - - public String getErrorCode() { - return errorCode; - } - - - public String getErrorMessage() { - return errorMessage; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/AdvanceTableChartResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/AdvanceTableChartResponseHandler.java deleted file mode 100644 index f19f3c4df50..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/AdvanceTableChartResponseHandler.java +++ /dev/null @@ -1,246 +0,0 @@ -package com.tarento.analytics.handler; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import com.tarento.analytics.helper.ComputedFieldFactory; -import com.tarento.analytics.helper.IComputedField; -import com.tarento.analytics.model.ComputedFields; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; - -/** - * This handles ES response for single index, multiple index to represent data as pie figure - * Creates plots by merging/computing(by summation) index values for same key - * - */ -@Component -public class AdvanceTableChartResponseHandler implements IResponseHandler { - public static final Logger logger = LoggerFactory.getLogger(AdvanceTableChartResponseHandler.class); - - @Autowired - private ObjectMapper mapper; - - @Autowired - private ComputedFieldFactory computedFieldFactory; - - - @Override - public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException { - - JsonNode aggregationNode = aggregations.get(AGGREGATIONS); - JsonNode chartNode = requestDto.getChartNode(); - String plotLabel = chartNode.get(PLOT_LABEL).asText(); - JsonNode computedFields = chartNode.get(COMPUTED_FIELDS); - JsonNode excludedFields = chartNode.get(EXCLUDED_COLUMNS); - - boolean executeComputedFields = computedFields !=null && computedFields.isArray(); - List aggrNodes = aggregationNode.findValues(BUCKETS); - boolean isPathSpecified = chartNode.get(IResponseHandler.AGGS_PATH)!=null && chartNode.get(IResponseHandler.AGGS_PATH).isArray(); - ArrayNode aggrsPaths = isPathSpecified ? (ArrayNode) chartNode.get(IResponseHandler.AGGS_PATH) : JsonNodeFactory.instance.arrayNode(); - - - - int[] idx = { 1 }; - List dataList = new ArrayList<>(); - Map> mappings = new HashMap<>(); - - - aggrNodes.stream().forEach(node -> { - - ArrayNode buckets = (ArrayNode) node; - buckets.forEach(bucket -> { - - Map plotMap = new LinkedHashMap<>(); - String key = bucket.get(IResponseHandler.KEY).asText(); - - //If aggrPath is specified. - if(aggrsPaths.size()>0){ - processWithSpecifiedKeys(aggrsPaths, bucket, mappings, key, plotMap,chartNode); - - } else { - processNestedObjects(bucket, mappings, key, plotMap,chartNode); - } - - if (plotMap.size() > 0) { - Map plots = new LinkedHashMap<>(); - Plot sno = new Plot(SERIAL_NUMBER, TABLE_TEXT); - sno.setLabel("" + idx[0]++); - Plot plotkey = new Plot(plotLabel.isEmpty() ? TABLE_KEY : plotLabel, TABLE_TEXT); - plotkey.setLabel(key); - - plots.put(SERIAL_NUMBER, sno); - plots.put(plotLabel.isEmpty() ? TABLE_KEY : plotLabel, plotkey); - plots.putAll(plotMap); - mappings.put(key, plots); - - } - - }); - - }); - mappings.entrySet().stream().forEach(plotMap -> { - List plotList = plotMap.getValue().values().stream().collect(Collectors.toList()); - //filter out data object with all zero data. - List filterPlot = plotList.stream().filter(c -> (!c.getName().equalsIgnoreCase(SERIAL_NUMBER) && !c.getName().equalsIgnoreCase(plotLabel) && c.getValue() != 0.0)).collect(Collectors.toList()); - - if(filterPlot.size()>0){ - Data data = new Data(plotMap.getKey(), Integer.parseInt(String.valueOf(plotMap.getValue().get(SERIAL_NUMBER).getLabel())), null); - data.setPlots(plotList); - // - if(executeComputedFields){ - try { - List computedFieldsList = mapper.readValue(computedFields.toString(), new TypeReference>(){}); - computedFieldsList.forEach(cfs -> { - IComputedField computedFieldObject = computedFieldFactory.getInstance(cfs.getActionName()); - computedFieldObject.set(requestDto, cfs.getPostAggregationTheory()); - computedFieldObject.add(data, cfs.getFields(), cfs.getNewField(), chartNode ); - - }); - // exclude the fields no to be displayed - if(excludedFields!=null){ - List list = mapper.readValue(excludedFields.toString(), new TypeReference>(){}); - List removeplots = data.getPlots().stream().filter(c -> list.contains(c.getName())).collect(Collectors.toList()); - data.getPlots().removeAll(removeplots); - } - - - } catch (Exception e){ - logger.error("execution of computed field :"+e.getMessage()); - } - } - dataList.add(data); - } - - }); - //dataList.sort((o1, o2) -> ((Integer) o1.getHeaderValue()).compareTo((Integer) o2.getHeaderValue())); - - if (chartNode.get(IResponseHandler.CHART_SPECIFIC)!=null) { - JsonNode specificData = chartNode.get(IResponseHandler.CHART_SPECIFIC); - JsonNode orderColumns = specificData.get(IResponseHandler.XTABLE_COLUMN); - if (orderColumns != null) { - dataList.forEach(finaldata -> { - List newDataList = new ArrayList<>(); - orderColumns.forEach(columnName -> { - List plotObj = finaldata.getPlots().stream() - .filter(plot -> plot.getName().equals(columnName.asText())) - .collect(Collectors.toList()); - newDataList.add(plotObj.get(0)); - }); - finaldata.setPlots(newDataList); - }); - } - } - - return getAggregatedDto(chartNode, dataList, requestDto.getVisualizationCode()); - - } - - - /** - * Preparing the plots - * @param bucketNode - * @param mappings - * @param key - * @param headerName - * @param plotMap - */ - private void process(JsonNode bucketNode, Map> mappings, String key, String headerName, Map plotMap,JsonNode chartNode){ - JsonNode valNode = bucketNode.findValue(VALUE) != null ? bucketNode.findValue(VALUE) : bucketNode.findValue(DOC_COUNT); - Double value = valNode.isDouble() ? valNode.asDouble() : valNode.asInt(); - String dataType = getDataType(chartNode, headerName, valNode); - //String headerName = bucketNode.findValue(KEY).asText(); - Plot plot = new Plot(headerName, value, dataType); - - if (mappings.containsKey(key)) { - double newval = mappings.get(key).get(headerName) == null ? value : (mappings.get(key).get(headerName).getValue() + value); - plot.setValue(newval); - mappings.get(key).put(headerName, plot); - } else { - plotMap.put(headerName, plot); - } - } - - /** - * Recursively processing the nodes - * @param node - * @param mappings - * @param key - * @param plotMap - */ - private void processNestedObjects(JsonNode node, Map> mappings, String key, Map plotMap,JsonNode chartNode ){ - - Iterator fieldNames = node.fieldNames(); - while(fieldNames.hasNext()) { - String fieldName = fieldNames.next(); - if(node.get(fieldName).isArray()){ - ArrayNode bucketNodes = (ArrayNode) node.get(fieldName); - bucketNodes.forEach(bucketNode -> { - process(bucketNode, mappings, key, bucketNode.findValue(KEY).asText() , plotMap,chartNode); - }); - - } else if(node.get(fieldName).isObject() && node.get(fieldName).get(VALUE)!=null){ - process(node.get(fieldName), mappings, key, fieldName , plotMap,chartNode); - - } else { - processNestedObjects(node.get(fieldName), mappings, key, plotMap,chartNode ); - } - - } - - - } - - private void processWithSpecifiedKeys(ArrayNode aggrsPaths, JsonNode bucket, Map> mappings, String key, Map plotMap,JsonNode chartNode ){ - - aggrsPaths.forEach(headerPath -> { - JsonNode valueNode = bucket.findValue(headerPath.asText()); - //Double value = (null == valueNode || null == valueNode.get(VALUE)) ? 0.0 : valueNode.get(VALUE).asDouble(); - Double doc_value = 0.0; - if(valueNode!=null) - doc_value = (null == valueNode.findValue(DOC_COUNT)) ? 0.0 : valueNode.findValue(DOC_COUNT).asDouble(); - Double value = (null == valueNode || null == valueNode.findValue(VALUE)) ? doc_value : valueNode.findValue(VALUE).asDouble(); - String dataType = getDataType(chartNode, headerPath.asText(), valueNode); - - if(chartNode.get(IS_ROUND_OFF)!=null && chartNode.get(IS_ROUND_OFF).asBoolean()) { - value = (double) Math.round(value); - } - Plot plot = new Plot(headerPath.asText(), value, dataType); - if (mappings.containsKey(key)) { - double newval = mappings.get(key).get(headerPath.asText()) == null ? value : (mappings.get(key).get(headerPath.asText()).getValue() + value); - plot.setValue(newval); - mappings.get(key).put(headerPath.asText(), plot); - } else { - plotMap.put(headerPath.asText(), plot); - } - }); - } - - - private String getDataType(JsonNode chartNode, String headerName, JsonNode valueNode) { - // TODO Auto-generated method stub - if (chartNode.get("pathDataTypeMapping") != null) { - JsonNode pathDataMapping = chartNode.get("pathDataTypeMapping"); - JsonNode node = pathDataMapping.findValue(headerName); - return node.textValue(); - } else if( chartNode.get(VALUE_TYPE) != null) { - return chartNode.get(VALUE_TYPE).asText(); - }else { - return valueNode.isDouble() ? "amount" : "number"; - } - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IPostResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IPostResponseHandler.java deleted file mode 100644 index 57ceb2bf4cb..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IPostResponseHandler.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.tarento.analytics.handler; - -import com.fasterxml.jackson.databind.node.ObjectNode; - -public interface IPostResponseHandler { - - - /** - * Intecepts the response tree - * @param responseNode - */ - public void postResponse(ObjectNode responseNode); - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IResponseHandler.java deleted file mode 100644 index bcc72b4e486..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/IResponseHandler.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.tarento.analytics.handler; - -import java.io.IOException; -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import com.tarento.analytics.enums.ChartType; -import org.apache.commons.collections.CollectionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Handles Elastic search consolidate responses - */ -public interface IResponseHandler { - - public static final Logger logger = LoggerFactory.getLogger(IResponseHandler.class); - - public static final String API_CONFIG_JSON = "ChartApiConfig.json"; - public static final String AGGS_PATH = "aggregationPaths"; - - public static final String CHART_NAME = "chartName"; - public static final String CHART_TYPE = "chartType"; - public static final String DRILL_CHART = "drillChart"; - public static final String VALUE_TYPE = "valueType"; - public static final String FILTER_KEYS = "filterKeys"; - - // Table Chart Keys - public static final String SERIAL_NUMBER = "S.N."; - public static final String TABLE_TEXT = "text" ; - public static final String TABLE_KEY = "Key"; - - - // TODO remove the specific column names. - public static final String TOTAL_COLLECTION = "Total Collection"; - public static final String TARGET_COLLECTION = "Target Collection"; - public static final String TARGET_ACHIEVED = "Target Achievement"; - - public static final String PT_DDR_BOUNDARY = "demandCollectionIndexDDRRevenue"; - public static final String PT_BOUNDARY = "demandCollectionIndexBoundaryRevenue"; - public static final String PT_BOUNDARY_DRILL = "boundaryDrillDown"; - public static final String TL_DDR_BOUNDARY = "licenseIssuedDDRRevenue"; - public static final String TL_BOUNDARY = "licenseIssuedBoundaryRevenue"; - public static final String TL_BOUNDARY_DRILL = "licenseIssuedBoundaryDrillDown"; - - - - public final String ASC = "asc"; - public final String DESC = "desc"; - public final String RANK = "Rank"; - public final String AGGREGATIONS = "aggregations"; - public final String PLOT_LABEL = "plotLabel"; - public final String COMPUTED_FIELDS = "computedFields"; - public final String EXCLUDED_COLUMNS = "excludedColumns"; - public final String LIMIT = "limit"; - public final String ORDER = "order"; - public final String ACTION = "action"; - public final String TYPE_MAPPING = "pathDataTypeMapping"; - - public static String BUCKETS = "buckets"; - public static String KEY = "key"; - public static String VALUE = "value"; - - public final String PERCENTAGE = "percentage"; - public final String DOC_COUNT = "doc_count"; - - public static final String POST_AGGREGATION_THEORY = "postAggregationTheory"; - - public static final String CHART_SPECIFIC = "chartSpecificProperty"; - - public static final String XTABLE_COLUMN = "XtableColumnOrder"; - - public static final String IS_ROUND_OFF = "isRoundOff"; - - public static Double BOUNDARY_VALUE = 50.0; - - public static final String DIVISION = "division"; - - /** - * Translate the consolidated/aggregated response - * - * @param requestDto - * @param aggregations - * @return - * @throws IOException - */ - public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException; - - /** - * Prepare aggregated dato for a chart node - * Also sets the drillChart Value - * @param chartNode - * @param dataList - data plots object - * @return - */ - default AggregateDto getAggregatedDto(JsonNode chartNode, List dataList, String visualizationCode) { - AggregateDto aggregateDto = new AggregateDto(); - aggregateDto.setVisualizationCode(visualizationCode); - aggregateDto.setDrillDownChartId(chartNode.get(DRILL_CHART).asText()); - ChartType chartType = ChartType.fromValue(chartNode.get(CHART_TYPE).asText()); - aggregateDto.setChartType(chartType); - aggregateDto.setData(dataList); - if(null!=chartNode.get(FILTER_KEYS)) - aggregateDto.setFilter((ArrayNode) chartNode.get(FILTER_KEYS)); - return aggregateDto; - } - - /** - * Append computed field for a given Data, for its existing fields - * computes as partfield/wholefield * 100 - * - * @param data - * @param newfield - * @param partField - * @param wholeField - */ - default void addComputedField(Data data, String newfield, String partField, String wholeField) { - try { - Map plotMap = data.getPlots().stream().collect(Collectors.toMap(Plot::getName, Function.identity())); - - if (plotMap.get(partField).getValue() == 0.0 || plotMap.get(wholeField).getValue() == 0.0) { - data.getPlots().add(new Plot(newfield, 0.0, "percentage")); - } else { - double fieldValue = plotMap.get(partField).getValue() / plotMap.get(wholeField).getValue() * 100; - data.getPlots().add(new Plot(newfield, fieldValue, "percentage")); - - } - } catch (Exception e) { - data.getPlots().add(new Plot(newfield, 0.0, "percentage")); - } - - } - - /** - * Computes the percentage from 0th and 1st index of list - * Ex: 0th element/1st element * 100 - * @param values - * @return - */ - default Double percentageValue(List values, boolean isRoundOff) { - double val = (values.get(0)/values.get(1) * 100); - if(isRoundOff) { - val = Math.round(val); - } - return (values.size() > 1 && values.get(0) != 0.0 && values.get(1) != 0.0) ? val : 0.0; - } - - - /** - * Computes the percentage from 1st & 2nd element of collection - * Ex: first element/second element * 100 - * @param values - * @return - */ - default Double getPercentage(Map values, String partField, String wholeField, boolean isRoundOff) { - - double val = (values.get(partField)/ values.get(wholeField) * 100); - if(isRoundOff) { - val = Math.round(val); - } - return (values.size() > 1 && values.get(partField) != 0.0 && values.get(wholeField) != 0.0) ? val: 0.0; - } - - /** - * Adding missing plot elements with cumulative data - * @param plotKeys - all required plot key - * @param data - * @param symbol - */ - default void appendMissingPlot(Set plotKeys, Data data, String symbol, boolean isCumulative) { - - //To maintain the sorted plots list order - Map sortedMap = data.getPlots().stream() - .collect(Collectors.toMap( - Plot::getName, - plot -> plot, - (u,v) -> { throw new IllegalStateException(String.format("Duplicate key %s", u)); }, - LinkedHashMap::new - )); - - logger.info(data.getHeaderName() + " existing keys: "+sortedMap.keySet()+ "& size:"+sortedMap.keySet().size()); - - Collection allKeysMinusDataKeys = CollectionUtils.subtract(plotKeys, sortedMap.keySet()); - logger.info(data.getHeaderName() +" missing keys: "+allKeysMinusDataKeys); - - - for(String plKey:allKeysMinusDataKeys){ - sortedMap.put(plKey, new Plot(plKey, new Double("0"), symbol)); - if(isCumulative){ - List keys = sortedMap.keySet().stream().collect(Collectors.toList()); - int index = keys.indexOf(plKey); - double value = index>0 ? sortedMap.get(keys.get(index-1)).getValue():0.0; - sortedMap.get(plKey).setValue(value); - } - } - logger.info("after appending missing plots : "+ sortedMap); - data.setPlots(sortedMap.values().stream().collect(Collectors.toList())); - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/InsightsHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/InsightsHandler.java deleted file mode 100644 index c97914b2bf2..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/InsightsHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.tarento.analytics.handler; - -import java.util.List; - -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.enums.ChartType; -import com.tarento.analytics.model.InsightsConfiguration; -import com.tarento.analytics.utils.ResponseRecorder; - -public interface InsightsHandler { - - public static final String CHART_NAME = "chartName"; - public static final String CHART_TYPE = "chartType"; - public static final String DRILL_CHART = "drillChart"; - public static final String VALUE_TYPE = "valueType"; - public static final String FILTER_KEYS = "filterKeys"; - public static final String INSIGHT_WIDGET_NAME = "INSIGHTS"; - public static final String INDICATOR_PLACEHOLDER = "$indicator"; - public static final String VALUE_PLACEHOLDER = "$value"; - public static final String INSIGHT_INTERVAL_PLACEHOLDER = "$insightInterval"; - public static final String INSIGHT_INDICATOR_POSITIVE = "upper_green"; - public static final String INSIGHT_INDICATOR_NEGATIVE = "lower_red"; - public static final String POSITIVE = "+"; - public static final String NEGATIVE = "-"; - - public static final String INSIGHT_NUMBER_DIFFERENCE = "differenceOfNumbers" ; - public static final String INSIGHT_PERCENTAGE_DIFFERENCE = "differenceOfPercentage" ; - - AggregateDto getInsights(AggregateDto aggregateDto, String visualizationCode, String moduleLevel, InsightsConfiguration insightsConfig, ResponseRecorder responseRecorder); - - default AggregateDto getAggregatedDto(List dataList, String visualizationCode) { - AggregateDto aggregateDto = new AggregateDto(); - aggregateDto.setVisualizationCode(visualizationCode); - aggregateDto.setDrillDownChartId("none"); - ChartType chartType = ChartType.fromValue("metric"); - aggregateDto.setChartType(chartType); - aggregateDto.setData(dataList); - return aggregateDto; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/InsightsHandlerFactory.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/InsightsHandlerFactory.java deleted file mode 100644 index 7167cfcc7f7..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/InsightsHandlerFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.tarento.analytics.handler; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.tarento.analytics.enums.ChartType; - -@Component -public class InsightsHandlerFactory { - - @Autowired - private MetricsInsightsHandler metricInsightsHandler; - - public InsightsHandler getInstance(ChartType chartType) { - if(chartType == ChartType.METRIC) - return metricInsightsHandler; - return metricInsightsHandler; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/LineChartResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/LineChartResponseHandler.java deleted file mode 100644 index 25a0a4cdcec..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/LineChartResponseHandler.java +++ /dev/null @@ -1,311 +0,0 @@ -package com.tarento.analytics.handler; - -import java.io.IOException; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.tarento.analytics.helper.ComputedFieldFactory; -import com.tarento.analytics.helper.IComputedField; -import com.tarento.analytics.model.ComputedFields; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; - -import static com.tarento.analytics.constant.Constants.JsonPaths.DAYS; - -/** - * This handles ES response for single index, multiple index to represent data as line chart - * Creates plots by merging/computing(by summation) index values for same key - * AGGS_PATH : this defines the path/key to be used to search the tree - * VALUE_TYPE : defines the data type for the value formed, this could be amount, percentage, number - * - */ -@Component -public class LineChartResponseHandler implements IResponseHandler { - public static final Logger logger = LoggerFactory.getLogger(LineChartResponseHandler.class); - @Autowired - private ObjectMapper mapper; - @Autowired - private ComputedFieldFactory computedFieldFactory; - - @Override - public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException { - - List dataList = new LinkedList<>(); - - //String json = "{\"ptindex-v1\":{\"Closed Application\":{\"buckets\":[{\"key_as_string\":\"2018-11-12T00:00:00.000Z\",\"key\":1541980800000,\"doc_count\":1,\"Applications Closed\":{\"buckets\":{\"closed\":{\"doc_count\":0,\"Count\":{\"value\":0}}}}}]},\"Total Application\":{\"buckets\":[{\"key_as_string\":\"2018-11-12T00:00:00.000Z\",\"key\":1541980800000,\"doc_count\":1,\"Count\":{\"value\":1}}]}},\"tlindex-v1\":{\"Closed Application\":{\"buckets\":[{\"key_as_string\":\"2019-04-29T00:00:00.000Z\",\"key\":1556496000000,\"doc_count\":6,\"Applications Closed\":{\"buckets\":{\"closed\":{\"doc_count\":0,\"Count\":{\"value\":0}},\"resolved\":{\"doc_count\":0,\"Count\":{\"value\":0}}}}}]},\"Total Application\":{\"buckets\":[{\"key\":1555891200000,\"doc_count\":1,\"Count\":{\"value\":1}},{\"key\":1556496000000,\"doc_count\":0,\"Count\":{\"value\":0}}]}},\"pgrindex-v1\":{\"Closed Application\":{\"buckets\":[{\"key\":1564963200000,\"doc_count\":438,\"Applications Closed\":{\"buckets\":{\"closed\":{\"doc_count\":5,\"Count\":{\"value\":5}}}}}]},\"Total Application\":{\"buckets\":[{\"key\":1564963200000,\"doc_count\":438,\"Count\":{\"value\":438}},{\"key\":1574035200000,\"doc_count\":3,\"Count\":{\"value\":3}}]}}}"; - JsonNode aggregationNode = aggregations.get(AGGREGATIONS); - JsonNode chartNode = requestDto.getChartNode(); - boolean isRequestInterval = null == requestDto.getRequestDate() ? false : requestDto.getRequestDate().getInterval()!=null && !requestDto.getRequestDate().getInterval().isEmpty(); - String interval = isRequestInterval ? requestDto.getRequestDate().getInterval(): chartNode.get(Constants.JsonPaths.INTERVAL).asText(); - if(interval == null || interval.isEmpty()){ - throw new RuntimeException("Interval must have value from config or request"); - } - - String symbol = chartNode.get(IResponseHandler.VALUE_TYPE).asText(); - String symbolFromPathDataTypeMap = symbol; - ArrayNode aggrsPaths = (ArrayNode) chartNode.get(IResponseHandler.AGGS_PATH); - ArrayNode pathDataTypeMap = (ArrayNode) chartNode.get(TYPE_MAPPING); - - Set plotKeys = new LinkedHashSet<>(); - boolean isCumulative = chartNode.get("isCumulative").asBoolean(); - - JsonNode computedFields = chartNode.get(COMPUTED_FIELDS); - boolean executeComputedFields = computedFields !=null && computedFields.isArray(); - - - //aggrsPaths.forEach(headerPath -> { - for(JsonNode headerPath : aggrsPaths){ - List aggrNodes = aggregationNode.findValues(headerPath.asText()); - - - - JsonNode datatype = null; - if(pathDataTypeMap!=null) { - datatype = pathDataTypeMap.findValue(headerPath.asText()); - - } - - if(datatype!=null) { - symbolFromPathDataTypeMap=datatype.asText(); - } - else { - symbolFromPathDataTypeMap=symbol; - } - - Map plotMap = new LinkedHashMap<>(); - Map multiAggrPlotMap = new LinkedHashMap<>(); - List totalValues = new ArrayList<>(); - Set finalBucketKeys = new LinkedHashSet<>(); - - // For multi aggr, find all plot keys first - enrichBucketKeys(aggrNodes, finalBucketKeys, interval); - initializeMultiAggrPlotMap(multiAggrPlotMap, finalBucketKeys); - - for(JsonNode aggrNode : aggrNodes) { - if (aggrNode.findValues(IResponseHandler.BUCKETS).size() > 0) { - ArrayNode buckets = (ArrayNode) aggrNode.findValues(IResponseHandler.BUCKETS).get(0); - for(JsonNode bucket : buckets){ - String bkey = bucket.findValue(IResponseHandler.KEY).asText(); - String key = getIntervalKey(bkey, Constants.Interval.valueOf(interval)); - - plotKeys.add(key); - double previousVal = !isCumulative ? 0.0 : (totalValues.size() > 0 ? totalValues.get(totalValues.size() - 1) : 0.0); - - double value = 0.0; - if (executeComputedFields) { - try { - - List computedFieldsList = mapper.readValue(computedFields.toString(), new TypeReference>() { - }); - - for (ComputedFields cfs : computedFieldsList) { - IComputedField computedFieldObject = computedFieldFactory.getInstance(cfs.getActionName()); - computedFieldObject.set(requestDto, cfs.getPostAggregationTheory()); - computedFieldObject.add(bucket, cfs.getFields(), cfs.getNewField(), chartNode); - - if (symbolFromPathDataTypeMap.equals(DAYS)) { - - long milidiff = bucket.findValue(cfs.getNewField()).get(IResponseHandler.VALUE).asLong(); - long days = TimeUnit.MILLISECONDS.toDays(milidiff); - value = previousVal + (days); - - } else { - value = previousVal + (bucket.findValue(cfs.getNewField()).get(IResponseHandler.VALUE).asLong()); - - } - } - - } catch (Exception e) { - logger.error("execution of computed field :" + e.getMessage()); - } - - } else { - String jsonStr = bucket.toString(); - JSONObject currObj = new JSONObject(jsonStr); - for (Iterator it = bucket.fieldNames(); it.hasNext(); ) { - String fieldName = it.next(); - if (currObj.get(fieldName) instanceof JSONObject) { - if (bucket.get(fieldName).findValue("buckets") == null) { - value = previousVal + ((bucket.get(fieldName).findValue(IResponseHandler.VALUE) != null) ? bucket.get(fieldName).findValue(IResponseHandler.VALUE).asDouble() : bucket.get(fieldName).findValue(IResponseHandler.DOC_COUNT).asDouble()); - } - - } - } - - //value = previousVal + ((bucket.findValue(IResponseHandler.VALUE) != null) ? bucket.findValue(IResponseHandler.VALUE).asDouble():bucket.findValue(IResponseHandler.DOC_COUNT).asDouble()); - - if (chartNode.get(IS_ROUND_OFF) != null && chartNode.get(IS_ROUND_OFF).asBoolean()) { - value = (double) Math.round(value); - } - } - //double value = previousVal + ((bucket.findValue(IResponseHandler.VALUE) != null) ? bucket.findValue(IResponseHandler.VALUE).asDouble():bucket.findValue(IResponseHandler.DOC_COUNT).asDouble()); - - plotMap.put(key, new Double("0") + value); - totalValues.add(value); - } - } - addIterationResultsToMultiAggrMap(plotMap, multiAggrPlotMap, isCumulative); - plotMap.clear(); - totalValues.clear(); - } - - plotMap = multiAggrPlotMap; - - totalValues = new ArrayList<>(plotMap.values()); - String finalSymbolForPlots= symbolFromPathDataTypeMap; - List plots = plotMap.entrySet().stream().map(e -> new Plot(e.getKey(), e.getValue(), finalSymbolForPlots)).collect(Collectors.toList()); - try{ - Data data = new Data(headerPath.asText(), (totalValues==null || totalValues.isEmpty()) ? 0.0 : totalValues.stream().reduce(0.0, Double::sum),finalSymbolForPlots ); - data.setPlots(plots); - dataList.add(data); - } catch (Exception e) { - logger.error(" Legend/Header "+headerPath.asText() +" exception occurred "+e.getMessage()); - } - // }); - } - - dataList.forEach(data -> { - appendMissingPlot(plotKeys, data, symbol, isCumulative); - }); - return getAggregatedDto(chartNode, dataList, requestDto.getVisualizationCode()); - } - - private void addIterationResultsToMultiAggrMap(Map plotMap, Map multiAggrPlotMap, Boolean isCumulative) { - - Map finalPlotMap = new LinkedHashMap<>(); - - multiAggrPlotMap.keySet().forEach(key -> { - finalPlotMap.put(key, 0.0); - }); - - plotMap.keySet().forEach(key -> { - finalPlotMap.put(key, plotMap.get(key)); - }); - - if(isCumulative) { - Double previousValue = 0.0; - for (String key : finalPlotMap.keySet()) { - if (finalPlotMap.get(key) == 0.0) - finalPlotMap.put(key, previousValue); - previousValue = finalPlotMap.get(key); - } - } - - finalPlotMap.keySet().forEach(key->{ - Double previousValue = multiAggrPlotMap.get(key); - Double currentValue = finalPlotMap.get(key); - multiAggrPlotMap.put(key, previousValue + currentValue); - }); - - if(isCumulative) { - Double previousValue = 0.0; - for (String key : multiAggrPlotMap.keySet()) { - if (multiAggrPlotMap.get(key) == 0.0) - multiAggrPlotMap.put(key, previousValue); - previousValue = multiAggrPlotMap.get(key); - } - } - } - - private void initializeMultiAggrPlotMap(Map multiAggrPlotMap, Set finalBucketKeys) { - finalBucketKeys.forEach(keyName -> { - multiAggrPlotMap.put(keyName, 0.0); - }); - } - - private void enrichBucketKeys(List aggrNodes, Set finalBucketKeys, String interval) { - List bkeyList = new ArrayList<>(); - for(JsonNode aggrNode : aggrNodes) { - if (aggrNode.findValues(IResponseHandler.BUCKETS).size() > 0) { - ArrayNode buckets = (ArrayNode) aggrNode.findValues(IResponseHandler.BUCKETS).get(0); - for(JsonNode bucket : buckets){ - String bkey = bucket.findValue(IResponseHandler.KEY).asText(); - bkeyList.add(bkey); - } - } - } - Collections.sort(bkeyList); - for(String bkey : bkeyList){ - String key = getIntervalKey(bkey, Constants.Interval.valueOf(interval)); - if(!finalBucketKeys.contains(key)) - finalBucketKeys.add(key); - } - - } - - - private String getIntervalKey(String epocString, Constants.Interval interval) { - try { - long epoch = Long.parseLong( epocString ); - Date expiry = new Date( epoch ); - Calendar cal = Calendar.getInstance(); - cal.setTime(expiry); - - String day = String.valueOf(cal.get(Calendar.DATE)); - String month = monthNames(cal.get(Calendar.MONTH)+1); - String year = ""+cal.get(Calendar.YEAR); - - String intervalKey = ""; - if(interval.equals(Constants.Interval.day)) { - intervalKey = day.concat("-").concat(month); - } else if(interval.equals(Constants.Interval.week)){ - intervalKey = day.concat("-").concat(month); - } else if(interval.equals(Constants.Interval.year)){ - intervalKey = year; - } else if(interval.equals(Constants.Interval.month)){ - intervalKey = month.concat("-").concat(year); - } else { - throw new RuntimeException("Invalid interval"); - } - - //String weekMonth = "Week " + cal.get(Calendar.WEEK_OF_YEAR) /*+ " : " + dayMonth*/;//+" of Month "+ (cal.get(Calendar.MONTH) + 1); - return intervalKey; - } catch (Exception e) { - return epocString; - } - } - - private String monthNames(int month) { - if(month == 1) - return "Jan"; - else if(month == 2) - return "Feb"; - else if(month == 3) - return "Mar"; - else if(month == 4) - return "Apr"; - else if(month == 5) - return "May"; - else if(month == 6) - return "Jun"; - else if(month == 7) - return "Jul"; - else if(month == 8) - return "Aug"; - else if(month == 9) - return "Sep"; - else if(month == 10) - return "Oct"; - else if(month == 11) - return "Nov"; - else if(month == 12) - return "Dec"; - else - return "Month"; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricChartResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricChartResponseHandler.java deleted file mode 100644 index e193b76d6f2..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricChartResponseHandler.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.tarento.analytics.handler; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.egov.tracer.model.CustomException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import com.tarento.analytics.helper.ComputeHelper; -import com.tarento.analytics.helper.ComputeHelperFactory; -import com.tarento.analytics.utils.ResponseRecorder; - -/** - * This handles ES response for single index, multiple index to represent single data value - * Creates plots by merging/computing(by summation or by percentage) index values for same key - * ACTION: for the chart config defines the type either summation or computing percentage - * AGGS_PATH : this defines the path/key to be used to search the tree - * - */ -@Component -public class MetricChartResponseHandler implements IResponseHandler{ - public static final Logger logger = LoggerFactory.getLogger(MetricChartResponseHandler.class); - - char insightPrefix = 'i'; - - @Autowired - ConfigurationLoader configurationLoader; - - @Autowired - ComputeHelperFactory computeHelperFactory; - - - - - /** - * Adds the data into ResponseResponder - * @param request - * @param aggregations - * @return - * @throws IOException - */ - - @Override - public AggregateDto translate(AggregateRequestDto request, ObjectNode aggregations) throws IOException { - List dataList = new ArrayList<>(); - String requestId = request.getRequestId(); - String visualizationCode = request.getVisualizationCode(); - - JsonNode aggregationNode = aggregations.get(AGGREGATIONS); - JsonNode chartNode = null; - - // Fetches the chart config - if(request.getVisualizationCode().charAt(0) == insightPrefix) { - String internalChartId = request.getVisualizationCode().substring(1); - chartNode = configurationLoader.get(API_CONFIG_JSON).get(internalChartId); - } else { - chartNode = configurationLoader.get(API_CONFIG_JSON).get(request.getVisualizationCode()); - } - - List totalValues = new ArrayList<>(); - String chartName = chartNode.get(CHART_NAME).asText(); - String action = chartNode.get(ACTION).asText(); - - - /* - * Aggreagation paths are the name of aggregations - * Could have been inferred from aggregationNode i.e from query Dont know why it was added in config? - * */ - List percentageList = new ArrayList<>(); - ArrayNode aggrsPaths = (ArrayNode) chartNode.get(AGGS_PATH); - - /* - * Sums all value of all aggrsPaths i.e all aggregations - * */ - boolean isRoundOff = (chartNode.get(IS_ROUND_OFF)!=null && chartNode.get(IS_ROUND_OFF).asBoolean()) ? true : false; - Plot latestDateplot = new Plot("todaysDate", Double.valueOf(0), "number");; - Plot lastUpdatedTime = new Plot("lastUpdatedTime", Double.valueOf(0), "number"); - Boolean isTodaysCollection = (chartNode.get("TodaysCollection") == null ? Boolean.FALSE : chartNode.get("TodaysCollection").asBoolean()); - for( JsonNode headerPath : aggrsPaths) { - List values = aggregationNode.findValues(headerPath.asText()); - int valueIndex = 0; - Double headerPathValue = new Double(0); - for (JsonNode value : values) { - if (isRoundOff) { - ObjectMapper mapper = new ObjectMapper(); - JsonNode node = value.get("value"); - if (node != null) { - Double roundOff = 0.0d; - try { - roundOff = mapper.treeToValue(node, Double.class); - } catch (JsonProcessingException e) { - e.printStackTrace(); - } - if (roundOff != null) { - int finalvalue = (int) Math.round(roundOff); - ((ObjectNode) value).put("value", finalvalue); - } - } - - } - List valueNodes = value.findValues(VALUE).isEmpty() ? value.findValues(DOC_COUNT) - : value.findValues(VALUE); - Double sum = valueNodes.stream().mapToDouble(o -> o.asDouble()).sum(); - - // PreAction Theory should be consdiered and executed to modify the aggregation value - JsonNode preActionTheoryNode = chartNode.get("preActionTheory"); - - if( preActionTheoryNode != null && preActionTheoryNode.findValue(headerPath.asText()) !=null && - !preActionTheoryNode.findValue(headerPath.asText()).asText().isEmpty()) { - ComputeHelper computeHelper = computeHelperFactory.getInstance(preActionTheoryNode.findValue(headerPath.asText()).asText()); - if(computeHelper !=null) { - sum = computeHelper.compute(request, sum); - } - - } - - headerPathValue = Double.sum(headerPathValue, sum); - - if (isTodaysCollection == Boolean.TRUE) { - - String latestDateKey = null; - String lastUpdatedTimeKey = null; - List latestDates = aggregationNode.findValues("todaysDate"); - if (latestDates != null && latestDates.size() > 0) { - JsonNode latestDate = latestDates.get(valueIndex); - if (latestDate != null) { - List latestDateBuckets = latestDate.findValues(BUCKETS); - if (latestDateBuckets != null && latestDateBuckets.size() > 0) { - JsonNode latestDateBucket = latestDateBuckets.get(0); - latestDateKey = (latestDateBucket.findValue(IResponseHandler.KEY) == null ? null - : latestDateBucket.findValue(IResponseHandler.KEY).asText()); - } - if (latestDateKey != null - && ((Double.valueOf(latestDateKey)) > latestDateplot.getValue())) { - latestDateplot.setValue(Double.valueOf(latestDateKey)); - } - - } - ListlastUpdatedTimeNodes = aggregationNode.findValues("lastUpdatedTime"); - if (lastUpdatedTimeNodes != null && lastUpdatedTimeNodes.size() > 0) { - JsonNode lastUpdatedTimeNode = lastUpdatedTimeNodes.get(valueIndex); - if (lastUpdatedTimeNode != null) { - List lastUpdatedTimeBuckets = lastUpdatedTimeNode.findValues(BUCKETS); - if (lastUpdatedTimeBuckets != null && lastUpdatedTimeBuckets.size() > 0) { - JsonNode lastUpdatedTimeBucket = lastUpdatedTimeBuckets.get(0); - lastUpdatedTimeKey = (lastUpdatedTimeBucket.findValue(IResponseHandler.KEY) == null - ? null - : lastUpdatedTimeBucket.findValue(IResponseHandler.KEY).asText()); - } - - if (lastUpdatedTimeKey != null - && ((Double.valueOf(lastUpdatedTimeKey)) > lastUpdatedTime.getValue())) { - lastUpdatedTime.setValue(Double.valueOf(lastUpdatedTimeKey)); - } - } - } - } - - } - valueIndex++; - } - // Why is aggrsPaths.size()==2 required? Is there validation if action = - // PERCENTAGE and aggrsPaths > 2 - if (action.equals(PERCENTAGE) && aggrsPaths.size() == 2) { - percentageList.add(headerPathValue); - } else { - totalValues.add(headerPathValue); - } - - } - - String symbol = chartNode.get(IResponseHandler.VALUE_TYPE).asText(); - - try{ - Data data = new Data(chartName, action.equals(PERCENTAGE) && aggrsPaths.size()==2? percentageValue(percentageList, isRoundOff) : (totalValues==null || totalValues.isEmpty())? 0.0 :totalValues.stream().reduce(0.0, Double::sum), symbol); - //Logic to perform DIVISION action - if (action.equals(DIVISION)){ - if (totalValues.size() == 2) { - if (totalValues.get(1) != 0) - data.setHeaderValue(totalValues.get(0) / totalValues.get(1)); - else - data.setHeaderValue(Double.valueOf(0)); - } - else - throw new CustomException("INVALID_NUMBER_OF_OPERANDS", "Division operation can be performed only with 2 operands."); - } - data.setPlots( Arrays.asList(latestDateplot,lastUpdatedTime)); - request.getResponseRecorder().put(visualizationCode, request.getModuleLevel(), data); - dataList.add(data); - if(chartNode.get(POST_AGGREGATION_THEORY) != null) { - ComputeHelper computeHelper = computeHelperFactory.getInstance(chartNode.get(POST_AGGREGATION_THEORY).asText()); - computeHelper.compute(request, dataList); - } - }catch (Exception e){ - logger.info("data chart name = "+chartName +" ex occurred "+e.getMessage()); - } - - return getAggregatedDto(chartNode, dataList, request.getVisualizationCode()); - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricsInsightsHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricsInsightsHandler.java deleted file mode 100644 index a4d205ad8c6..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/MetricsInsightsHandler.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.tarento.analytics.handler; - -import java.text.DecimalFormat; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.InsightsWidget; -import com.tarento.analytics.model.InsightsConfiguration; -import com.tarento.analytics.utils.ResponseRecorder; - -@Component -public class MetricsInsightsHandler implements InsightsHandler { - -// @Autowired -// private ResponseRecorder responseRecorder; - - @Override - public AggregateDto getInsights(AggregateDto aggregateDto, String visualizationCode, String moduleLevel, InsightsConfiguration insightsConfig , ResponseRecorder responseRecorder) { - String internalVisualizationCode = visualizationCode.substring(1); - Data currentData = (Data) responseRecorder.get(internalVisualizationCode, moduleLevel); - Data pastData = (Data) responseRecorder.get(visualizationCode, moduleLevel); - String textToDisplay = insightsConfig.getTextMessage(); - String insightIndicator = ""; - if(INSIGHT_NUMBER_DIFFERENCE.equals(insightsConfig.getAction())) { - Double difference = (Double)currentData.getHeaderValue() - (Double) pastData.getHeaderValue(); - if(difference >= 0) { - Double insightValue = (difference / (Double)pastData.getHeaderValue()) * 100; - if(insightValue.isInfinite()) - return aggregateDto; - if (insightValue.isNaN()) { - textToDisplay = null; - } else { - textToDisplay = textToDisplay.replace(INDICATOR_PLACEHOLDER, POSITIVE); - if(insightsConfig.getIsRoundOff()!=null && insightsConfig.getIsRoundOff()) { - textToDisplay = textToDisplay.replace(VALUE_PLACEHOLDER, - String.valueOf(Math.round(insightValue))); - }else { - textToDisplay = textToDisplay.replace(VALUE_PLACEHOLDER, - String.valueOf(new DecimalFormat("#.##").format(insightValue))); - } - insightIndicator = INSIGHT_INDICATOR_POSITIVE; - } - } else { - difference = (Double) pastData.getHeaderValue() - (Double) currentData.getHeaderValue(); - Double insightValue = (difference / (Double)pastData.getHeaderValue()) * 100; - if(insightValue.isInfinite()) - return aggregateDto; - if(difference.equals(0.0) && insightValue.equals(0.0)) - return aggregateDto; - textToDisplay = textToDisplay.replace(INDICATOR_PLACEHOLDER, NEGATIVE); - if(insightsConfig.getIsRoundOff()!=null && insightsConfig.getIsRoundOff()) { - textToDisplay = textToDisplay.replace(VALUE_PLACEHOLDER, - String.valueOf(Math.round(insightValue))); - }else { - textToDisplay = textToDisplay.replace(VALUE_PLACEHOLDER, - String.valueOf(new DecimalFormat("#.##").format(insightValue))); - } - insightIndicator = INSIGHT_INDICATOR_NEGATIVE; - } - if (textToDisplay == null) { - return aggregateDto; - } else { - textToDisplay = textToDisplay.replace(INSIGHT_INTERVAL_PLACEHOLDER, - insightsConfig.getInsightInterval()); - InsightsWidget insightsWidget = new InsightsWidget(INSIGHT_WIDGET_NAME, textToDisplay, insightIndicator, - insightIndicator); - List dataList = aggregateDto.getData(); - for (Data data : dataList) { - data.setInsight(insightsWidget); - } - } - } - return aggregateDto; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/PerformanceChartResponeHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/PerformanceChartResponeHandler.java deleted file mode 100644 index 2eaf6b68c02..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/PerformanceChartResponeHandler.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.tarento.analytics.handler; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import com.tarento.analytics.helper.ComputeHelper; -import com.tarento.analytics.helper.ComputeHelperFactory; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; - -@Component -public class PerformanceChartResponeHandler implements IResponseHandler { - - public static final Logger logger = LoggerFactory.getLogger(PerformanceChartResponeHandler.class); - - @Autowired - ComputeHelperFactory computeHelperFactory; - @Override - public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException { - - JsonNode aggregationNode = aggregations.get(AGGREGATIONS); - JsonNode chartNode = requestDto.getChartNode(); - String symbol = chartNode.get(IResponseHandler.VALUE_TYPE).asText(); - String plotLabel = chartNode.get(PLOT_LABEL).asText(); - String order = chartNode.get(ORDER).asText(); - int limit = chartNode.get(LIMIT).asInt(); - - boolean isRoundOff = (chartNode.get(IS_ROUND_OFF)!=null && chartNode.get(IS_ROUND_OFF).asBoolean()) ? true : false; - - ArrayNode aggrsPaths = (ArrayNode) chartNode.get(IResponseHandler.AGGS_PATH); - Map> mappings = new LinkedHashMap<>();//HashMap<>(); - - aggrsPaths.forEach(headerPath -> { - aggregationNode.findValues(headerPath.asText()).forEach(aggrNode -> { - if (aggrNode.findValues(IResponseHandler.BUCKETS).size() > 0) { - - ArrayNode buckets = (ArrayNode) aggrNode.findValues(IResponseHandler.BUCKETS).get(0); - buckets.forEach(bucket -> { - String key = bucket.findValue(IResponseHandler.KEY).asText(); - Double value = bucket.findValue(IResponseHandler.VALUE).asDouble(); - - for (Iterator it = bucket.fieldNames(); it.hasNext(); ) { - String fieldName = it.next(); - if(bucket.get(fieldName) instanceof JsonNode){ - if(bucket.get(fieldName).findValue(IResponseHandler.BUCKETS) == null){ - JsonNode valueNode =bucket.get(fieldName).findValue(IResponseHandler.VALUE); - value = (valueNode != null ? valueNode.asDouble(): Double.valueOf("0")); - } - - } - } - - // PreAction Theory should be consdiered and executed to modify the aggregation value - JsonNode preActionTheoryNode = chartNode.get("preActionTheory"); - - if( preActionTheoryNode != null && preActionTheoryNode.findValue(headerPath.asText()) !=null && - !preActionTheoryNode.findValue(headerPath.asText()).asText().isEmpty()) { - ComputeHelper computeHelper = computeHelperFactory.getInstance(preActionTheoryNode.findValue(headerPath.asText()).asText()); - if(computeHelper !=null) { - value = computeHelper.compute(requestDto, value); - } - - } - - if (mappings.containsKey(key)) { - Double sum = (mappings.get(key)).containsKey(headerPath.asText()) ? (mappings.get(key)).get(headerPath.asText()) + value : value; - (mappings.get(key)).put(headerPath.asText(), sum); - - } else { - Map additiveMap = new HashMap<>(); - additiveMap.put(aggrsPaths.get(0).asText(), new Double("0")); - additiveMap.put(aggrsPaths.get(1).asText(), new Double("0")); - - additiveMap.put(headerPath.asText(), value); - mappings.put(key, additiveMap); - } - }); - - } - }); - }); - - logger.info("performance chart data mappings : "+mappings); - List plotList = mappings.entrySet().stream().map(e -> new Plot(e.getKey(), getPercentage(e.getValue(), aggrsPaths.get(0).asText(),aggrsPaths.get(1).asText(), isRoundOff), symbol)).collect(Collectors.toList()); - List plots = plotList.stream().filter(plot -> plot.getValue() != 0.0).collect(Collectors.toList()); - - plots.stream().forEach(item -> item.setLabel(plotLabel)); - Comparator plotValueComparator = Comparator.comparing(Plot::getValue); - plots.sort(plotValueComparator.reversed()); - return getAggregatedDto(chartNode, getDataOnPerformingOrder(plots, limit, order, symbol), requestDto.getVisualizationCode()); - } - - /** - * Prepare the plots with it's header Data in performing order - * @param plots - * @param limit n number of plots elements - * @param order top wise or bottom wise performance - * @param symbol - * @return - */ - private List getDataOnPerformingOrder(List plots, int limit, String order, String symbol) { - - List dataList = new ArrayList<>(); - if (order.equals(ASC)) { - for (int i = (plots.size() - 1); i >= 0; i--) { - dataList.add(getRankedPLot(i, symbol, plots)); - } - } else if (order.equals(DESC)) { - for (int i = 0; i < plots.size(); i++) { - dataList.add(getRankedPLot(i, symbol, plots)); - } - } - // return dataList.subList(Math.max(0, 0), Math.min(dataList.size(), limit)); - return dataList; - - } - - private Data getRankedPLot(int rank, String dataType, List plots){ - Data data = new Data(RANK, rank+1, dataType); - List p = new ArrayList(); - p.add(plots.get(rank)); - data.setPlots(p); - return data; - } - -} - - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/PieChartResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/PieChartResponseHandler.java deleted file mode 100644 index 56d69562e05..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/PieChartResponseHandler.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.tarento.analytics.handler; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import com.tarento.analytics.enums.ChartType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -/** - * This handles ES response for single index, multiple index to represent data as pie figure - * Creates plots by merging/computing(by summation) index values for same key - * AGGS_PATH : this defines the path/key to be used to search the tree - * VALUE_TYPE : defines the data type for the value formed, this could be amount, percentage, number - * - */ -@Component -public class PieChartResponseHandler implements IResponseHandler { - public static final Logger logger = LoggerFactory.getLogger(PieChartResponseHandler.class); - - - @Override - public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException { - - List dataList = new ArrayList<>(); - - JsonNode aggregationNode = aggregations.get(AGGREGATIONS); - JsonNode chartNode = requestDto.getChartNode(); - String headerKey = chartNode.get(CHART_NAME).asText(); - List headerPlotList = new ArrayList<>(); - List totalValue = new ArrayList<>(); - Map plotMap = new LinkedHashMap<>(); - - String symbol = chartNode.get(IResponseHandler.VALUE_TYPE).asText(); - ArrayNode aggrsPaths = (ArrayNode) chartNode.get(IResponseHandler.AGGS_PATH); - - /** - * For every aggregation on plot object is added - */ - aggrsPaths.forEach(headerPath -> { - aggregationNode.findValues(headerPath.asText()).stream().forEach(valueNode->{ - if(valueNode.has(BUCKETS)){ - JsonNode buckets = valueNode.findValue(BUCKETS); - buckets.forEach(bucket -> { - Double val = valueNode.findValues(VALUE).isEmpty() ? bucket.findValue(DOC_COUNT).asInt() : bucket.findValue(VALUE).asDouble(); - totalValue.add(val); - if(plotMap.containsKey(bucket.findValue(KEY).asText())) { - val = val + plotMap.get(bucket.findValue(KEY).asText()); - } - plotMap.put(bucket.findValue(KEY).asText(), new Double("0") + val); -// Plot plot = new Plot(bucket.findValue(KEY).asText(), val, symbol); -// headerPlotList.add(plot); - }); - - } else { - List valueNodes = valueNode.findValues(VALUE).isEmpty() ? valueNode.findValues(DOC_COUNT) : valueNode.findValues(VALUE); - double sum = valueNodes.stream().mapToLong(o -> o.asLong()).sum(); - totalValue.add(sum); - if(plotMap.containsKey(headerPath.asText())) { - plotMap.put(headerPath.asText(),plotMap.get(headerPath.asText())+sum); - } - else { - plotMap.put(headerPath.asText(), sum); - } -// Plot plot = new Plot(headerPath.asText(), sum, symbol); -// headerPlotList.add(plot); - } - }); - }); - headerPlotList = plotMap.entrySet().stream().map(e -> new Plot(e.getKey(), e.getValue(), symbol)).collect(Collectors.toList()); - Data data = new Data(headerKey, totalValue.stream().reduce(0.0, Double::sum), symbol); - data.setPlots(headerPlotList); - dataList.add(data); - - return getAggregatedDto(chartNode, dataList, requestDto.getVisualizationCode()); - - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/ResponseHandlerFactory.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/ResponseHandlerFactory.java deleted file mode 100644 index 65cb3aec946..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/ResponseHandlerFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.tarento.analytics.handler; - -import com.tarento.analytics.enums.ChartType; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class ResponseHandlerFactory { - - @Autowired - private MetricChartResponseHandler metricChartResponseHandler; - @Autowired - private LineChartResponseHandler lineChartResponseHandler; - @Autowired - private PieChartResponseHandler pieChartResponseHandler; - @Autowired - private PerformanceChartResponeHandler performingBarChartResponeHandler; - @Autowired - private TableChartResponseHandler tableChartResponseHandler; - @Autowired - private AdvanceTableChartResponseHandler advanceTableChartResponseHandler; - - - public IResponseHandler getInstance(ChartType chartType) { - - if (chartType == chartType.METRIC) { - return metricChartResponseHandler; - - } else if (chartType == chartType.LINE) { - return lineChartResponseHandler; - - } else if (chartType == chartType.PIE) { - return pieChartResponseHandler; - - } else if (chartType == chartType.PERFORM) { - return performingBarChartResponeHandler; - - } else if (chartType == chartType.TABLE) { - return tableChartResponseHandler; - - } else if (chartType == chartType.XTABLE) { - return advanceTableChartResponseHandler; - } - - return null; - } - - @Autowired - private TablePostResponseHandler tablePostResponseHandler; - public IPostResponseHandler get(ChartType chartType){ - - if(chartType == chartType.TABLE){ - return tablePostResponseHandler; - } - return null; - } - -} - - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/TableChartResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/TableChartResponseHandler.java deleted file mode 100644 index 22f97598922..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/TableChartResponseHandler.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.tarento.analytics.handler; - -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; - -import com.tarento.analytics.helper.ComputedFieldHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; - -import static com.tarento.analytics.constant.Constants.STRING_DATATYPE; - -/** - * This handles ES response for single index, multiple index to compute performance - * Creates plots by performing ordered (ex: top n performance or last n performance) - * AGGS_PATH : configurable to this defines the path/key to be used to search the tree - * VALUE_TYPE : configurable to define the data type for the value formed, this could be amount, percentage, number - * PLOT_LABEL : configurable to define the label for the plot - * TYPE_MAPPING : defines for a plot data type - */ -@Component -public class TableChartResponseHandler implements IResponseHandler { - public static final Logger logger = LoggerFactory.getLogger(TableChartResponseHandler.class); - - @Autowired - ComputedFieldHelper computedFieldHelper; - - @Value("${egov.targetacheivement.chartname.list}") - public String targetacheivementChartListString; - - - @Override - public AggregateDto translate(AggregateRequestDto requestDto, ObjectNode aggregations) throws IOException { - - JsonNode aggregationNode = aggregations.get(AGGREGATIONS); - JsonNode chartNode = requestDto.getChartNode(); - String postAggrTheoryName = chartNode.get(POST_AGGREGATION_THEORY) == null ? "" : chartNode.get(POST_AGGREGATION_THEORY).asText(); - String plotLabel = chartNode.get(PLOT_LABEL).asText(); - ArrayNode pathDataTypeMap = (ArrayNode) chartNode.get(TYPE_MAPPING); - ArrayNode aggrsPaths = (ArrayNode) chartNode.get(IResponseHandler.AGGS_PATH); - Map> mappings = new HashMap<>(); - List aggrNodes = aggregationNode.findValues(BUCKETS); - - int[] idx = { 1 }; - - aggrNodes.stream().forEach(node -> { - ArrayNode buckets = (ArrayNode) node; - buckets.forEach(bucket -> { - Map plotMap = new LinkedHashMap<>(); - String key = bucket.findValue(IResponseHandler.KEY).asText(); - - aggrsPaths.forEach(headerPath -> { - JsonNode datatype = pathDataTypeMap.findValue(headerPath.asText()); - - if(datatype.asText().equalsIgnoreCase(STRING_DATATYPE)){ - addPlotFromBucketForString(headerPath.asText(),bucket,plotMap); - } - else { - JsonNode valueNode = bucket.findValue(headerPath.asText()); - //Double value = (null == valueNode || null == valueNode.get(VALUE)) ? 0.0 : valueNode.get(VALUE).asDouble(); - Double doc_value = 0.0; - if(valueNode!=null) - doc_value = (null == valueNode.findValue(DOC_COUNT)) ? 0.0 : valueNode.findValue(DOC_COUNT).asDouble(); - Double value = (null == valueNode || null == valueNode.findValue(VALUE)) ? doc_value : valueNode.findValue(VALUE).asDouble(); - Plot plot = new Plot(headerPath.asText(), value, datatype.asText()); - if (mappings.containsKey(key)) { - double newval = mappings.get(key).get(headerPath.asText()) == null ? value : (mappings.get(key).get(headerPath.asText()).getValue() + value); - plot.setValue(newval); - mappings.get(key).put(headerPath.asText(), plot); - } else { - plotMap.put(headerPath.asText(), plot); - } - } - - }); - - if (plotMap.size() > 0) { - Map plots = new LinkedHashMap<>(); - Plot sno = new Plot(SERIAL_NUMBER, TABLE_TEXT); - sno.setLabel("" + idx[0]++); - Plot plotkey = new Plot(plotLabel.isEmpty() ? TABLE_KEY : plotLabel, TABLE_TEXT); - plotkey.setLabel(key); - - plots.put(SERIAL_NUMBER, sno); - plots.put(plotLabel.isEmpty() ? TABLE_KEY : plotLabel, plotkey); - plots.putAll(plotMap); - mappings.put(key, plots); - - } - }); - - }); - - List dataList = new ArrayList<>(); - mappings.entrySet().stream().forEach(plotMap -> { - List plotList = plotMap.getValue().values().stream().collect(Collectors.toList()); - List filterPlot = plotList.stream().filter(c -> (!c.getName().equalsIgnoreCase(SERIAL_NUMBER) && !c.getName().equalsIgnoreCase(plotLabel) && c.getValue() != 0.0)).collect(Collectors.toList()); - - // FIX ME: For all aggragation oath with string the above condition will fail and no data will be retunred - - if(filterPlot.size()>=0){ - Data data = new Data(plotMap.getKey(), Integer.parseInt(String.valueOf(plotMap.getValue().get(SERIAL_NUMBER).getLabel())), null); - data.setPlots(plotList); - -// if(requestDto.getVisualizationCode().equals(PT_DDR_BOUNDARY) || requestDto.getVisualizationCode().equals(PT_BOUNDARY) || requestDto.getVisualizationCode().equals(PT_BOUNDARY_DRILL) -// || requestDto.getVisualizationCode().equals(TL_DDR_BOUNDARY) || requestDto.getVisualizationCode().equals(TL_BOUNDARY) || requestDto.getVisualizationCode().equals(TL_BOUNDARY_DRILL)) { - List targetacheivementChartList = Arrays.asList(this.targetacheivementChartListString.split(",")); - if(targetacheivementChartList.contains(requestDto.getVisualizationCode())) - { - computedFieldHelper.set(requestDto, postAggrTheoryName); - computedFieldHelper.add(data,TARGET_ACHIEVED, TOTAL_COLLECTION, TARGET_COLLECTION ); - } - dataList.add(data); - } - - }); - //dataList.sort((o1, o2) -> ((Integer) o1.getHeaderValue()).compareTo((Integer) o2.getHeaderValue())); - return getAggregatedDto(chartNode, dataList, requestDto.getVisualizationCode()); - } - - /** - * Creates plot object for aggragation paths with datatype as string - * @param headerPath - * @param bucket - * @param plotMap - */ - private void addPlotFromBucketForString(String headerPath, JsonNode bucket, Map plotMap){ - try{ - JsonNode valueNode = bucket.findPath(headerPath); - String key = valueNode.findValue(IResponseHandler.KEY).asText(); - Plot plot = new Plot(headerPath, key, STRING_DATATYPE); - plotMap.put(headerPath, plot); - } - catch (Exception e){ - logger.error("Error while creating plot object for aggragation paths"); - logger.info("headerPath: "+headerPath); - logger.info("bucket: "+bucket); - } - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/TablePostResponseHandler.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/TablePostResponseHandler.java deleted file mode 100644 index 65193be1c68..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/handler/TablePostResponseHandler.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.tarento.analytics.handler; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.org.service.MdmsService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -@Component -public class TablePostResponseHandler implements IPostResponseHandler { - private static Logger logger = LoggerFactory.getLogger(TablePostResponseHandler.class); - - - @Autowired - MdmsService mdmsService; - - /*String json = "{\"aggregations\":{\"dss-collection_v1\":{\"ULBs \":{\"doc_count_error_upper_bound\":0,\"sum_other_doc_count\":0,\"buckets\":[{\"key\":\"pb.derabassi\",\"doc_count\":448,\"Transactions\":{\"value\":448},\"Assessed Properties\":{\"value\":1251},\"Total Collection\":{\"value\":620938.0}},{\"key\":\"pb.nayagaon\",\"doc_count\":97,\"Transactions\":{\"value\":97},\"Assessed Properties\":{\"value\":235},\"Total Collection\":{\"value\":69108.0}}]}},\"dss-target_v1\":{\"ULBs \":{\"doc_count_error_upper_bound\":0,\"sum_other_doc_count\":0,\"buckets\":[{\"key\":\"pb.derabassi\",\"doc_count\":1,\"Target Collection\":{\"value\":1.5E7}},{\"key\":\"pb.nayagaon\",\"doc_count\":1,\"Target Collection\":{\"value\":3500000.0}}]}}}}"; - String json1 = "{\"aggregations\":{\"DDRCode \":{\"doc_count_error_upper_bound\":0,\"sum_other_doc_count\":0,\"buckets\":[{\"key\":\"1\",\"doc_count\":277,\"Transactions\":{\"value\":277},\"Assessed Properties\":{\"value\":805},\"Total Collection\":{\"value\":618472.0}},{\"key\":\"9\",\"doc_count\":2719,\"Transactions\":{\"value\":2719},\"Assessed Properties\":{\"value\":8434},\"Total Collection\":{\"value\":5572731.0}}]}}}"; - */ - - /** - * Post response handle for replacing the district names from MDMS service map - * @param responseNode - */ - @Override - public void postResponse(ObjectNode responseNode){ - try { - - List nodes = responseNode.findValues(Constants.MDMSKeys.KEY); - Set values = new HashSet(); - nodes.forEach(node -> { - if(!values.contains(node.asText())) - replaceField(responseNode, Constants.MDMSKeys.KEY, node.asText(),mdmsService.getDDRNameByCode(node.asText())); - values.add(node.asText()); - - }); - logger.info("post response handling(DDR values) "+responseNode); - - }catch (Exception e){ - logger.error("post response handling(DDR values) "+e.getMessage()); - } - - } - - - public static void replaceField(ObjectNode parent, String fieldName, String oldValue, String newValue) { - if (parent.has(fieldName) && parent.get(fieldName).asText().equalsIgnoreCase(oldValue)) { - parent.put(fieldName, newValue); - } - parent.fields().forEachRemaining(entry -> { - JsonNode entryValue = entry.getValue(); - if (entryValue.isArray()) { - for (int i = 0; i < entryValue.size(); i++) { - if (entry.getValue().get(i).isObject()) - replaceField((ObjectNode) entry.getValue().get(i), fieldName, oldValue, newValue); - } - } else if (entryValue.isObject()) { - replaceField((ObjectNode) entry.getValue(), fieldName, oldValue, newValue); - } - }); - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/AdditiveComputedField.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/AdditiveComputedField.java deleted file mode 100644 index b8bbb5c9852..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/AdditiveComputedField.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.tarento.analytics.helper; - -import com.fasterxml.jackson.databind.JsonNode; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -@Component -public class AdditiveComputedField implements IComputedField { - - public static final Logger logger = LoggerFactory.getLogger(AdditiveComputedField.class); - - - private String postAggrTheoryName; - private AggregateRequestDto aggregateRequestDto; - @Autowired - private ComputeHelperFactory computeHelperFactory; - - @Override - public void set(AggregateRequestDto requestDto, String postAggrTheoryName){ - this.aggregateRequestDto = requestDto; - this.postAggrTheoryName = postAggrTheoryName; - } - - @Override - public void add(Data data, List fields, String newField,JsonNode chartNode ) { - String dataType = "amount"; - try { - Map plotMap = data.getPlots().stream().collect(Collectors.toMap(Plot::getName, Function.identity())); - - double total = 0.0; - for (String field: fields){ - dataType = plotMap.get(field).getSymbol(); - total = total+ plotMap.get(field).getValue(); - } - if(postAggrTheoryName != null && !postAggrTheoryName.isEmpty()) { - ComputeHelper computeHelper = computeHelperFactory.getInstance(postAggrTheoryName); - - total = computeHelper.compute(aggregateRequestDto,total ); - } - - - data.getPlots().add(new Plot(newField, total, dataType)); - - } catch (Exception e) { - // throw new RuntimeException("Computed field configuration not correctly provided"); - logger.error("percentage could not be computed " +e.getMessage()); - data.getPlots().add(new Plot(newField, 0.0, dataType)); - } - - } -} - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/AverageComputedField.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/AverageComputedField.java deleted file mode 100644 index 71b2de85efa..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/AverageComputedField.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.tarento.analytics.helper; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.handler.IResponseHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.List; - -@Component -public class AverageComputedField implements IComputedField { - - public static final Logger logger = LoggerFactory.getLogger(AverageComputedField.class); - - - private String postAggrTheoryName; - private AggregateRequestDto aggregateRequestDto; - @Autowired - private ComputeHelperFactory computeHelperFactory; - - @Override - public void set(AggregateRequestDto requestDto, String postAggrTheoryName){ - this.aggregateRequestDto = requestDto; - this.postAggrTheoryName = postAggrTheoryName; - } - - @Override - public void add(ObjectNode data, List fields, String newField,JsonNode chartNode ) { - ObjectNode averageNode = JsonNodeFactory.instance.objectNode(); - - try { - - List values = data.findValues(fields.get(0)); - List vals = new ArrayList<>(); - for(JsonNode valueNode : values){ - vals.add(valueNode.get(IResponseHandler.VALUE).asLong()); - } - - Long sum = vals.stream().reduce(new Long(0), (a, b) -> a + b); - logger.info("sum value:: "+sum+" vals.size():: "+vals.size()); - Long average = sum >= vals.size()? sum/vals.size() : 0; - logger.info("average value:: "+average+" total value:: "+sum); - - averageNode.put(IResponseHandler.VALUE, average); - data.set(newField, averageNode); - - - } catch (Exception e) { - // throw new RuntimeException("Computed field configuration not correctly provided"); - logger.error("average could not be computed " +e.getMessage()); - averageNode.put(IResponseHandler.VALUE,0); - data.set(newField, averageNode); - } - - } -} - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputeHelper.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputeHelper.java deleted file mode 100644 index 3c50469fe94..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputeHelper.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.tarento.analytics.helper; - -import java.util.List; - -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; - -/** - * Compute Helper Inferface which receives the Request and the List of Data - * Implementations will derive as to what has to be the computation based on the Business Logic Specifications - * @author darshan - * - */ -public interface ComputeHelper { - - public List compute(AggregateRequestDto request, List data); - public Double compute(AggregateRequestDto request, double value); - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputeHelperFactory.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputeHelperFactory.java deleted file mode 100644 index f6f6a555fda..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputeHelperFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.tarento.analytics.helper; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.tarento.analytics.constant.Constants; - -/** - * Factory Class to supply the right implementation for the Post Aggregation Computation Business Logic - * which has to be supplied based on the Configuration written in the Chart API Configuration - * @author darshan - * - */ -@Component -public class ComputeHelperFactory { - - @Autowired - private TargetPerDateComputeHelper targetPerDateComputeHelper; - - public ComputeHelper getInstance(String intent) { - - if (intent.equals(Constants.PostAggregationTheories.RESPONSE_DIFF_DATES)) { - return targetPerDateComputeHelper; - } - return null; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputedFieldFactory.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputedFieldFactory.java deleted file mode 100644 index 3af853d7ca9..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputedFieldFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.tarento.analytics.helper; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class ComputedFieldFactory { - - @Autowired - private PercentageComputedField percentageComputedField; - @Autowired - private AverageComputedField averageComputedField; - @Autowired - private AdditiveComputedField additiveComputedField; - - public IComputedField getInstance(String className){ - - if(className.equalsIgnoreCase(percentageComputedField.getClass().getSimpleName())){ - return percentageComputedField; - - } else if(className.equalsIgnoreCase(averageComputedField.getClass().getSimpleName())) { - return averageComputedField; - - } else if(className.equalsIgnoreCase(additiveComputedField.getClass().getSimpleName())) { - return additiveComputedField; - - } else { - throw new RuntimeException("Computer field not found for className "+className); - } - - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputedFieldHelper.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputedFieldHelper.java deleted file mode 100644 index f7908b0cecb..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/ComputedFieldHelper.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.tarento.analytics.helper; - -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -@Component -public class ComputedFieldHelper { - - public static final Logger logger = LoggerFactory.getLogger(ComputedFieldHelper.class); - - @Autowired - private ComputeHelperFactory computeHelperFactory; - - private AggregateRequestDto aggregateRequestDto; - private String postAggrTheoryName; - - public void set(AggregateRequestDto requestDto, String postAggrTheoryName){ - - this.aggregateRequestDto = requestDto; - this.postAggrTheoryName = postAggrTheoryName; - } - - public void add(Data data, String newfield, String partField, String wholeField){ - try { - Map plotMap = data.getPlots().stream().collect(Collectors.toMap(Plot::getName, Function.identity())); - - if (plotMap.get(partField).getValue() == 0.0 || plotMap.get(wholeField).getValue() == 0.0) { - - data.getPlots().add(new Plot(newfield, 0.0, "percentage")); - } else { - double wholeValue = plotMap.get(wholeField).getValue(); - double fieldValue = plotMap.get(partField).getValue() / plotMap.get(wholeField).getValue() * 100; - - if(postAggrTheoryName != null && !postAggrTheoryName.isEmpty()) { - //logger.info("Chart name: "+aggregateRequestDto.getVisualizationCode()+" :: postAggrTheoryName : "+postAggrTheoryName); - ComputeHelper computeHelper = computeHelperFactory.getInstance(postAggrTheoryName); - fieldValue = computeHelper.compute(aggregateRequestDto, fieldValue); - wholeValue = computeHelper.compute(aggregateRequestDto, wholeValue); - - } - data.getPlots().stream().filter(plot -> wholeField.equalsIgnoreCase(plot.getName())).findAny().orElse(null).setValue(wholeValue); - data.getPlots().add(new Plot(newfield, fieldValue, "percentage")); - - } - - - } catch (Exception e) { - data.getPlots().add(new Plot(newfield, 0.0, "percentage")); - } - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/IComputedField.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/IComputedField.java deleted file mode 100644 index f564b2f51c9..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/IComputedField.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.tarento.analytics.helper; - -import com.fasterxml.jackson.databind.JsonNode; -import com.tarento.analytics.dto.AggregateRequestDto; - -import java.util.List; - -public interface IComputedField { - - public void set(AggregateRequestDto requestDto, String postAggrTheoryName); - public void add(T data, List fields, String newField,JsonNode chartNode ); - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/PercentageComputedField.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/PercentageComputedField.java deleted file mode 100644 index 92b6daecf9a..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/PercentageComputedField.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.tarento.analytics.helper; - -import com.fasterxml.jackson.databind.JsonNode; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; -import com.tarento.analytics.dto.Plot; -import com.tarento.analytics.handler.IResponseHandler; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -@Component -public class PercentageComputedField implements IComputedField{ - - public static final Logger logger = LoggerFactory.getLogger(PercentageComputedField.class); - - - private String postAggrTheoryName; - private AggregateRequestDto aggregateRequestDto; - @Autowired - private ComputeHelperFactory computeHelperFactory; - - @Override - public void set(AggregateRequestDto requestDto, String postAggrTheoryName){ - this.aggregateRequestDto = requestDto; - this.postAggrTheoryName = postAggrTheoryName; - } - - @Override - public void add(Data data, List fields, String newField, JsonNode chartNode ) { - try { - Map plotMap = data.getPlots().stream().collect(Collectors.toMap(Plot::getName, Function.identity())); - - if (plotMap.get(fields.get(0)).getValue() == 0.0 || plotMap.get(fields.get(1)).getValue() == 0.0) { - - data.getPlots().add(new Plot(newField, 0.0, "percentage")); - } else { - double wholeValue = plotMap.get(fields.get(1)).getValue(); - double fieldValue = plotMap.get(fields.get(0)).getValue() / plotMap.get(fields.get(1)).getValue() * 100; - if(chartNode.get(IResponseHandler.IS_ROUND_OFF)!=null && chartNode.get(IResponseHandler.IS_ROUND_OFF).asBoolean()) { - fieldValue = (double) Math.round(fieldValue); - } - - if(postAggrTheoryName != null && !postAggrTheoryName.isEmpty()) { - ComputeHelper computeHelper = computeHelperFactory.getInstance(postAggrTheoryName); - fieldValue = computeHelper.compute(aggregateRequestDto, fieldValue); - wholeValue = computeHelper.compute(aggregateRequestDto, wholeValue); - } - data.getPlots().stream().filter(plot -> fields.get(1).equalsIgnoreCase(plot.getName())).findAny().orElse(null).setValue(wholeValue); - data.getPlots().add(new Plot(newField, fieldValue, "percentage")); - } - - } catch (Exception e) { - // throw new RuntimeException("Computed field configuration not correctly provided"); - logger.error("percentage could not be computed " +e.getMessage()); - data.getPlots().add(new Plot(newField, 0.0, "percentage")); - } - - } -} - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/TargetPerDateComputeHelper.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/TargetPerDateComputeHelper.java deleted file mode 100644 index e69ed10ece2..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/helper/TargetPerDateComputeHelper.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.tarento.analytics.helper; - -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.Data; - -/** - * This implementation of Compute Helper is used to compute the difference of dates between the Request Date - * The difference is then multiplied against the Per Day Unit of Target which has been obtained from Elastic Search - * @author darshan - * - */ -@Component -public class TargetPerDateComputeHelper implements ComputeHelper { - private static final Long ROUND_OFF= 19801000l; - private static final Long NUMBER_OF_DAYS = 365l; - private static final Long LAST_HOUR = 23l; - private static final Long LAST_MINUTE = 59l; - public static final Logger logger = LoggerFactory.getLogger(TargetPerDateComputeHelper.class); - @Override - public List compute(AggregateRequestDto request, List data) { - if(request.getRequestDate()!= null && request.getRequestDate().getStartDate() != null && request.getRequestDate().getEndDate() !=null) { - try { - Long sDate = Long.parseLong(request.getRequestDate().getStartDate()); - logger.info("Start Date : " + String.valueOf(sDate)); - Long eDate = Long.parseLong(request.getRequestDate().getEndDate()); - logger.info("End Date : " + String.valueOf(eDate)); - Calendar cal = Calendar.getInstance(); - cal.setTime(new Date(eDate)); - if(cal.get(Calendar.HOUR_OF_DAY) == LAST_HOUR && cal.get(Calendar.MINUTE) == LAST_MINUTE) { - eDate = eDate + ROUND_OFF; - } - logger.info("End Date after Round Off: " + String.valueOf(eDate)); - Long dateDifference = TimeUnit.DAYS.convert((eDate - sDate), TimeUnit.MILLISECONDS); - if(dateDifference == 0l) dateDifference = dateDifference + 1l ; - for(Data eachData : data) { - Double value = (Double) eachData.getHeaderValue(); - logger.info("Value is : " + value + " :: Date Difference is : " + dateDifference); - value = (value / NUMBER_OF_DAYS) * dateDifference; - eachData.setHeaderValue(value); - } - } catch (Exception ex) { - logger.error("Encountered an error while computing the logic in Target Date Computer : " + ex.getMessage()); - } - } - return data; - } - - @Override - public Double compute(AggregateRequestDto request, double value){ - - if(request.getRequestDate()!= null && request.getRequestDate().getStartDate() != null && request.getRequestDate().getEndDate() !=null) { - try { - Long sDate = Long.parseLong(request.getRequestDate().getStartDate()); - logger.info("Start Date : " + String.valueOf(sDate)); - Long eDate = Long.parseLong(request.getRequestDate().getEndDate()); - logger.info("End Date : " + String.valueOf(eDate)); - Calendar cal = Calendar.getInstance(); - cal.setTime(new Date(eDate)); - if(cal.get(Calendar.HOUR_OF_DAY) == LAST_HOUR && cal.get(Calendar.MINUTE) == LAST_MINUTE) { - eDate = eDate + ROUND_OFF; - } - logger.info("End Date after Round Off: " + String.valueOf(eDate)); - Long dateDifference = TimeUnit.DAYS.convert((eDate - sDate), TimeUnit.MILLISECONDS); - if(dateDifference == 0l) dateDifference = dateDifference + 1l ; - - value = (value / NUMBER_OF_DAYS) * dateDifference; - logger.info("Value is : " + value + " :: Date Difference is : " + dateDifference); - - } catch (Exception ex) { - logger.error("Encountered an error while computing the logic in Target Date Computer : " + ex.getMessage()); - } - } - - return value; - - - - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/AmazonS3Config.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/AmazonS3Config.java deleted file mode 100644 index dbf72f9f174..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/AmazonS3Config.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.tarento.analytics.model; - -import com.amazonaws.auth.AWSCredentialsProvider; -import com.amazonaws.auth.AWSStaticCredentialsProvider; -import com.amazonaws.auth.BasicAWSCredentials; -import com.amazonaws.regions.Region; -import com.amazonaws.regions.Regions; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class AmazonS3Config -{ - @Value("${aws.access.key.id}") - private String awsKeyId; - - @Value("${aws.access.key.secret}") - private String awsKeySecret; - - @Value("${aws.region}") - private String awsRegion; - - @Value("${aws.s3.audio.bucket}") - private String awsS3AudioBucket; - - @Bean(name = "awsKeyId") - public String getAWSKeyId() { - return awsKeyId; - } - - @Bean(name = "awsKeySecret") - public String getAWSKeySecret() { - return awsKeySecret; - } - - @Bean(name = "awsRegion") - public Region getAWSPollyRegion() { - return Region.getRegion(Regions.fromName(awsRegion)); - } - - @Bean(name = "awsCredentialsProvider") - public AWSCredentialsProvider getAWSCredentials() { - BasicAWSCredentials awsCredentials = new BasicAWSCredentials(this.awsKeyId, this.awsKeySecret); - return new AWSStaticCredentialsProvider(awsCredentials); - } - - @Bean(name = "awsS3AudioBucket") - public String getAWSS3AudioBucket() { - return awsS3AudioBucket; - } -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ComputedFields.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ComputedFields.java deleted file mode 100644 index 51f60546c27..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ComputedFields.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.tarento.analytics.model; - -import java.util.ArrayList; -import java.util.List; - -public class ComputedFields { - - private String postAggregationTheory; - private String actionName; - private List fields = new ArrayList<>(); - private String newField; - - public String getPostAggregationTheory() { - return postAggregationTheory; - } - - public void setPostAggregationTheory(String postAggregationTheory) { - this.postAggregationTheory = postAggregationTheory; - } - - public String getActionName() { - return actionName; - } - - public void setActionName(String actionName) { - this.actionName = actionName; - } - - public List getFields() { - return fields; - } - - public void setFields(List fields) { - this.fields = fields; - } - - public String getNewField() { - return newField; - } - - public void setNewField(String newField) { - this.newField = newField; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ElasticSearchDictator.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ElasticSearchDictator.java deleted file mode 100644 index ec51d3054bf..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ElasticSearchDictator.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.tarento.analytics.model; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * - * @author Darshan - * - */ -public class ElasticSearchDictator { - - private String visualisationName; - private String indexName; - private String documentType; - private Map>> queryMap; - private Map>>> aggregationMap; - private Map queryAggregationMap; - - public Map getQueryAggregationMap() { - return queryAggregationMap; - } - - public void setQueryAggregationMap(Map queryAggregationMap) { - this.queryAggregationMap = queryAggregationMap; - } - - public String getVisualisationName() { - return visualisationName; - } - - public void setVisualisationName(String visualisationName) { - this.visualisationName = visualisationName; - } - - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - public String getDocumentType() { - return documentType; - } - - public void setDocumentType(String documentType) { - this.documentType = documentType; - } - - public Map>> getQueryMap() { - return queryMap; - } - - public void setQueryMap(Map>> queryMap) { - this.queryMap = queryMap; - } - - public Map>>> getAggregationMap() { - return aggregationMap; - } - - public void setAggregationMap(Map>>> aggregationMap) { - this.aggregationMap = aggregationMap; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/InsightsConfiguration.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/InsightsConfiguration.java deleted file mode 100644 index 5b636b24a7c..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/InsightsConfiguration.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.tarento.analytics.model; - - -public class InsightsConfiguration { - private String chartResponseMap; - private String action; - private String upwardIndicator; - private String downwardIndicator; - private String textMessage; - private String colorCode; - private String insightInterval; - private Boolean isRoundOff; - - public String getInsightInterval() { - return insightInterval; - } - public void setInsightInterval(String insightInterval) { - this.insightInterval = insightInterval; - } - public String getChartResponseMap() { - return chartResponseMap; - } - public void setChartResponseMap(String chartResponseMap) { - this.chartResponseMap = chartResponseMap; - } - public String getAction() { - return action; - } - public void setAction(String action) { - this.action = action; - } - public String getUpwardIndicator() { - return upwardIndicator; - } - public void setUpwardIndicator(String upwardIndicator) { - this.upwardIndicator = upwardIndicator; - } - public String getDownwardIndicator() { - return downwardIndicator; - } - public void setDownwardIndicator(String downwardIndicator) { - this.downwardIndicator = downwardIndicator; - } - public String getTextMessage() { - return textMessage; - } - public void setTextMessage(String textMessage) { - this.textMessage = textMessage; - } - public String getColorCode() { - return colorCode; - } - public void setColorCode(String colorCode) { - this.colorCode = colorCode; - } - public Boolean getIsRoundOff() { - return isRoundOff; - } - public void setIsRoundOff(Boolean isRoundOff) { - this.isRoundOff = isRoundOff; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Item.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Item.java deleted file mode 100644 index b1e63e89eae..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Item.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.tarento.analytics.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Item { - - @JsonProperty("name") - private String name; - @JsonProperty("code") - private String code; - @JsonProperty("id") - private Long id; - @JsonProperty("description") - private String description; - @JsonProperty("price") - private Double price; - @JsonProperty("categoryId") - private Long categoryId; - @JsonProperty("subCategoryId") - private Long subCategoryId; - @JsonProperty("name") - - - public String getName() { - return name; - } - - public Long getCategoryId() { - return categoryId; - } - - public void setCategoryId(Long categoryId) { - this.categoryId = categoryId; - } - - public Long getSubCategoryId() { - return subCategoryId; - } - - public void setSubCategoryId(Long subCategoryId) { - this.subCategoryId = subCategoryId; - } - - @JsonProperty("name") - public void setName(String name) { - this.name = name; - } - - @JsonProperty("code") - public String getCode() { - return code; - } - - @JsonProperty("code") - public void setCode(String code) { - this.code = code; - } - - @JsonProperty("id") - public Long getId() { - return id; - } - - @JsonProperty("id") - public void setId(Long id) { - this.id = id; - } - - @JsonProperty("description") - public String getDescription() { - return description; - } - - @JsonProperty("description") - public void setDescription(String description) { - this.description = description; - } - - @JsonProperty("price") - public Double getPrice() { - return price; - } - - @JsonProperty("price") - public void setPrice(Double price) { - this.price = price; - } - - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/KeyData.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/KeyData.java deleted file mode 100644 index 6a49dd3bd54..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/KeyData.java +++ /dev/null @@ -1,53 +0,0 @@ - -package com.tarento.analytics.model; - -public class KeyData { - - - private Long id; - private Object key; - private String label; - - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - public Object getKey() { - return key; - } - public void setKey(Object key) { - this.key = key; - } - public String getLabel() { - return label; - } - public void setLabel(String label) { - this.label = label; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((key == null) ? 0 : key.hashCode()); - return result; - } - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - KeyData other = (KeyData) obj; - if (key == null) { - if (other.key != null) - return false; - } else if (!key.equals(other.key)) - return false; - return true; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Label.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Label.java deleted file mode 100644 index d0ef0c8e9c1..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Label.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.tarento.analytics.model; - -public class Label { - - private String xLabel; - private String yLabel; - public String getxLabel() { - return xLabel; - } - public void setxLabel(String xLabel) { - this.xLabel = xLabel; - } - public String getyLabel() { - return yLabel; - } - public void setyLabel(String yLabel) { - this.yLabel = yLabel; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/LineData.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/LineData.java deleted file mode 100644 index 532eeb814da..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/LineData.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.tarento.analytics.model; - -public class LineData { - - private String type; - private Object value; - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - public Object getValue() { - return value; - } - public void setValue(Object value) { - this.value = value; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Query.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Query.java deleted file mode 100644 index bf34cdbc082..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Query.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.tarento.analytics.model; - -import java.util.Map; - -public class Query { - - private String dateFilterField; - private Map aggregation; - - public String getDateFilterField() { - return dateFilterField; - } - - public void setDateFilterField(String dateFilterField) { - this.dateFilterField = dateFilterField; - } - - public Map getAggregation() { - return aggregation; - } - - public void setAggregation(Map aggregation) { - this.aggregation = aggregation; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ServiceQuery.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ServiceQuery.java deleted file mode 100644 index f6fdd64ed61..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/ServiceQuery.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.tarento.analytics.model; - -public class ServiceQuery { - - private String indexName; - private String queryJson; - private String documentType; - public String getIndexName() { - return indexName; - } - public void setIndexName(String indexName) { - this.indexName = indexName; - } - public String getQueryJson() { - return queryJson; - } - public void setQueryJson(String queryJson) { - this.queryJson = queryJson; - } - public String getDocumentType() { - return documentType; - } - public void setDocumentType(String documentType) { - this.documentType = documentType; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Transaction.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Transaction.java deleted file mode 100644 index 5e5b063df99..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/Transaction.java +++ /dev/null @@ -1,264 +0,0 @@ -package com.tarento.analytics.model; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Transaction Object which gets posted to Elastic Search - * @author Darshan Nagesh - * - */ -public class Transaction { - - @JsonProperty("transactionId") - private Long transactionId; - @JsonProperty("receiptNo") - private String receiptNo; - @JsonProperty("transType") - private String transType; - @JsonProperty("storeCode") - private Long storeCode; - @JsonProperty("posTerminalNo") - private String posTerminalNo; - @JsonProperty("staffId") - private Long staffId; - @JsonProperty("transDate") - private String transDate; - @JsonProperty("transTime") - private String transTime; - @JsonProperty("customerNo") - private Long consumerNo; - @JsonProperty("salesType") - private String salesType; - @JsonProperty("netAmt") - private Double netAmt; - @JsonProperty("grossAmt") - private Double grossAmt; - @JsonProperty("payment") - private Double payment; - @JsonProperty("discountAmt") - private Double discountAmt; - @JsonProperty("costAmt") - private Double costAmt; - @JsonProperty("managerId") - private Long managerId; - @JsonProperty("isTraining") - private Boolean isTraining; - @JsonProperty("statementNo") - private String statementNo; - @JsonProperty("postingStatus") - private String postingStatus; - @JsonProperty("postStatementNo") - private String postStatementNo; - @JsonProperty("customerAgeGroup") - private String customerAgeGroup; - @JsonProperty("customerGender") - private String customerGender; - @JsonProperty("items") - private List items; - @JsonProperty("itemDetails") - private List itemDetails; - @JsonProperty("orgId") - private Long orgId; - - public Long getOrgId() { - return orgId; - } - - public void setOrgId(Long orgId) { - this.orgId = orgId; - } - - public List getItemDetails() { - return itemDetails; - } - - public void setItemDetails(List itemDetails) { - this.itemDetails = itemDetails; - } - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public String getCustomerAgeGroup() { - return customerAgeGroup; - } - - public void setCustomerAgeGroup(String customerAgeGroup) { - this.customerAgeGroup = customerAgeGroup; - } - - public String getCustomerGender() { - return customerGender; - } - - public void setCustomerGender(String customerGender) { - this.customerGender = customerGender; - } - - public Long getTransactionId() { - return transactionId; - } - - public void setTransactionId(Long transactionId) { - this.transactionId = transactionId; - } - - public String getReceiptNo() { - return receiptNo; - } - - public void setReceiptNo(String receiptNo) { - this.receiptNo = receiptNo; - } - - public String getTransType() { - return transType; - } - - public void setTransType(String transType) { - this.transType = transType; - } - - public Long getStoreCode() { - return storeCode; - } - - public void setStoreCode(Long storeCode) { - this.storeCode = storeCode; - } - - public String getPosTerminalNo() { - return posTerminalNo; - } - - public void setPosTerminalNo(String posTerminalNo) { - this.posTerminalNo = posTerminalNo; - } - - public Long getStaffId() { - return staffId; - } - - public void setStaffId(Long staffId) { - this.staffId = staffId; - } - - public String getTransDate() { - return transDate; - } - - public void setTransDate(String transDate) { - this.transDate = transDate; - } - - public String getTransTime() { - return transTime; - } - - public void setTransTime(String transTime) { - this.transTime = transTime; - } - - public Long getConsumerNo() { - return consumerNo; - } - - public void setConsumerNo(Long consumerNo) { - this.consumerNo = consumerNo; - } - - public String getSalesType() { - return salesType; - } - - public void setSalesType(String salesType) { - this.salesType = salesType; - } - - public Double getNetAmt() { - return netAmt; - } - - public void setNetAmt(Double netAmt) { - this.netAmt = netAmt; - } - - public Double getGrossAmt() { - return grossAmt; - } - - public void setGrossAmt(Double grossAmt) { - this.grossAmt = grossAmt; - } - - public Double getPayment() { - return payment; - } - - public void setPayment(Double payment) { - this.payment = payment; - } - - public Double getDiscountAmt() { - return discountAmt; - } - - public void setDiscountAmt(Double discountAmt) { - this.discountAmt = discountAmt; - } - - public Double getCostAmt() { - return costAmt; - } - - public void setCostAmt(Double costAmt) { - this.costAmt = costAmt; - } - - public Long getManagerId() { - return managerId; - } - - public void setManagerId(Long managerId) { - this.managerId = managerId; - } - - public Boolean getIsTraining() { - return isTraining; - } - - public void setIsTraining(Boolean isTraining) { - this.isTraining = isTraining; - } - - public String getStatementNo() { - return statementNo; - } - - public void setStatementNo(String statementNo) { - this.statementNo = statementNo; - } - - public String getPostingStatus() { - return postingStatus; - } - - public void setPostingStatus(String postingStatus) { - this.postingStatus = postingStatus; - } - - public String getPostStatementNo() { - return postStatementNo; - } - - public void setPostStatementNo(String postStatementNo) { - this.postStatementNo = postStatementNo; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Chart.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Chart.java deleted file mode 100644 index 9a83dbf1ee0..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Chart.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.tarento.analytics.model.dashboardConfig; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Chart { - -@JsonProperty("id") -private Long id; -@JsonProperty("name") -private String name; -@JsonProperty("code") -private String code; -@JsonProperty("serviceApi") -private String serviceApi; -@JsonProperty("chartType") -private String chartType; -@JsonProperty("headersAvailable") -private Boolean headersAvailable; -@JsonProperty("filter") -private String filter; -@JsonProperty("headers") -private List
headers = null; - - -public String getFilter() { - return filter; -} - -public void setFilter(String filter) { - this.filter = filter; -} - -@JsonProperty("id") -public Long getId() { -return id; -} - -@JsonProperty("id") -public void setId(Long id) { -this.id = id; -} - -@JsonProperty("name") -public String getName() { -return name; -} - -@JsonProperty("name") -public void setName(String name) { -this.name = name; -} - -@JsonProperty("code") -public String getCode() { -return code; -} - -@JsonProperty("code") -public void setCode(String code) { -this.code = code; -} - -@JsonProperty("serviceApi") -public String getServiceApi() { -return serviceApi; -} - -@JsonProperty("serviceApi") -public void setServiceApi(String serviceApi) { -this.serviceApi = serviceApi; -} - -@JsonProperty("chartType") -public String getChartType() { -return chartType; -} - -@JsonProperty("chartType") -public void setChartType(String chartType) { -this.chartType = chartType; -} - -@JsonProperty("headersAvailable") -public Boolean getHeadersAvailable() { -return headersAvailable; -} - -@JsonProperty("headersAvailable") -public void setHeadersAvailable(Boolean headersAvailable) { -this.headersAvailable = headersAvailable; -} - -@JsonProperty("headers") -public List
getHeaders() { -return headers; -} - -@JsonProperty("headers") -public void setHeaders(List
headers) { -this.headers = headers; -} - - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Dashboard.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Dashboard.java deleted file mode 100644 index f06271f7671..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Dashboard.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.tarento.analytics.model.dashboardConfig; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.tarento.analytics.dto.DashboardDto; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Dashboard { - -@JsonProperty("id") -private Long id; -@JsonProperty("name") -private String name; -@JsonProperty("code") -private String code; -@JsonProperty("isActive") -private Boolean isActive; -@JsonProperty("description") -private String description; -@JsonProperty("placement") -private String placement; -@JsonProperty("visualizations") -private List visualizations = null; - -public Dashboard() {} -public Dashboard(DashboardDto dto) { - this.id = dto.getId(); - this.name = dto.getName(); - this.code = dto.getCode(); - this.description = dto.getDescription(); - this.placement = dto.getPlacement(); -} - -public String getPlacement() { - return placement; -} -public void setPlacement(String placement) { - this.placement = placement; -} -public Long getId() { - return id; -} - -public void setId(Long id) { - this.id = id; -} - -@JsonProperty("name") -public String getName() { -return name; -} - -@JsonProperty("name") -public void setName(String name) { -this.name = name; -} - -@JsonProperty("code") -public String getCode() { -return code; -} - -@JsonProperty("code") -public void setCode(String code) { -this.code = code; -} - -@JsonProperty("isActive") -public Boolean getIsActive() { -return isActive; -} - -@JsonProperty("isActive") -public void setIsActive(Boolean isActive) { -this.isActive = isActive; -} - -@JsonProperty("description") -public String getDescription() { -return description; -} - -@JsonProperty("description") -public void setDescription(String description) { -this.description = description; -} - -@JsonProperty("visualizations") -public List getVisualizations() { -return visualizations; -} - -@JsonProperty("visualizations") -public void setVisualizations(List visualizations) { -this.visualizations = visualizations; -} - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Header.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Header.java deleted file mode 100644 index 60572bbf9ba..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Header.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.tarento.analytics.model.dashboardConfig; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Header { - -@JsonProperty("id") -private Long id; -@JsonProperty("label") -private String label; -@JsonProperty("data") -private String data; -@JsonProperty("field") -private String field; - - -public Long getId() { - return id; -} - -public void setId(Long id) { - this.id = id; -} - -public String getField() { - return field; -} - -public void setField(String field) { - this.field = field; -} - -@JsonProperty("label") -public String getLabel() { -return label; -} - -@JsonProperty("label") -public void setLabel(String label) { -this.label = label; -} - -@JsonProperty("data") -public String getData() { -return data; -} - -@JsonProperty("data") -public void setData(String data) { -this.data = data; -} - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Visualization.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Visualization.java deleted file mode 100644 index f88286ff8d5..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/model/dashboardConfig/Visualization.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.tarento.analytics.model.dashboardConfig; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -@JsonInclude(JsonInclude.Include.NON_NULL) -public class Visualization { - -@JsonProperty("id") -private Long id; -@JsonProperty("name") -private String name; -@JsonProperty("description") -private String description; -@JsonProperty("chartType") -private String chartType; -@JsonProperty("charts") -private List charts = null; -private List storeId; -@JsonProperty("salesAreaCode") -private String salesAreaCode; -@JsonProperty("countryCode") -private String countryCode; - - -public List getStoreId() { - return storeId; -} - - -@JsonProperty("visualRank") -private Long visualRank; - - -public void setStoreId(List storeId) { - this.storeId = storeId; -} - -public String getSalesAreaCode() { - return salesAreaCode; -} - -public void setSalesAreaCode(String salesAreaCode) { - this.salesAreaCode = salesAreaCode; -} - -public String getCountryCode() { - return countryCode; -} - -public void setCountryCode(String countryCode) { - this.countryCode = countryCode; -} - -public Long getVisualRank() { - return visualRank; -} - -public void setVisualRank(Long visualRank) { - this.visualRank = visualRank; -} - -public String getChartType() { - return chartType; -} - -public void setChartType(String chartType) { - this.chartType = chartType; -} - -@JsonProperty("id") -public Long getId() { -return id; -} - -@JsonProperty("id") -public void setId(Long id) { -this.id = id; -} - -@JsonProperty("name") -public String getName() { -return name; -} - -@JsonProperty("name") -public void setName(String name) { -this.name = name; -} - -@JsonProperty("description") -public String getDescription() { -return description; -} - -@JsonProperty("description") -public void setDescription(String description) { -this.description = description; -} - -@JsonProperty("charts") -public List getCharts() { -return charts; -} - -@JsonProperty("charts") -public void setCharts(List charts) { -this.charts = charts; -} - - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/ClientService.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/ClientService.java deleted file mode 100644 index bebe42fc946..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/ClientService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.tarento.analytics.org.service; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.dto.*; -import com.tarento.analytics.exception.AINException; - -public interface ClientService { - - public AggregateDto getAggregatedData(AggregateRequestDto req, List roles) throws AINException, IOException; - public List getHeaderData(CummulativeDataRequestDto requestDto, List roles) throws AINException; - - /** - * Default handle request to translates tenant code to a value - */ - default boolean preHandle(AggregateRequestDto request, ObjectNode chartNode, MdmsApiMappings mdmsApiMappings){ - boolean status = Boolean.FALSE; - JsonNode translateNode = chartNode.get(Constants.JsonPaths.TRANSLATE_CODE); - boolean isTranslate = translateNode == null || translateNode.asBoolean()==Boolean.FALSE ? Boolean.FALSE : translateNode.asBoolean(); - boolean valueExist = request.getFilters().containsKey(Constants.MDMSKeys.TENANT_ID); - if(valueExist && isTranslate){ - Object filter = request.getFilters().get(Constants.MDMSKeys.TENANT_ID); - List values = new ArrayList<>(); - if(filter instanceof ArrayList){ - for(Object code : ((ArrayList)request.getFilters().get(Constants.MDMSKeys.TENANT_ID))){ - String val = mdmsApiMappings.valueOf(code.toString()); - if(val!=null) values.add(val); - } - request.getFilters().put(Constants.MDMSKeys.TENANT_ID, values); - status = Boolean.TRUE; - - } else if(filter instanceof String){ - String code = request.getFilters().get(Constants.MDMSKeys.TENANT_ID).toString(); - String value = mdmsApiMappings.valueOf(code); - request.getFilters().put(Constants.MDMSKeys.TENANT_ID, value); - status = Boolean.TRUE; - } - - } - return isTranslate; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/ClientServiceFactory.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/ClientServiceFactory.java deleted file mode 100644 index 0ec5fcdb68e..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/ClientServiceFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.tarento.analytics.org.service; - -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.constant.Constants; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class ClientServiceFactory { - - @Autowired - TarentoServiceImpl tarentoServiceImpl; - - @Autowired - MdmsServiceImpl mdmsServiceImpl; - - @Autowired - ConfigurationLoader configurationLoader; - - public ClientService getInstance(Constants.ClienServiceType clientServiceName){ - - if(clientServiceName.equals(Constants.ClienServiceType.DEFAULT_CLIENT)) - return tarentoServiceImpl; - else if(clientServiceName.equals(Constants.ClienServiceType.MDMS_CLIENT)) - return mdmsServiceImpl; - - else - throw new RuntimeException(clientServiceName + "not found"); - - } - - public ClientService get(String chartId){ - - ObjectNode node = configurationLoader.get(Constants.ConfigurationFiles.CHART_API_CONFIG); - ObjectNode chartNode = (ObjectNode) node.get(chartId); - boolean mdmsEnable = chartNode.get(Constants.JsonPaths.IS_MDMS_ENABALED) == null ? false : chartNode.get(Constants.JsonPaths.IS_MDMS_ENABALED).asBoolean(); - - if(mdmsEnable) - return mdmsServiceImpl; - else - return tarentoServiceImpl; - - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsApiMappings.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsApiMappings.java deleted file mode 100644 index 154ce4ef1b2..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsApiMappings.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.tarento.analytics.org.service; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.service.impl.RestService; -import org.egov.tracer.model.CustomException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static com.tarento.analytics.constant.Constants.MDMS_REQUESTINFO; -import static com.tarento.analytics.constant.Constants.TENANTID_PLACEHOLDER; - -@Component -public class MdmsApiMappings { - - private boolean isTranslate = Boolean.FALSE; - private final String TESTING_ID = "pb.testing"; - private final String NAME = "name"; - private final String MDMS_CITY_NAME_CONFIG_FILE_NAME = "TenantCodeNameMappings.json"; - - private static Logger logger = LoggerFactory.getLogger(MdmsApiMappings.class); - - private Map ddrTenantMapping = new HashMap<>(); - private Map> ddrTenantMapping1 = new HashMap<>(); - private Map codeValues = new HashMap<>(); - private Map> ddrValueMap = new HashMap<>(); - - @Autowired - private ConfigurationLoader configurationLoader; - - @Value("${egov.mdms.host}") - private String mdmsServiceHost; - - @Value("${egov.mdms.search.endpoint}") - private String mdmsSearchEndpoint; - - - @Autowired - private RestService restService; - - @Autowired - private ObjectMapper mapper; - - @Value("${egov.statelevel.tenantId}") - private String stateLevelTenantId ; - - public String valueOf(String code){ - return codeValues.getOrDefault(code, null); - } - - public void setTranslate(boolean isTranslate){ - this.isTranslate = isTranslate; - } - - /** - * This method loads the MDMS city name mappings. - * - * @return - */ - - private Map getMappings() { - ObjectNode objectNode = configurationLoader.get(MDMS_CITY_NAME_CONFIG_FILE_NAME); - ArrayNode objectArrayNode = (ArrayNode) objectNode.get("ulbCityNamesMappings"); - Map ulbCityNamesMappings = new HashMap(); - for (JsonNode node : objectArrayNode) { - ulbCityNamesMappings.put(node.get("tenantCode").asText(), node.get("tenantValue").asText()); - } - return ulbCityNamesMappings; - } - - - @PostConstruct - public void loadMdmsService() throws Exception { - - String REQUEST_INFO_STR = MDMS_REQUESTINFO.replace(TENANTID_PLACEHOLDER,stateLevelTenantId); - - JsonNode requestInfo = mapper.readTree(REQUEST_INFO_STR); - try { - JsonNode response = restService.post(mdmsServiceHost + mdmsSearchEndpoint, "", requestInfo); - ArrayNode tenants = (ArrayNode) response.findValues(Constants.MDMSKeys.TENANTS).get(0); - Map ulbCityNamesMappings = getMappings(); - logger.info("ulbCityNamesMappings :: "+ulbCityNamesMappings); - - - for(JsonNode tenant : tenants) { - JsonNode tenantId = tenant.findValue(Constants.MDMSKeys.CODE); - JsonNode ddrCode = tenant.findValue(Constants.MDMSKeys.DISTRICT_CODE); - JsonNode ddrName = tenant.findValue(Constants.MDMSKeys.DDR_NAME); - - //JsonNode name = tenant.findValue(NAME); - //if(!codeValues.containsKey(tenantId.asText())) codeValues.put(tenantId.asText(), name.asText()); - String cityName = ulbCityNamesMappings.get(tenantId.asText()); - if(cityName!=null){ - if(!codeValues.containsKey(tenantId.asText())) codeValues.put(tenantId.asText(), cityName); - } - - - - if(!tenantId.asText().equalsIgnoreCase(TESTING_ID)) { - if(!ddrTenantMapping1.containsKey(ddrName.asText())){ - List tenantList = new ArrayList<>(); - tenantList.add(tenantId.asText()); - ddrTenantMapping1.put(ddrName.asText(),tenantList); - List values = new ArrayList<>(); - //values.add(name.asText()); - if(cityName!=null) values.add(cityName); - ddrValueMap.put(ddrName.asText(), values); - - } else { - ddrTenantMapping1.get(ddrName.asText()).add(tenantId.asText()); - //ddrValueMap.get(ddrName.asText()).add(name.asText()); - if(cityName!=null) ddrValueMap.get(ddrName.asText()).add(cityName); - - } - - if (!ddrTenantMapping.containsKey(ddrCode.asText())){ - ddrTenantMapping.put(ddrCode.asText(), ddrName.asText()); - } - } - - } - } catch (Exception e){ - throw new CustomException("MDMS_ERROR","Failed to fetch DDR's from mdms"); - } - ddrValueMap.entrySet().removeIf(map -> map.getValue().size()==0); - logger.info("ddrValueMap = "+ddrValueMap); - logger.info("codeValues = "+codeValues); - logger.info("ddrTenantMapping1 = "+ddrTenantMapping1); - - } - - public String getDDRNameByCode(String ddrCode){ - return ddrTenantMapping.getOrDefault(ddrCode, ""); - } - - public List getTenantIds(String ddrCode){ - return ddrTenantMapping1.getOrDefault(ddrCode, new ArrayList<>()); - } - - public String getDDRName(String tenantId){ - - for(Map.Entry entry : isTranslate ? ddrValueMap.entrySet() :ddrTenantMapping1.entrySet()){ - List values = (List) entry.getValue(); - if(values.contains(tenantId)) return entry.getKey().toString(); - - } - return null; - - } - - public Map> getGroupedTenants(List tenants){ - - Map> groupTenantIds = new HashMap<>(); - - if(tenants!=null){ - for(String tenant : tenants) { - - String ddrName = getDDRName(tenant); - if(ddrName!=null){ - if (groupTenantIds.containsKey(ddrName)){ - groupTenantIds.get(ddrName).add(tenant); - - } else { - List tenantList = new ArrayList<>(); - tenantList.add(tenant); - groupTenantIds.put(ddrName,tenantList); - } - } - - - } - } - - return groupTenantIds; - } - - - public Map> getAll(){ - return isTranslate ? ddrValueMap : ddrTenantMapping1; - } - - - -} - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsService.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsService.java deleted file mode 100644 index c6150de6468..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsService.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.tarento.analytics.org.service; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.service.impl.RestService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import javax.annotation.PostConstruct; -import java.util.HashMap; -import java.util.Map; - -import static com.tarento.analytics.constant.Constants.MDMS_REQUESTINFO; -import static com.tarento.analytics.constant.Constants.TENANTID_PLACEHOLDER; - -@Component -public class MdmsService { - - private static Logger logger = LoggerFactory.getLogger(MdmsService.class); - - private Map ddrTenantMapping = new HashMap<>(); - - @Value("${egov.mdms.host}") - private String mdmsServiceHost; - - @Value("${egov.mdms.search.endpoint}") - private String mdmsSearchEndpoint; - - @Autowired - private RestService restService; - - @Autowired - private ObjectMapper mapper; - - @Value("${egov.statelevel.tenantId}") - private String stateLevelTenantId ; - - @PostConstruct - public void loadMdmsService() throws Exception{ - - String REQUEST_INFO_STR = MDMS_REQUESTINFO.replace(TENANTID_PLACEHOLDER,stateLevelTenantId); - JsonNode requestInfo = mapper.readTree(REQUEST_INFO_STR); - try { - JsonNode response = restService.post(mdmsServiceHost + mdmsSearchEndpoint, "", requestInfo); - ArrayNode tenants = (ArrayNode) response.findValues(Constants.MDMSKeys.TENANTS).get(0); - - - for(JsonNode tenant : tenants) { - JsonNode ddrCode = tenant.findValue(Constants.MDMSKeys.DISTRICT_CODE); - JsonNode ddrName = tenant.findValue(Constants.MDMSKeys.DDR_NAME); - - if (!ddrTenantMapping.containsKey(ddrCode.asText())){ - ddrTenantMapping.put(ddrCode.asText(), ddrName.asText()); - } - } - } catch (Exception e){ - getDefaultMapping(); - logger.error("Loading Mdms service error: "+e.getMessage()+" :: loaded default DDRs"); - } - logger.info("ddrTenantMapping = "+ddrTenantMapping); - } - - public String getDDRNameByCode(String ddrCode){ - return ddrTenantMapping.getOrDefault(ddrCode, ""); - } - - private void getDefaultMapping(){ - - ddrTenantMapping.put("1", "Amritsar-DDR"); - ddrTenantMapping.put("2", "Patiala-DDR"); - ddrTenantMapping.put("3", "Bathinda-DDR"); - ddrTenantMapping.put("4", "Ferozepur-DDR"); - ddrTenantMapping.put("5", "Ludhiana-DDR"); - ddrTenantMapping.put("6", "Ferozepur-DDR"); - ddrTenantMapping.put("7", "Ferozepur-DDR"); - ddrTenantMapping.put("8", "Amritsar-DDR"); - ddrTenantMapping.put("9", "Jalandhar-DDR"); - ddrTenantMapping.put("10", "Jalandhar-DDR"); - - ddrTenantMapping.put("11", "Jalandhar-DDR"); - ddrTenantMapping.put("12", "Ludhiana-DDR"); - ddrTenantMapping.put("13", "Bathinda-DDR"); - ddrTenantMapping.put("14", "Ferozepur-DDR"); - ddrTenantMapping.put("15", "Patiala-DDR"); - ddrTenantMapping.put("16", "Bathinda-DDR"); - ddrTenantMapping.put("17", "Jalandhar-DDR"); - ddrTenantMapping.put("18", "Pathankot-MC"); - ddrTenantMapping.put("19", "Patiala-DDR"); - ddrTenantMapping.put("20", "Ludhiana-DDR"); - ddrTenantMapping.put("21", "Patiala-DDR"); - ddrTenantMapping.put("22", "Bathinda-DDR"); - ddrTenantMapping.put("140001", "Ludhiana-DDR"); - - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsServiceImpl.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsServiceImpl.java deleted file mode 100644 index f58a22a5058..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/MdmsServiceImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.tarento.analytics.org.service; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.dto.*; -import com.tarento.analytics.enums.ChartType; -import com.tarento.analytics.exception.AINException; -import com.tarento.analytics.handler.IResponseHandler; -import com.tarento.analytics.handler.ResponseHandlerFactory; -import com.tarento.analytics.service.QueryService; -import com.tarento.analytics.service.impl.RestService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Component; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -@Component -public class MdmsServiceImpl implements ClientService { - - public static final Logger logger = LoggerFactory.getLogger(MdmsServiceImpl.class); - - @Autowired - private QueryService queryService; - - @Autowired - private RestService restService; - - @Autowired - private ConfigurationLoader configurationLoader; - - @Autowired - private ResponseHandlerFactory responseHandlerFactory; - - @Autowired - private MdmsApiMappings mdmsApiMappings; - - Map> groupTenantIds; - - @Override - @Cacheable(value="versions", key="#request.hashKey") - public AggregateDto getAggregatedData(AggregateRequestDto request, List roles) throws AINException, IOException { - // Read visualization Code - String chartId = request.getVisualizationCode(); - logger.info("chartId >> "+chartId); - - // Load Chart API configuration to Object Node for easy retrieval later - ObjectNode node = configurationLoader.get(Constants.ConfigurationFiles.CHART_API_CONFIG); - logger.info("conf node >> "+node); - - ObjectNode chartNode = (ObjectNode) node.get(chartId); - logger.info("chartNode >> "+chartNode); - boolean isHandle = preHandle(request, chartNode, mdmsApiMappings); - mdmsApiMappings.setTranslate(isHandle); - - ChartType chartType = ChartType.fromValue(chartNode.get(Constants.JsonPaths.CHART_TYPE).asText()); - groupTenantIds = mdmsApiMappings.getGroupedTenants((List) request.getFilters().get("tenantId")); - - - ObjectNode reponseNode = buildResponse(chartNode, request); - - //replacing default values by - request.setChartNode(chartNode); - IResponseHandler responseHandler = responseHandlerFactory.getInstance(chartType); - AggregateDto aggregateDto = new AggregateDto(); - if (reponseNode.fields().hasNext()) { - - aggregateDto = responseHandler.translate(request, reponseNode); - } - return aggregateDto; - } - - public ObjectNode buildResponse(ObjectNode chartNode, AggregateRequestDto request) { - - String plotName = chartNode.get("plotLabel") == null ? "DDR" : chartNode.get("plotLabel").asText(); - ChartType chartType = ChartType.fromValue(chartNode.get(Constants.JsonPaths.CHART_TYPE).asText()); - boolean isDefaultPresent = chartType.equals(ChartType.LINE) && chartNode.get(Constants.JsonPaths.INTERVAL) != null; - boolean isRequestContainsInterval = null == request.getRequestDate() ? false : (request.getRequestDate().getInterval() != null && !request.getRequestDate().getInterval().isEmpty()); - String interval = isRequestContainsInterval ? request.getRequestDate().getInterval() : (isDefaultPresent ? chartNode.get(Constants.JsonPaths.INTERVAL).asText() : ""); - - ObjectNode aggrObjectNode = JsonNodeFactory.instance.objectNode(); - ObjectNode nodes = JsonNodeFactory.instance.objectNode(); - - ArrayNode queries = (ArrayNode) chartNode.get(Constants.JsonPaths.QUERIES); - queries.forEach(query -> { - AggregateRequestDto requestDto = request; - - - String module = query.get(Constants.JsonPaths.MODULE).asText(); - if (request.getModuleLevel().equals(Constants.Modules.HOME_REVENUE) || - request.getModuleLevel().equals(Constants.Modules.HOME_SERVICES) || - query.get(Constants.JsonPaths.MODULE).asText().equals(Constants.Modules.COMMON) || - request.getModuleLevel().equals(module)) { - - String indexName = query.get(Constants.JsonPaths.INDEX_NAME).asText(); - // intercept request + _search operation - ObjectNode aggrResponse = aggrResponseBuilder(plotName, requestDto, query, indexName, interval); - if(nodes.has(indexName)) { - indexName = indexName + "_1"; - } - nodes.set(indexName, aggrResponse); - aggrObjectNode.set(Constants.JsonPaths.AGGREGATIONS, nodes); - } - }); - return aggrObjectNode; - } - - - private ObjectNode aggrResponseBuilder(String nodeName, AggregateRequestDto requestDto, JsonNode query, String indexName, String interval) { - - ObjectNode nodes = JsonNodeFactory.instance.objectNode(); - ArrayNode bucket = JsonNodeFactory.instance.arrayNode(); - - if (groupTenantIds.size() == 0) { //no tenantId filter present - bucket = getBuckets(mdmsApiMappings.getAll(), requestDto, query, indexName); - requestDto.getFilters().clear(); - - } else { //comes from global filter - bucket = getBuckets(groupTenantIds, requestDto, query, indexName); - - } - ObjectNode buckets = JsonNodeFactory.instance.objectNode(); - buckets.set("buckets", bucket); - nodes.put(nodeName, buckets); - return nodes; - - } - - private ArrayNode getBuckets(Map> map, AggregateRequestDto requestDto, JsonNode query, String indexName) { - ObjectNode nodes = JsonNodeFactory.instance.objectNode(); - ArrayNode bucket = JsonNodeFactory.instance.arrayNode(); - for (String ddrkey : map.keySet()) { - List tenantIds = map.get(ddrkey); - requestDto.getFilters().put("tenantId", tenantIds); - ObjectNode requestNode = queryService.getChartConfigurationQuery(requestDto, query, indexName, null); - - try { - ObjectNode aggrNode = (ObjectNode) restService.search(indexName, requestNode.toString()); - - if(!ddrkey.equalsIgnoreCase("null")) bucket.add(((ObjectNode) aggrNode.get(Constants.JsonPaths.AGGREGATIONS)).put("key", ddrkey)); - } catch (Exception e) { - logger.error("Encountered an Exception while Executing the Query : " + e.getMessage()); - } - - } - return bucket; - } - - - - @Override - public List getHeaderData(CummulativeDataRequestDto requestDto, List roles) throws AINException { - return null; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/TarentoServiceImpl.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/TarentoServiceImpl.java deleted file mode 100644 index 9b41c482dc7..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/org/service/TarentoServiceImpl.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.tarento.analytics.org.service; - -import java.io.IOException; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.dto.AggregateDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.CummulativeDataRequestDto; -import com.tarento.analytics.dto.DashboardHeaderDto; -import com.tarento.analytics.dto.RoleDto; -import com.tarento.analytics.enums.ChartType; -import com.tarento.analytics.exception.AINException; -import com.tarento.analytics.handler.IResponseHandler; -import com.tarento.analytics.handler.InsightsHandler; -import com.tarento.analytics.handler.InsightsHandlerFactory; -import com.tarento.analytics.handler.ResponseHandlerFactory; -import com.tarento.analytics.model.InsightsConfiguration; -import com.tarento.analytics.service.QueryService; -import com.tarento.analytics.service.impl.RestService; -import com.tarento.analytics.utils.ResponseRecorder; - - -@Component -public class TarentoServiceImpl implements ClientService { - - public static final Logger logger = LoggerFactory.getLogger(TarentoServiceImpl.class); - - ObjectMapper mapper = new ObjectMapper(); - char insightPrefix = 'i'; - - - @Autowired - private QueryService queryService; - - @Autowired - private RestService restService; - - @Autowired - private ConfigurationLoader configurationLoader; - - @Autowired - private ResponseHandlerFactory responseHandlerFactory; - - @Autowired - private InsightsHandlerFactory insightsHandlerFactory; - - @Autowired - private MdmsApiMappings mdmsApiMappings; - - - @Override - @Cacheable(value="versions", key="#request.hashKey") - public AggregateDto getAggregatedData(AggregateRequestDto request, List roles) throws AINException, IOException { - // Read visualization Code - String internalChartId = request.getVisualizationCode(); - ObjectNode aggrObjectNode = JsonNodeFactory.instance.objectNode(); - ObjectNode insightAggrObjectNode = JsonNodeFactory.instance.objectNode(); - ObjectNode nodes = JsonNodeFactory.instance.objectNode(); - ObjectNode insightNodes = JsonNodeFactory.instance.objectNode(); - Boolean continueWithInsight = Boolean.FALSE; - - //TODO should be remove temporary fix for national dashboard - Map filters = request.getFilters(); - if( filters != null && filters.get("ulb") != null) { - filters.put("tenantId", filters.get("ulb")); - } - - - // Load Chart API configuration to Object Node for easy retrieval later - ObjectNode node = configurationLoader.get(Constants.ConfigurationFiles.CHART_API_CONFIG); - ObjectNode chartNode = (ObjectNode) node.get(internalChartId); - InsightsConfiguration insightsConfig = null; - if(chartNode.get(Constants.JsonPaths.INSIGHT) != null) { - insightsConfig = mapper.treeToValue(chartNode.get(Constants.JsonPaths.INSIGHT), InsightsConfiguration.class); - } - ChartType chartType = ChartType.fromValue(chartNode.get(Constants.JsonPaths.CHART_TYPE).asText()); - boolean isDefaultPresent = chartType.equals(ChartType.LINE) && chartNode.get(Constants.JsonPaths.INTERVAL)!=null; - boolean isRequestContainsInterval = null == request.getRequestDate() ? false : (request.getRequestDate().getInterval()!=null && !request.getRequestDate().getInterval().isEmpty()) ; - String interval = isRequestContainsInterval? request.getRequestDate().getInterval(): (isDefaultPresent ? chartNode.get(Constants.JsonPaths.INTERVAL).asText():""); - - executeConfiguredQueries(chartNode, aggrObjectNode, nodes, request, interval); - request.setChartNode(chartNode); - ResponseRecorder responseRecorder = new ResponseRecorder(); - request.setResponseRecorder(responseRecorder); - - IResponseHandler responseHandler = responseHandlerFactory.getInstance(chartType); - AggregateDto aggregateDto = new AggregateDto(); - if(aggrObjectNode.fields().hasNext()){ - aggregateDto = responseHandler.translate(request, aggrObjectNode); - } - - if(insightsConfig != null && StringUtils.isNotBlank(insightsConfig.getInsightInterval())) { - continueWithInsight = getInsightsDate(request, insightsConfig.getInsightInterval()); - if(continueWithInsight) { - String insightVisualizationCode = insightPrefix + request.getVisualizationCode(); - request.setVisualizationCode(insightVisualizationCode); - /* - Data is fetched with updated RequestDates (updated in getInsightsDate which subtracted one interval from the dates) - * - * */ - executeConfiguredQueries(chartNode, insightAggrObjectNode, insightNodes, request, interval); - - request.setChartNode(chartNode); - responseHandler = responseHandlerFactory.getInstance(chartType); - if(insightAggrObjectNode.fields().hasNext()){ - responseHandler.translate(request, insightAggrObjectNode); - } - InsightsHandler insightsHandler = insightsHandlerFactory.getInstance(chartType); - aggregateDto = insightsHandler.getInsights(aggregateDto, request.getVisualizationCode(), request.getModuleLevel(), insightsConfig,request.getResponseRecorder()); - } - } - - return aggregateDto; - } - - /** - * Executes queries and enriches the respons in aggrObjectNode - * @param chartNode The Chart Config defined in ChartApiConfig.json - * @param aggrObjectNode Object in which response is enriched - * @param nodes Don't know why passed as argument should have been defined in function itself - * @param request The API request - * @param interval Interval ( eg: Month) defines in RequestDate in AggregateRequestDto noot needed as seperate argument as it can - * be fetched from AggregateRequestDto - */ - private void executeConfiguredQueries(ObjectNode chartNode, ObjectNode aggrObjectNode, ObjectNode nodes, AggregateRequestDto request, String interval) { - preHandle(request, chartNode, mdmsApiMappings); - - ArrayNode queries = (ArrayNode) chartNode.get(Constants.JsonPaths.QUERIES); - int randIndexCount = 1; - for(JsonNode query : queries) { - String module = query.get(Constants.JsonPaths.MODULE).asText(); - if(request.getModuleLevel().equals(Constants.Modules.HOME_REVENUE) || - request.getModuleLevel().equals(Constants.Modules.HOME_SERVICES) || - query.get(Constants.JsonPaths.MODULE).asText().equals(Constants.Modules.COMMON) || - request.getModuleLevel().equals(module)) { - - String indexName = query.get(Constants.JsonPaths.INDEX_NAME).asText(); - ObjectNode objectNode = queryService.getChartConfigurationQuery(request, query, indexName, interval); - try { - JsonNode aggrNode = restService.search(indexName,objectNode.toString()); - if(nodes.has(indexName)) { - indexName = indexName + "_" + randIndexCount; - randIndexCount += 1; - } - nodes.set(indexName,aggrNode.get(Constants.JsonPaths.AGGREGATIONS)); - }catch (Exception e) { - logger.error("Encountered an Exception while Executing the Query : " + e.getMessage()); - throw new RuntimeException(e); - } - aggrObjectNode.set(Constants.JsonPaths.AGGREGATIONS, nodes); - - } - } - } - - /** - * Updates the RequestDate for insight data - * @param request - * @param insightInterval - * @return - */ - private Boolean getInsightsDate(AggregateRequestDto request, String insightInterval) { - Long daysBetween = daysBetween(Long.parseLong(request.getRequestDate().getStartDate()), - Long.parseLong(request.getRequestDate().getEndDate())); - if(insightInterval.equals(Constants.Interval.month.toString()) && daysBetween > 32) { - return Boolean.FALSE; - } - if(insightInterval.equals(Constants.Interval.week.toString()) && daysBetween > 8) { - return Boolean.FALSE; - } - if(insightInterval.equals(Constants.Interval.year.toString()) && daysBetween > 366) { - return Boolean.FALSE; - } - Calendar startCal = Calendar.getInstance(); - Calendar endCal = Calendar.getInstance(); - startCal.setTime(new Date(Long.parseLong(request.getRequestDate().getStartDate()))); - endCal.setTime(new Date(Long.parseLong(request.getRequestDate().getEndDate()))); - if(insightInterval.equals(Constants.Interval.month.toString())) { - startCal.add(Calendar.MONTH, -1); - endCal.add(Calendar.MONTH, -1); - } else if(insightInterval.equals(Constants.Interval.week.toString())) { - startCal.add(Calendar.WEEK_OF_YEAR, -1); - endCal.add(Calendar.WEEK_OF_YEAR, -1); - } else if(StringUtils.isBlank(insightInterval) || insightInterval.equals(Constants.Interval.year.toString())) { - startCal.add(Calendar.YEAR, -1); - endCal.add(Calendar.YEAR, -1); - } - request.getRequestDate().setStartDate(String.valueOf(startCal.getTimeInMillis())); - request.getRequestDate().setEndDate(String.valueOf(endCal.getTimeInMillis())); - return Boolean.TRUE; - } - - public long daysBetween(Long start, Long end) { - return TimeUnit.MILLISECONDS.toDays(Math.abs(end - start)); - } - - - - @Override - public List getHeaderData(CummulativeDataRequestDto requestDto, List roles) throws AINException { - // TODO Auto-generated method stub - return null; - } - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/Aggregation.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/Aggregation.java deleted file mode 100644 index b7f4c8a28d8..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/Aggregation.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.tarento.analytics.query.model; - -public class Aggregation { - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/Query.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/Query.java deleted file mode 100644 index d48b10b25da..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/Query.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.tarento.analytics.query.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class Query { - - @JsonProperty("x_axis") - public XAxis xAxis; - - @JsonProperty("y_axis") - public YAxis yAxis; - - public XAxis getxAxis() { - return xAxis; - } - - public void setxAxis(XAxis xAxis) { - this.xAxis = xAxis; - } - - public YAxis getyAxis() { - return yAxis; - } - - public void setyAxis(YAxis yAxis) { - this.yAxis = yAxis; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/XAxis.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/XAxis.java deleted file mode 100644 index e7b5a9bed83..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/XAxis.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.tarento.analytics.query.model; - -import java.util.Map; - -public class XAxis { - - public Map aggregation; - - public Map getAggregation() { - return aggregation; - } - - public void setAggregation(Map aggregation) { - this.aggregation = aggregation; - } - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/YAxis.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/YAxis.java deleted file mode 100644 index e44af59a16b..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/query/model/YAxis.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.tarento.analytics.query.model; - -import java.util.Map; - -public class YAxis { - - Map aggregation; - - public Map getAggregation() { - return aggregation; - } - - public void setAggregation(Map aggregation) { - this.aggregation = aggregation; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/repository/ElasticSearchRepository.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/repository/ElasticSearchRepository.java deleted file mode 100644 index 4da1f8de971..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/repository/ElasticSearchRepository.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.tarento.analytics.repository; - -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.HttpServerErrorException; -import org.springframework.web.client.RestTemplate; - -import com.tarento.analytics.dto.MappingDto; -import com.tarento.analytics.model.Transaction; - -/** - * This Repository Class is used to perform the transactions of storing the data into the Elastic Search Repository - * @author Darshan Nagesh - * - */ -@Service -public class ElasticSearchRepository { - - public static final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchRepository.class); - - private final RestTemplate restTemplate; - - public ElasticSearchRepository(RestTemplate restTemplate) { - this.restTemplate = restTemplate; - } - - /** - * Based on the Transaction Index Data Obtained and the URL with Headers, this method will put the Data obtained on the - * Elastic Search Database and returns the response in the form of Positive or Negative outcome (True Or False) - * @param transactionIndex - * @param url - * @param headers - * @return - */ - public Boolean saveTransaction(Transaction transaction, String url, HttpHeaders headers) { - ResponseEntity map = null; - try { - map = restTemplate.exchange(url, HttpMethod.PUT, - new HttpEntity<>(transaction, headers), Map.class); - } catch (final HttpClientErrorException httpClientErrorException) { - LOGGER.error("Error : " + httpClientErrorException); - } catch (HttpServerErrorException httpServerErrorException) { - LOGGER.error("Error : " + httpServerErrorException); - } catch (Exception e) { - LOGGER.error("Error : " + e); - } - if (map != null && map.getStatusCode() != null && (map.getStatusCode() == HttpStatus.OK) || (map.getStatusCode() == HttpStatus.CREATED)) { - return true; - } - return false; - } - - - - // create index - public Boolean createTransactionIndex(MappingDto dto, String url, HttpHeaders headers){ - ResponseEntity map = null; - try { - LOGGER.info("Each Channel Content : " + dto.toString()); - map = restTemplate.exchange(url, HttpMethod.PUT, - new HttpEntity<>(dto, headers), Map.class); - } catch (final HttpClientErrorException httpClientErrorException) { - LOGGER.error("Error : " + httpClientErrorException); - } catch (HttpServerErrorException httpServerErrorException) { - LOGGER.error("Error : " + httpServerErrorException); - } catch (Exception e) { - LOGGER.error("Error : " + e); - } - if (map != null && map.getStatusCode() != null && (map.getStatusCode() == HttpStatus.OK) || (map.getStatusCode() == HttpStatus.CREATED)) { - return true; - } - return false; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/AmazonS3ClientService.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/AmazonS3ClientService.java deleted file mode 100644 index 1ebda9f0d97..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/AmazonS3ClientService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.tarento.analytics.service; - -import org.springframework.web.multipart.MultipartFile; - -public interface AmazonS3ClientService -{ - String uploadFileToS3Bucket(MultipartFile multipartFile, boolean enablePublicReadAccess); - - void deleteFileFromS3Bucket(String fileName); -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/MetadataService.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/MetadataService.java deleted file mode 100644 index 5a2c1c530e8..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/MetadataService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.tarento.analytics.service; - -import java.io.IOException; -import java.util.List; - -import org.json.JSONArray; - -import com.tarento.analytics.dto.RoleDto; -import com.tarento.analytics.exception.AINException; - -public interface MetadataService { - - public Object getDashboardConfiguration(String dashboardId, String catagory, List roleIds) throws AINException, IOException; - public JSONArray getTargetDistrict() throws Exception ; - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/QueryService.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/QueryService.java deleted file mode 100644 index bc97d7582c8..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/QueryService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.tarento.analytics.service; - -import java.io.IOException; - -import org.elasticsearch.search.aggregations.Aggregations; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.exception.AINException; - -public interface QueryService { -/* - List getAggregateData(AggregateRequestDto aggregateDto, String orgId) throws AINException; -*/ - public static final String API_CONFIG_JSON = "ChartApiConfig.json"; - public static final String DATE_SOURCE_FIELD = "dateSourceField"; - public static final String AGG_QUERY_JSON = "aggregationQueryJson"; - public static final String INDEX_NAME = "indexName" ; - public static final String DOCUMENT_TYPE = "documentType"; -/* Aggregations getAggregateData(AggregateRequestDto aggregateDto, String orgId) throws AINException; - Aggregations getAggregateDataV2(AggregateRequestDtoV2 aggregateDto, String orgId) throws AINException, JsonParseException, JsonMappingException, IOException; - */ - ObjectNode getChartConfigurationQuery(AggregateRequestDto req, JsonNode query, String indexName, String interval); - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/AmazonS3ClientServiceImpl.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/AmazonS3ClientServiceImpl.java deleted file mode 100644 index 626eb48a82a..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/AmazonS3ClientServiceImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.tarento.analytics.service.impl; - -import com.amazonaws.AmazonServiceException; -import com.amazonaws.auth.AWSCredentialsProvider; -import com.amazonaws.regions.Region; -import com.amazonaws.services.s3.AmazonS3; -import com.amazonaws.services.s3.AmazonS3ClientBuilder; -import com.amazonaws.services.s3.model.CannedAccessControlList; -import com.amazonaws.services.s3.model.DeleteObjectRequest; -import com.amazonaws.services.s3.model.PutObjectRequest; -import com.tarento.analytics.model.AmazonS3Config; -import com.tarento.analytics.service.AmazonS3ClientService; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.springframework.web.multipart.MultipartFile; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Date; - -@Component -public class AmazonS3ClientServiceImpl implements AmazonS3ClientService -{ - - @Value("${filename.length}") - private Integer filenameLength; - - @Value("${filename.useletters}") - private Boolean useLetters; - - @Value("${filename.usenumbers}") - private Boolean useNumbers; - - - @Autowired - private AmazonS3Config amazonS3Config; - private String awsS3AudioBucket; - private AmazonS3 amazonS3; - private static final Logger logger = LoggerFactory.getLogger(AmazonS3ClientServiceImpl.class); - - @Autowired - public AmazonS3ClientServiceImpl(Region awsRegion, AWSCredentialsProvider awsCredentialsProvider, String awsS3AudioBucket) - { - this.amazonS3 = AmazonS3ClientBuilder.standard() - .withCredentials(awsCredentialsProvider) - .withRegion(awsRegion.getName()).build(); - this.awsS3AudioBucket = awsS3AudioBucket; - } - - @Async - public String uploadFileToS3Bucket(MultipartFile multipartFile, boolean enablePublicReadAccess) - { - String orignalFileName = multipartFile.getOriginalFilename(); - String imageURL = ""; - FileOutputStream fos = null; - try { - - String randomString = RandomStringUtils.random(filenameLength, useLetters, useNumbers); - String imagetype = FilenameUtils.getExtension(orignalFileName); - String fileName = System.currentTimeMillis() + randomString + "." +imagetype; - //creating the file in the server (temporarily) - File file = new File(fileName); - fos = new FileOutputStream(file); - - fos.write(multipartFile.getBytes()); - - PutObjectRequest putObjectRequest = new PutObjectRequest(this.awsS3AudioBucket, fileName, file); - - if (enablePublicReadAccess) { - putObjectRequest.withCannedAcl(CannedAccessControlList.PublicRead); - } - this.amazonS3.putObject(putObjectRequest); - - imageURL = String.valueOf(amazonS3.getUrl( - amazonS3Config.getAWSS3AudioBucket(), //The S3 Bucket To Upload To - file.getName())); - //removing the file created in the server - file.delete(); - } catch (IOException | AmazonServiceException ex) { - logger.error("error [" + ex.getMessage() + "] occurred while uploading [" + orignalFileName + "] "); - }finally { - try { - fos.close(); - } catch (IOException e) { - logger.error("Error occured while closing file output stream."); - } - } - return imageURL; - - } - - @Async - public void deleteFileFromS3Bucket(String fileName) - { - try { - amazonS3.deleteObject(new DeleteObjectRequest(awsS3AudioBucket, fileName)); - } catch (AmazonServiceException ex) { - logger.error("error [" + ex.getMessage() + "] occurred while removing [" + fileName + "] "); - } - } -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/MetadataServiceImpl.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/MetadataServiceImpl.java deleted file mode 100644 index 109cc09c409..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/MetadataServiceImpl.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.tarento.analytics.service.impl; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.net.URI; -import java.util.*; - -import com.tarento.analytics.constant.Constants; -import org.json.JSONArray; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.gson.Gson; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.dto.RoleDto; -import com.tarento.analytics.dto.Tenants; -import com.tarento.analytics.exception.AINException; -import com.tarento.analytics.service.MetadataService; - -@Service("metadataService") -public class MetadataServiceImpl implements MetadataService { - - public static final Logger logger = LoggerFactory.getLogger(MetadataServiceImpl.class); - - @Autowired - private ConfigurationLoader configurationLoader; - - @Autowired - private ObjectMapper objectMapper; - - @Autowired - private RestTemplate restTemplate; - - @Value("${egov.mdms.host}") - private String mdmsServiceHost; - - @Value("${egov.mdms.search.endpoint}") - private String mdmsSearchEndpoint; - - @Override - public ArrayNode getDashboardConfiguration(String dashboardId, String catagory, List roleIds) throws AINException, IOException { - - Calendar cal = Calendar.getInstance(); - cal.set(cal.getWeekYear()-1, Calendar.APRIL, 1); - Date startDate = cal.getTime(); - Date endDate = new Date(); - - String fyInfo = "From " + Constants.DASHBOARD_DATE_FORMAT.format(startDate) + " to " + Constants.DASHBOARD_DATE_FORMAT.format(endDate); - - - ObjectNode dashBoardNode = configurationLoader.get(ConfigurationLoader.MASTER_DASHBOARD_CONFIG); - ArrayNode dasboardNodes = (ArrayNode) dashBoardNode.findValue(Constants.DashBoardConfig.DASHBOARDS); - - ObjectNode roleMappingNode = configurationLoader.get(ConfigurationLoader.ROLE_DASHBOARD_CONFIG); - ArrayNode rolesArray = (ArrayNode) roleMappingNode.findValue(Constants.DashBoardConfig.ROLES); - ArrayNode dbArray = JsonNodeFactory.instance.arrayNode(); - for(JsonNode role: rolesArray){ - logger.info("role name: " + role.get("roleName")); - logger.info("role ID: " + role.get("roleId")); - String roleId = role.get("roleId").asText(); - - //Object roleId = roleIds.stream().filter(x -> role.get(Constants.DashBoardConfig.ROLE_ID).asLong() == (x.getId())).findAny().orElse(null); - if (null != roleId) { - ArrayNode visArray = JsonNodeFactory.instance.arrayNode(); - for(JsonNode db : role.get(Constants.DashBoardConfig.DASHBOARDS)){ - ObjectNode copyDashboard = objectMapper.createObjectNode(); - - JsonNode name = JsonNodeFactory.instance.textNode(""); - JsonNode id = JsonNodeFactory.instance.textNode(""); - JsonNode title = JsonNodeFactory.instance.textNode(fyInfo); - if (db.get(Constants.DashBoardConfig.ID).asText().equalsIgnoreCase(dashboardId)) { - //dasboardNodes.forEach(dbNode -> { - for(JsonNode dbNode : dasboardNodes){ - if (dbNode.get(Constants.DashBoardConfig.ID).asText().equalsIgnoreCase(dashboardId)) { - logger.info("dbNode: " + dbNode); - name = dbNode.get(Constants.DashBoardConfig.NAME); - id = dbNode.get(Constants.DashBoardConfig.ID); - - if (catagory != null) { - dbNode.get(Constants.DashBoardConfig.VISUALISATIONS).forEach(visual -> { - if (visual.get(Constants.DashBoardConfig.NAME).asText().equalsIgnoreCase(catagory)) - visArray.add(visual); - }); - } else { - dbNode.get(Constants.DashBoardConfig.VISUALISATIONS).forEach(visual -> { - visArray.add(visual); - }); - } - } - copyDashboard.set(Constants.DashBoardConfig.NAME, name); - copyDashboard.set(Constants.DashBoardConfig.ID, id); - //add TITLE with varible dynamically - copyDashboard.set(Constants.DashBoardConfig.TITLE, title); - - copyDashboard.set(Constants.DashBoardConfig.VISUALISATIONS, visArray); - copyDashboard.set("roleId", role.get("roleId")); - copyDashboard.set("roleName", role.get("roleName")); - - }//); - dbArray.add(copyDashboard); - } - } - - } - } - - return dbArray; - } - -/* @Override - public ArrayNode getDashboardConfiguration(String dashboardId, String catagory, List roleIds) throws AINException, IOException { - - ObjectNode configNode = configurationLoader.get(ConfigurationLoader.ROLE_DASHBOARD_CONFIG); - ArrayNode rolesArray = (ArrayNode) configNode.findValue("roles"); - ArrayNode dbArray = JsonNodeFactory.instance.arrayNode(); - - rolesArray.forEach(role -> { - Object roleId = roleIds.stream().filter(x -> role.get("roleId").asLong() == (x.getId())).findAny().orElse(null); - System.out.println("roleId = "+roleId); - - if (null != roleId) { - role.get("dashboards").forEach(dashboard -> { - ObjectNode copyDashboard = dashboard.deepCopy(); - ArrayNode visArray = JsonNodeFactory.instance.arrayNode(); - if(catagory != null) { - copyDashboard.get("visualizations").forEach(visual ->{ - if(visual.get("name").asText().equalsIgnoreCase(catagory)){ - visArray.add(visual); - } - }); - copyDashboard.set("visualizations", visArray); - } - if(dashboard.get("id").asText().equalsIgnoreCase(dashboardId)){ - dbArray.add(copyDashboard); - } - }); - } - }); - - //List dbs = objectMapper.readValue(dbArray.toString(), new TypeReference>() {}); - return dbArray; - }*/ - - public JSONArray getTargetDistrict() throws Exception { - final String baseUrl = mdmsServiceHost + mdmsSearchEndpoint; - URI uri = new URI(baseUrl); - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity requestEntity = new HttpEntity<>("{}", headers); - ResponseEntity response = restTemplate.exchange(uri, HttpMethod.POST, requestEntity, String.class); - String targetdistrict = response.getBody(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode jsonNode = objectMapper.readTree(targetdistrict); - ArrayNode array = (ArrayNode) jsonNode.at("/MdmsRes/tenant/tenants"); - - File getFile = new File( - System.getProperty("user.dir") + System.getProperty("file.separator") + "data/tenants.json"); - BufferedReader br = null; - Tenants sample = null; - try{ - br = new BufferedReader(new FileReader(getFile)); - sample = new Gson().fromJson(br, Tenants.class); - }catch (Exception e){ - logger.info("Error occured while reading tenants file."); - }finally{ - br.close(); - } - JSONArray jsonArray = new JSONArray(); - Map> mapDistrictUlb = new HashMap(); - Map DistrictMap = new HashMap(); - for (int i = 0; i < sample.getTenants().size(); i++) { - String ulbCode = sample.getTenants().get(i).getCode(); - String ulbName = sample.getTenants().get(i).getName(); - String districtName = sample.getTenants().get(i).getCity().getDistrictName(); - String districtCode = sample.getTenants().get(i).getCity().getDistrictCode(); - Map mapUlb = new HashMap(); - Map mapDist = new LinkedHashMap(); - Map mapDistAll = new LinkedHashMap(); - mapDist.put("District Name", districtName); - mapDist.put("District Code", districtCode); - mapUlb.put("Ulb Name", ulbName); - mapUlb.put("tenantId", ulbCode); - mapDistAll.put(districtCode, new JSONObject(mapDist)); - DistrictMap.put(districtCode.toString(), mapDist); - if (mapDistrictUlb.containsKey(districtCode.toString())) { - mapDistrictUlb.get(districtCode.toString()).add(mapUlb); - } else { - List lst = new ArrayList(); - lst.add(mapUlb); - mapDistrictUlb.put(districtCode.toString(), lst); - } - } - for (Map.Entry entry1 : DistrictMap.entrySet()) { - JSONObject getdistrictJson = new JSONObject(); - for (Map.Entry> entry2 : mapDistrictUlb.entrySet()) { - if (entry1.getKey().equals(entry2.getKey())) { - JSONObject getUlbtoDistrict = new JSONObject(); - getdistrictJson.put(entry1.getKey(), entry1.getValue()); - String json = new Gson().toJson(entry1.getValue(), LinkedHashMap.class); - getUlbtoDistrict.put(entry1.getKey(), new JSONObject(json).accumulate("Ulb", entry2.getValue())); - jsonArray.put(getUlbtoDistrict); - } - } - } - return jsonArray; - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/QueryServiceImpl.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/QueryServiceImpl.java deleted file mode 100644 index aa7933190bd..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/QueryServiceImpl.java +++ /dev/null @@ -1,464 +0,0 @@ -package com.tarento.analytics.service.impl; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.elasticsearch.action.search.MultiSearchResponse; -import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.search.aggregations.Aggregation; -import org.elasticsearch.search.aggregations.Aggregations; -import org.elasticsearch.search.aggregations.bucket.terms.ParsedLongTerms; -import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.aggregations.metrics.avg.ParsedAvg; -import org.elasticsearch.search.aggregations.metrics.sum.ParsedSum; -import org.elasticsearch.search.aggregations.metrics.valuecount.ParsedValueCount; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.tarento.analytics.ConfigurationLoader; -import com.tarento.analytics.constant.Constants; -import com.tarento.analytics.dao.ElasticSearchDao; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.dto.AggregateRequestDto; -import com.tarento.analytics.enums.ChartType; -import com.tarento.analytics.exception.AINException; -import com.tarento.analytics.model.ElasticSearchDictator; -import com.tarento.analytics.model.KeyData; -import com.tarento.analytics.model.Query; -import com.tarento.analytics.model.ServiceQuery; -import com.tarento.analytics.service.QueryService; -import com.tarento.analytics.utils.ElasticProperties; - -@Component -public class QueryServiceImpl implements QueryService { - - public static final Logger logger = LoggerFactory.getLogger(QueryServiceImpl.class); -/* - @Autowired - private MetadataDao metaDataDao;*/ - - @Autowired - private ElasticSearchDao elasticSearchDao; - -/* - @Autowired - private DecoratorService decoratorService; - -*/ - @Autowired - private ConfigurationLoader configurationLoader; - - private static final Map WeekDayMap = createMap(); - - private static Map createMap() { - Map result = new HashMap(); - result.put(1, "SUN"); - result.put(2, "MON"); - result.put(3, "TUE"); - result.put(4, "WED"); - result.put(5, "THU"); - result.put(6, "FRI"); - result.put(7, "SAT"); - - return Collections.unmodifiableMap(result); - } - -/* - @Override - public Aggregations getAggregateData(AggregateRequestDto aggregateDto, String orgId) throws AINException { - - //public List getAggregateData(AggregateRequestDto aggregateDto, String orgId) throws AINException { - Aggregations aggregations = null; - ElasticSearchDictator dictator = null; - ServiceQuery elasticServiceQuery = metaDataDao.getServiceQuery(Long.parseLong(orgId), - aggregateDto.getServiceApi()); - - ObjectMapper mapper = new ObjectMapper(); - */ -/*Map resonseMap = null;*//* - - try { - - //Query Builder - Query queryJson = mapper.readValue(elasticServiceQuery.getQueryJson(), Query.class); - // Set index name and document Type for elastic - Map queryMap = queryJson.getAggregation(); - - //Label Mapping - Map labelMap = new HashMap<>(); - getAggregateLabelRecursively(queryMap,labelMap); - - dictator = elasticSearchDao.createSearchDictator(aggregateDto, elasticServiceQuery.getIndexName(), - elasticServiceQuery.getDocumentType(), queryJson.getDateFilterField()); - dictator.setQueryAggregationMap(queryMap); - SearchRequest searchRequest = elasticSearchDao.buildElasticSearchQuery(dictator); - List searchRequestList = new ArrayList<>(); - searchRequestList.add(searchRequest); - MultiSearchResponse response = elasticSearchDao.executeMultiSearchRequest(searchRequestList, Boolean.TRUE); - SearchResponse searchResponse = response.getResponses()[0].getResponse(); - aggregations = searchResponse.getAggregations(); - */ -/*resonseMap= translateResponse(response, aggregateDto.getChartType(),aggregateDto.getInterval(), labelMap); - decoratorService.getChartData(aggregateDto, chartFormat, chartType, serviceApi, chartCode)*//* - - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return aggregations; - } - - @Override - public Aggregations getAggregateDataV2(AggregateRequestDtoV2 aggregateDto, String orgId) throws AINException, JsonParseException, JsonMappingException, IOException { - Boolean primaryOrNot = Boolean.TRUE; - ServiceQuery elasticServiceQuery = new ServiceQuery(); - String visualizationCode = aggregateDto.getVisualizationCode(); - ObjectNode configNode = configurationLoader.get(API_CONFIG_JSON); - elasticServiceQuery.setIndexName(configNode.get(visualizationCode).get(INDEX_NAME).asText()); - elasticServiceQuery.setDocumentType(configNode.get(visualizationCode).get(DOCUMENT_TYPE).asText()); - elasticServiceQuery.setQueryJson(configNode.get(visualizationCode).get(AGG_QUERY_JSON).asText()); - if(elasticServiceQuery.getIndexName().equals("dss-col-v1")) { - primaryOrNot = Boolean.TRUE; - } else { - primaryOrNot = Boolean.FALSE; - } - ObjectMapper mapper = new ObjectMapper(); - Query queryJson = mapper.readValue(elasticServiceQuery.getQueryJson(), Query.class); - - // Set index name and document Type for elastic - Map queryMap = queryJson.getAggregation(); - - //Label Mapping - Map labelMap = new HashMap<>(); - getAggregateLabelRecursively(queryMap,labelMap); - - Aggregations aggregations = null; - ElasticSearchDictator dictator = null; - - try { - dictator = elasticSearchDao.createSearchDictatorV2(aggregateDto, elasticServiceQuery.getIndexName(), - elasticServiceQuery.getDocumentType(), queryJson.getDateFilterField()); - dictator.setQueryAggregationMap(queryMap); - SearchRequest searchRequest = elasticSearchDao.buildElasticSearchQuery(dictator); - List searchRequestList = new ArrayList<>(); - searchRequestList.add(searchRequest); - MultiSearchResponse response = elasticSearchDao.executeMultiSearchRequest(searchRequestList, primaryOrNot); - SearchResponse searchResponse = response.getResponses()[0].getResponse(); - aggregations = searchResponse.getAggregations(); - } catch (Exception e) { - logger.error("Encountered an error while getting the Aggregated Data : " + e.getMessage()); - } - return aggregations; - } -*/ - -/* private Map translateResponse(MultiSearchResponse response, ChartType chartType, String interval, Map labelMap) { - SearchResponse searchResponse = response.getResponses()[0].getResponse(); - List aggregations = searchResponse.getAggregations().asList(); - Map responseMap = new HashMap<>(); - - if (chartType.equals(ChartType.BAR) || chartType.equals(ChartType.HORIZONTALBAR) - || chartType.equals(ChartType.PIE) || chartType.equals(ChartType.DOUGHNUT)) { - - if (aggregations.get(0) instanceof ParsedLongTerms) { - responseMap = parseParseLongTerms((ParsedLongTerms) aggregations.get(0), chartType, labelMap); - } - } - - return responseMap; - }*/ - - @SuppressWarnings("unchecked") - void getAggregateLabelRecursively(Map queryMap, Map labelMap ){ - try { - if(queryMap.containsKey(ElasticProperties.Query.AGGREGATION_CONDITION.toLowerCase())){ - - Map valueMap =(HashMap)queryMap.get(ElasticProperties.Query.AGGREGATION_CONDITION.toLowerCase()); - getAggregateLabelRecursively(valueMap, labelMap); - } - for (Map.Entry itrQuery : queryMap.entrySet()) { - if(itrQuery.getKey().equals(ElasticProperties.Query.AGGREGATION_CONDITION.toLowerCase())){ - continue; - } - Map propertiesMap = (HashMap)itrQuery.getValue(); - labelMap.put(itrQuery.getKey(), propertiesMap.get(ElasticProperties.Query.LABEL.toLowerCase()).toString()); - } - } catch (Exception e) { - - } - } - /* - * private Map - * parseDateHistogramForMultiLine(List aggregations, ChartType - * chartType, String interval) { Map responseMap = new - * HashMap<>(); - * - * for (Histogram.Bucket bucket : ((ParsedDateHistogram) - * aggregations.get(0)).getBuckets()) { List subAggregations = - * bucket.getAggregations().asList(); if (subAggregations.get(0) instanceof - * ParsedLongTerms) { parseParseLongTermsOnInterval(bucket, chartType, - * interval, responseMap); } - * - * } - * - * return responseMap; - * - * } - */ - - /* - * private Map parseNested(List aggregations, - * ChartType chartType, String interval) { - * - * Map responseMap = new HashMap<>(); for (Aggregation - * aggregationData : ((ParsedNested) aggregations.get(0)).getAggregations()) - * { if (aggregationData instanceof ParsedLongTerms) { responseMap = - * parseParseLongTerms((ParsedLongTerms) aggregationData, chartType, - * interval); } - * - * } return responseMap; - * - * } - */ - - /* - * private Map parseDateHistogram(List - * aggregations, ChartType chartType, String interval) { - * - * Map responseMap = new HashMap<>(); if - * (interval.equals(ElasticSearchConstants.DAY_OF_WEEK)) { Map dayWiseObjectMap = new HashMap() { { put(1, - * null); put(2, null); put(3, null); put(4, null); put(5, null); put(6, - * null); put(7, null); - * - * } }; - * - * for (Histogram.Bucket bucket : ((ParsedDateHistogram) - * aggregations.get(0)).getBuckets()) { Calendar cal = - * Calendar.getInstance(); - * cal.setTimeInMillis(Long.parseLong(bucket.getKeyAsString())); int - * dayofWeek = cal.get(Calendar.DAY_OF_WEEK); - * - * Object val = getAggregationValue(bucket); if - * (dayWiseObjectMap.containsKey(dayofWeek)) { Object dayWiseCount = - * dayWiseObjectMap.get(dayofWeek); if (val instanceof Double) { Double - * doubleValue = 0.0; if (dayWiseCount == null) { doubleValue = 0.0; } else - * { doubleValue = (Double) dayWiseCount; } doubleValue += - * getFormattedDouble((Double) val); dayWiseCount = doubleValue; } else if - * (val instanceof Long) { Long longValue = 0L; if (dayWiseCount == null) { - * longValue = 0L; } else { longValue = (Long) dayWiseCount; } longValue += - * (Long) val; dayWiseCount = longValue; } dayWiseObjectMap.put(dayofWeek, - * dayWiseCount); } else { if (val instanceof Double) { Double doubleValue = - * (Double) val; doubleValue += getFormattedDouble((Double) val); val = - * doubleValue; } dayWiseObjectMap.put(dayofWeek, val); } } for - * (Map.Entry entry : dayWiseObjectMap.entrySet()) { - * - * responseMap.put(WeekDayMap.get(entry.getKey()), (entry.getValue())); } } - * else { for (Histogram.Bucket bucket : ((ParsedDateHistogram) - * aggregations.get(0)).getBuckets()) { List subAggregations = - * bucket.getAggregations().asList(); if (subAggregations.get(0) instanceof - * ParsedLongTerms) { - * - * - * responseMap = parseParseLongTermsOnInterval(bucket, chartType, interval); - * } else { responseMap = parseDateHistogramBasedOnInterval(bucket, - * chartType, interval); } - * - * } } return responseMap; - * - * } - */ - /* - * private void parseParseLongTermsOnInterval(Bucket buckets, ChartType - * chartType, String interval, Map responseMap) { Calendar - * cal = Calendar.getInstance(); - * cal.setTimeInMillis(Long.parseLong(buckets.getKeyAsString())); String key - * = null; if (interval.equals(ElasticSearchConstants.DAY)) { int day = - * cal.get(Calendar.DAY_OF_MONTH); int month = cal.get(Calendar.MONTH) + 1; - * - * key = day + "/" + month; } else if - * (interval.equals(ElasticSearchConstants.HOUR)) { int hour = - * cal.get(Calendar.HOUR_OF_DAY); String suffix = "AM"; if - * (cal.get(Calendar.AM_PM) > 0) suffix = "PM"; - * - * key = String.valueOf(hour + 1) + suffix; - * - * } Map innerResponseMap = new HashMap<>(); - * - * for (Terms.Bucket bucket : ((ParsedLongTerms) buckets).getBuckets()) { - * - * Map valueMap = bucket.getAggregations().getAsMap(); - * Object val = null; - * - * for (Map.Entry aggregation : valueMap.entrySet()) { - * if - * (aggregation.getKey().contains(ElasticProperties.Query.SUM.toLowerCase()) - * ) { ParsedSum sum = (ParsedSum) aggregation.getValue(); val = - * sum.getValue(); } else if - * (aggregation.getKey().contains(ElasticProperties.Query.AVG.toLowerCase()) - * ) { ParsedAvg avg = (ParsedAvg) aggregation.getValue(); val = - * avg.getValue(); - * - * } else if - * (aggregation.getKey().contains(ElasticProperties.Query.COUNT.toLowerCase( - * ))) { ParsedValueCount count = (ParsedValueCount) aggregation.getValue(); - * val = count.getValue(); - * - * } - * - * } innerResponseMap.put(bucket.getKeyAsString(), val); } - * responseMap.put(key, innerResponseMap); - * - * } - */ - - /* - * private Map parseDateHistogramBasedOnInterval(Bucket - * bucket, ChartType chartType, String interval) { Map - * responseMap = new HashMap<>(); Calendar cal = Calendar.getInstance(); - * cal.setTimeInMillis(Long.parseLong(bucket.getKeyAsString())); String key - * = null; Object val = null; if - * (interval.equals(ElasticSearchConstants.DAY)) { int day = - * cal.get(Calendar.DAY_OF_MONTH); int month = cal.get(Calendar.MONTH) + 1; - * - * key = day + "/" + month; val = getAggregationValue(bucket); - * - * } else if (interval.equals(ElasticSearchConstants.HOUR)) { int hour = - * cal.get(Calendar.HOUR_OF_DAY); String suffix = "AM"; if - * (cal.get(Calendar.AM_PM) > 0) suffix = "PM"; val = - * getAggregationValue(bucket); - * - * key = String.valueOf(hour + 1) + suffix; - * - * } responseMap.put(key, val); return responseMap; - * - * } - */ - - /* - * private Object getAggregationValue(Bucket bucket) { Map valueMap = bucket.getAggregations().getAsMap(); Object val = - * null; - * - * for (Map.Entry aggregation : valueMap.entrySet()) { - * if - * (aggregation.getKey().contains(ElasticProperties.Query.SUM.toLowerCase()) - * ) { ParsedSum sum = (ParsedSum) aggregation.getValue(); val = - * sum.getValue(); } else if - * (aggregation.getKey().contains(ElasticProperties.Query.AVG.toLowerCase()) - * ) { ParsedAvg avg = (ParsedAvg) aggregation.getValue(); val = - * avg.getValue(); - * - * } else if - * (aggregation.getKey().contains(ElasticProperties.Query.COUNT.toLowerCase( - * ))) { ParsedValueCount count = (ParsedValueCount) aggregation.getValue(); - * val = count.getValue(); - * - * } } return val; } - */ - - private Map parseParseLongTerms(ParsedLongTerms aggregations, ChartType chartType, Map labelMap) { - - Map keyValueMap = new HashMap<>(); - - for (Terms.Bucket bucket : aggregations.getBuckets()) { - KeyData keyData = new KeyData(); - KeyData valueData = new KeyData(); - - String key = bucket.getKey().toString(); - - Map valueMap = bucket.getAggregations().getAsMap(); - Object val = null; - String valueLabel = null; - for (Map.Entry aggregation : valueMap.entrySet()) { - if (aggregation.getKey().contains(ElasticProperties.Query.SUM.toLowerCase())) { - ParsedSum sum = (ParsedSum) aggregation.getValue(); - val = sum.getValue(); - valueLabel = ElasticProperties.Query.SUM.toLowerCase(); - } else if (aggregation.getKey().contains(ElasticProperties.Query.AVG.toLowerCase())) { - ParsedAvg avg = (ParsedAvg) aggregation.getValue(); - val = avg.getValue(); - valueLabel = ElasticProperties.Query.SUM.toLowerCase(); - - } else if (aggregation.getKey().contains(ElasticProperties.Query.COUNT.toLowerCase())) { - ParsedValueCount count = (ParsedValueCount) aggregation.getValue(); - val = count.getValue(); - valueLabel = ElasticProperties.Query.SUM.toLowerCase(); - - } - - } - keyData.setKey(key); - keyData.setLabel(labelMap.get(ElasticProperties.Query.TERM.toLowerCase())); - valueData.setKey(val); - valueData.setLabel(labelMap.get(valueLabel)); - keyValueMap.put(keyData, valueData); - - } - return keyValueMap; - - } - - private Double getFormattedDouble(double val) { - return (Math.round(new Double(val).isInfinite() ? 0.0 : new Double(val) * 100.0) / 100.0); - } - - @Override - public ObjectNode getChartConfigurationQuery(AggregateRequestDto request, JsonNode query, String indexName, String interval) { - String aggrQuery = query.get(Constants.JsonPaths.AGGREGATION_QUERY).asText(); - if(interval!=null && !interval.isEmpty()) - aggrQuery = aggrQuery.replace(Constants.JsonPaths.INTERVAL_VAL, interval); - String rqMs = query.get(Constants.JsonPaths.REQUEST_QUERY_MAP).asText(); - String dateReferenceField = query.get(Constants.JsonPaths.DATE_REF_FIELD).asText(); - JsonNode requestQueryMaps = null; - ObjectNode objectNode = null; - ObjectMapper mapper = new ObjectMapper(); - Map esFilterMap = new HashMap<>(); - try { - requestQueryMaps = new ObjectMapper().readTree(rqMs); - request.setEsFilters(esFilterMap); - if(query.get(Constants.JsonPaths.MODULE).asText().equals(Constants.Modules.COMMON) && - !request.getModuleLevel().equals(Constants.Modules.HOME_REVENUE) && - !request.getModuleLevel().equals(Constants.Modules.HOME_SERVICES)) { - request.getFilters().put(Constants.Filters.MODULE, request.getModuleLevel()); - } - Iterator> filtersItr = request.getFilters().entrySet().iterator(); - while(filtersItr.hasNext()) { - Entry entry = filtersItr.next(); - if(null != requestQueryMaps.get(entry.getKey()) && !String.valueOf(entry.getValue()).equals(Constants.Filters.FILTER_ALL)) { - // Filters in put filters are added as esfilters usign mapping in requestQueryMap - String esQueryKey = requestQueryMaps.get(entry.getKey()).asText(); - request.getEsFilters().put(esQueryKey, entry.getValue()); - } - } - - ElasticSearchDictator dictator = elasticSearchDao.createSearchDictatorV2(request, indexName, "", dateReferenceField); - - SearchRequest searchRequest = elasticSearchDao.buildElasticSearchQuery(dictator); - JsonNode querySegment = mapper.readTree(searchRequest.source().toString()); - objectNode = (ObjectNode) querySegment; - JsonNode aggrNode = mapper.readTree(aggrQuery).get(Constants.JsonPaths.AGGS); - objectNode.put(Constants.JsonPaths.AGGS, mapper.readTree(aggrQuery).get(Constants.JsonPaths.AGGS)); - } catch (Exception ex) { - logger.error("Encountered an Exception while parsing the JSON : " + ex.getMessage()); - throw new RuntimeException(ex); - } - return objectNode; - - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RestService.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RestService.java deleted file mode 100644 index 301861efc09..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RestService.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.tarento.analytics.service.impl; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.tomcat.util.codec.binary.Base64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.http.*; -import org.springframework.stereotype.Component; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.RestTemplate; - -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.List; - -import static javax.servlet.http.HttpServletRequest.BASIC_AUTH; -import static org.apache.commons.codec.CharEncoding.US_ASCII; -import static org.springframework.http.HttpHeaders.AUTHORIZATION; - -@Component -public class RestService { - public static final Logger LOGGER = LoggerFactory.getLogger(RestService.class); - - @Value("${services.esindexer.host}") - private String indexServiceHost; - @Value("${egov.services.esindexer.host.search}") - private String indexServiceHostSearch; - @Value("${services.esindexer.host}") - private String dssindexServiceHost; - @Value("${egov.es.username}") - private String userName; - @Value("${egov.es.password}") - private String password; - - @Autowired - private RetryTemplate retryTemplate; - - - /** - * search on Elastic search for a search query - * @param index elastic search index name against which search operation - * @param searchQuery search query as request body - * @return - * @throws IOException - */ - - public JsonNode search(String index, String searchQuery) { - //System.out.println("INSIDE REST"); - String url =( indexServiceHost) + index + indexServiceHostSearch; - HttpHeaders headers = getHttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - //LOGGER.info("Index Name : " + index); - //LOGGER.info("Searching ES for Query: " + searchQuery); - HttpEntity requestEntity = new HttpEntity<>(searchQuery, headers); - String reqBody = requestEntity.getBody(); - JsonNode responseNode = null; - - try { - ResponseEntity response = retryTemplate.postForEntity(url, requestEntity); - responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); - //LOGGER.info("RestTemplate response :- "+responseNode); - - } catch (HttpClientErrorException e) { - e.printStackTrace(); - LOGGER.error("client error while searching ES : " + e.getMessage()); - } - return responseNode; - } - - /** - * makes a client rest api call of Http POST option - * @param uri - * @param authToken - * @param requestNode - * @return - * @throws IOException - */ - public JsonNode post(String uri, String authToken, JsonNode requestNode) { - - HttpHeaders headers = new HttpHeaders(); - if(authToken != null && !authToken.isEmpty()) - headers.add("Authorization", "Bearer "+ authToken ); - headers.setContentType(MediaType.APPLICATION_JSON); - - LOGGER.info("Request URI: " + uri + ", Node: " + requestNode); - HttpEntity requestEntity = null; - if(requestNode != null ) requestEntity = new HttpEntity<>(requestNode.toString(), headers); - else requestEntity = new HttpEntity<>("{}", headers); - - JsonNode responseNode = null; - - try { - ResponseEntity response = retryTemplate.postForEntity(uri,requestEntity); - responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); - LOGGER.info("RestTemplate response :- "+responseNode); - - } catch (HttpClientErrorException e) { - LOGGER.error("post client exception: " + e.getMessage()); - } - return responseNode; - } - - /** - * makes a client rest api call of Http GET option - * @param uri - * @param authToken - * @return - * @throws IOException - */ - public JsonNode get(String uri, String authToken) { - - HttpHeaders headers = new HttpHeaders(); - headers.add("Authorization", "Bearer "+ authToken ); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity headerEntity = new HttpEntity<>("{}", headers); - - JsonNode responseNode = null; - try { - ResponseEntity response = retryTemplate.getForEntity(uri, headerEntity); - responseNode = new ObjectMapper().convertValue(response.getBody(), JsonNode.class); - LOGGER.info("RestTemplate response :- "+responseNode); - - } catch (HttpClientErrorException e) { - LOGGER.error("get client exception: " + e.getMessage()); - } - return responseNode; - } - - - private HttpHeaders getHttpHeaders() { - HttpHeaders headers = new HttpHeaders(); - headers.add(AUTHORIZATION, getBase64Value(userName, password)); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.setContentType(MediaType.APPLICATION_JSON); - - List mediaTypes = new ArrayList<>(); - mediaTypes.add(MediaType.APPLICATION_JSON); - headers.setAccept(mediaTypes); - return headers; - } - - /** - * Helper Method to create the Base64Value for headers - * - * @param userName - * @param password - * @return - */ - private String getBase64Value(String userName, String password) { - String authString = String.format("%s:%s", userName, password); - byte[] encodedAuthString = Base64.encodeBase64(authString.getBytes(Charset.forName(US_ASCII))); - return String.format(BASIC_AUTH, new String(encodedAuthString)); - } - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RetryTemplate.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RetryTemplate.java deleted file mode 100644 index e4f1f59f825..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/service/impl/RetryTemplate.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.tarento.analytics.service.impl; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import org.springframework.retry.annotation.Backoff; -import org.springframework.retry.annotation.Retryable; -import org.springframework.stereotype.Component; -import org.springframework.web.client.ResourceAccessException; -import org.springframework.web.client.RestTemplate; -import javax.naming.ServiceUnavailableException; - -/** - * Wraps rest template with retry - */ -@Component -public class RetryTemplate { - - @Autowired - private RestTemplate restTemplate; - - @Retryable(value = {RuntimeException.class, ResourceAccessException.class, ServiceUnavailableException.class}, - maxAttemptsExpression = "#{${service.retry.maxAttempts}}", - backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) - public ResponseEntity postForEntity(String url, Object request) { - return restTemplate.postForEntity(url, request, Object.class); - } - - @Retryable(value = {RuntimeException.class, ResourceAccessException.class, ServiceUnavailableException.class}, - maxAttemptsExpression = "#{${service.retry.maxAttempts}}", - backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) - public ResponseEntity getForEntity(String url, HttpEntity headerEntity) { - return restTemplate.exchange(url, HttpMethod.GET, headerEntity, Object.class); - } - -} - diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ElasticProperties.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ElasticProperties.java deleted file mode 100644 index c27e7b79a5c..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ElasticProperties.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.tarento.analytics.utils; - -public interface ElasticProperties { - - public interface Property { - final String TRANSACTION_TRANSDATE = "TransDate"; - final String TRANSACTION_STOREID = "StoreId"; - final String TRANSACTION_NETAMOUNT = "NetAmt"; - final String TARGET_TARGETDATE = "targetDate"; - final String TARGET_STORECODE = "storeCode"; - final String TARGET_VERSION = "version"; - final String TARGET_SALESVALUE = "salesValue"; - final String TARGET_AVGVALUE = "avgValue"; - final String TARGET_RECEIPTVALUE = "receiptsValue"; - final String ITEM_DETAILS_CATEGORY_ID = "itemDetails.categoryId"; - final String ITEM_DETAILS_PRICE = "itemDetails.price" ; - final String AVERAGE_RATING = "AvgRating"; - final String SORT_ORDER_DESCENDING = "desc"; - final String SORT_ORDER_ASCENDING = "asc"; - final String COUNTS = "counts"; - final String COUNTS_RATING = "CountsRating"; - final String FEEDBACK_VALUE_RESPONSE = "feedback_value"; - } - - public interface SuccessMessages { - final String STORE_USER = "User and Store successfully mapped" ; - final String STORE_TIMING = "Store Times entered successfully" ; - } - - public interface Query { - final String NESTED = "NESTED"; - final String MATCH_CONDITION = "MATCH"; - final String RANGE_CONDITION = "RANGE"; - final String AGGREGATION_CONDITION = "AGGREGATION"; - final String TRANSACTION_DATE_FIELD = "transDate"; - final String FEEDBACK_DATE_TIME = "serverDateTime"; - final String COUNT_STORE_CODE = "storeId"; - final String COUNT_RATING_VALUE = "value"; - final String COUNT_REASON_KEYWORD = "reasons.keyword"; - final String COUNT_GENDER_KEYWORD = "gender.keyword"; - final String COUNT_AGEGROUP_KEYWORD = "ageGroup.keyword"; - final String SUM = "SUM"; - final String VALUE_COUNT="value_count"; - final String AVG = "AVG"; - final String CUMMULATIVE_SUM="cumulative_sum"; - final String FIELD = "FIELD"; - final String COUNT = "COUNT"; - final String BUCKETS_PATH = "BUCKETS_PATH"; - final String DATE_HISTOGRAM = "DATE_HISTOGRAM"; - final String EXTENDED_BOUNDS = "EXTENDED_BOUNDS"; - final String PATH ="PATH"; - final String MIN = "MIN"; - final String MAX = "MAX"; - final String INTERVAL = "INTERVAL"; - final String HOUR ="HOUR"; - final String DAY ="DAY"; - final String DAY_OF_WEEK ="dayOfWeek"; - final String ASC="ASC"; - final String DESC ="DESC"; - - final String MINUTE ="MINUTE"; - final String MONTH ="MONTH"; - final String TERM ="TERMS"; - final String SIZE="SIZE"; - final String ORDER="ORDER"; - final Integer TOP_CSAT_STORE_COUNT = 5; - final String LABEL="label"; - - - - } - -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ElasticSearchClient.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ElasticSearchClient.java deleted file mode 100644 index b25f722850d..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ElasticSearchClient.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.tarento.analytics.utils; - -import org.apache.http.HttpHost; -import org.elasticsearch.client.RestClient; -import org.elasticsearch.client.RestHighLevelClient; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - - -@Component -public class ElasticSearchClient { - private final String hostName; - private final Integer port; - private final static String HTTP = "http"; - private final Integer topPerformanceCount; - private final String transactionIndex; - private final String transactionType; - private final String targetIndex; - private final String targetType; - - public ElasticSearchClient(@Value("${services.esindexer.host.name}") String hostName, - @Value("${services.esindexer.host.port}") Integer port, - @Value("${top.performance.record.count}") Integer topPerformanceCount, - @Value("${es.index.name}") String transactionIndex, - @Value("${es.document.type}") String transactionType, - @Value("${es.target.index.name}") String targetIndex, - @Value("${es.target.document.type}") String targetType){ - - this.hostName = hostName; - this.port = port; - this.topPerformanceCount = topPerformanceCount; - this.transactionIndex = transactionIndex; - this.transactionType = transactionType; - this.targetIndex = targetIndex; - this.targetType = targetType; - - } - - public RestHighLevelClient getClient() { - return new RestHighLevelClient( - RestClient.builder(new HttpHost(hostName, port,HTTP))); - - } - - - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/JSONObjectUtil.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/JSONObjectUtil.java deleted file mode 100644 index 6a7e33e2c36..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/JSONObjectUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.tarento.analytics.utils; -import org.springframework.beans.factory.annotation.Autowired; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.gson.Gson; - -public class JSONObjectUtil { - @Autowired - public ObjectMapper mapper; - @Autowired - public Gson gson; - - - /** - * @return - */ - public static String getJsonString(ObjectMapper objectMapper,Object object) throws JsonProcessingException { - if(objectMapper != null){ - return objectMapper.writeValueAsString(object); - } - return null; - } - - public ObjectMapper getMapper() { - return mapper; - } - - public void setObjectMapper(ObjectMapper objectMapper){ - mapper=objectMapper; - } - - public Gson getGson() { - return gson; - } - - public void setGson(Gson gsonn) - { - gson = gsonn; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/JsonKey.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/JsonKey.java deleted file mode 100644 index d60097bc794..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/JsonKey.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - */ -package com.tarento.analytics.utils; - -/** - * @author Satish - * - */ -public class JsonKey { - - public static final String STATUS_CODE = "statusCode"; - public static final String STATUS = "statusInfo"; - public static final String STATUS_MESSAGE = "statusMessage"; - public static final String ERROR_MESSAGE = "errorMessage"; - - public static final String RESPONSE_DATA = "responseData"; - - -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/PathRoutes.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/PathRoutes.java deleted file mode 100644 index 75e90b40ca2..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/PathRoutes.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.tarento.analytics.utils; - -public interface PathRoutes { - - public interface DashboardApi { - final String DASHBOARD_ROOT_PATH = "/dashboard"; - - final String TEST_PATH = "/test"; - final String FILE_PATH = "/files"; - - final String GET_CHART = "/getChart"; - final String GET_CHART_V2 = "/getChartV2"; - final String GET_CHART_V3 = "/getChartV3"; - final String GET_DASHBOARD_CONFIG = "/getDashboardConfig"; - final String GET_HOME_CONFIG = "/getHomeConfig"; - final String GET_ALL_VISUALIZATIONS = "/getAllVisualizations"; - final String ADD_NEW_DASHBOARD = "/addNewDashboard"; - final String MAP_DASHBOARD_VISUALIZATIOn = "/mapVisualizationToDashboard"; - final String MAP_VISUALIZATION_ROLE = "/mapVisualizationToRole"; - final String GET_HEADER_DATA = "/getDashboardHeader"; - final String GET_FEEDBACK_MESSAGE="/getPulseFeedbackMessage"; - final String TARGET_DISTRICT_ULB = "/targetDistrict"; - - } - - public interface MetadataApi { - final String METADATA_ROOT_PATH = "/meta"; - - final String GET_CATEGORIES = "/getCategories"; - final String GET_SUB_CATEGORIES = "/getSubCategories"; - final String GET_ITEMS = "/getItems"; - final String GET_MASTERS = "/getMasters"; - final String FLUSH_MASTERS = "/flushMasters"; - final String GET_PULSE_RATING_CONFIG="/getPulseRatingConfig"; - final String GET_RATING_CONFIG = "/getRatingConfiguration"; - final String GET_RATING_CONFIG_ENCODE = "/getRatingConfig"; - final String GET_CONFIG_VERSION = "/getConfigVersion"; - final String PULSE_VERIFY_ORG_PIN = "/verifyOrgs"; - final String PUT_ORG_INDEX ="/putIndex"; - final String PUT_QUERY ="/createQuery"; - - - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseCode.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseCode.java deleted file mode 100644 index ac4dc39622e..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseCode.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.tarento.analytics.utils; - -import com.tarento.analytics.constant.Constants; - -/** - * - * @author Abhishek - * - */ -public enum ResponseCode { - UnAuthorised(Constants.UNAUTHORIZED_ID, Constants.UNAUTHORIZED), Success( - Constants.SUCCESS_ID, Constants.SUCCESS),FAILURE( - Constants.FAILURE_ID, Constants.PROCESS_FAIL); - /** - * error code contains int value - */ - private int errorCode; - /** - * errorMessage contains proper error message. - */ - private String errorMessage; - - - - /** - * @param errorCode - * @param errorMessage - */ - private ResponseCode(int errorCode, String errorMessage) { - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - /** - * - * @param errorCode - * @return - */ - public String getMessage(int errorCode) { - return ""; - } - - /** - * @return - */ - public int getErrorCode() { - return errorCode; - } - - /** - * @param errorCode - */ - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - } - - /** - * @return - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * @param errorMessage - */ - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - /** - * This method will provide status message based on code - * - * @param code - * @return String - */ - public static String getResponseMessage(int code) { - String value = ""; - ResponseCode responseCodes[] = ResponseCode.values(); - for (ResponseCode actionState : responseCodes) { - if (actionState.getErrorCode() == code) { - value = actionState.getErrorMessage(); - } - } - return value; - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseGenerator.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseGenerator.java deleted file mode 100644 index ed7a8984582..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseGenerator.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.tarento.analytics.utils; - - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - -public class ResponseGenerator { - - - private static ObjectMapper objectMapper = new ObjectMapper(); - - public static String failureResponse() throws JsonProcessingException{ - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.FAILURE.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, - ResponseCode.FAILURE.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE, - ResponseCode.FAILURE.getErrorMessage()); - return JSONObjectUtil.getJsonString(objectMapper,response); - } - - - public static String failureResponse(String message) throws JsonProcessingException{ - ObjectNode actualResponse = objectMapper.createObjectNode(); - - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.FAILURE.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, - ResponseCode.FAILURE.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE,message); - actualResponse.putPOJO(JsonKey.STATUS,response); - - return JSONObjectUtil.getJsonString(objectMapper,actualResponse); - } - - public static String failureResponse(String errorCode, String message) throws JsonProcessingException{ - ObjectNode actualResponse = objectMapper.createObjectNode(); - - ObjectNode response = objectMapper.createObjectNode(); - response.put(errorCode, message); - response.put(JsonKey.STATUS_MESSAGE, - message); - response.put(JsonKey.ERROR_MESSAGE,message); - actualResponse.putPOJO(JsonKey.STATUS,response); - - return JSONObjectUtil.getJsonString(objectMapper,actualResponse); - } - - public static String successResponse(Object obj) throws JsonProcessingException { - ObjectNode actualResponse = objectMapper.createObjectNode(); - - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.Success.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, ResponseCode.Success.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE, ""); - actualResponse.putPOJO(JsonKey.STATUS,response); - if (obj != null) { - actualResponse.putPOJO(JsonKey.RESPONSE_DATA, obj); - } - - return JSONObjectUtil.getJsonString(objectMapper,actualResponse); - } - - /** - * this method will crate success response and send to controller. - * - * @return ObjectNode object. - */ - public static String successResponse(String message) throws JsonProcessingException{ - ObjectNode actualResponse = objectMapper.createObjectNode(); - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.Success.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, - ResponseCode.Success.getErrorMessage()); - //response.put(JsonKey.SUCCESS_MESSAGE, message); - actualResponse.putPOJO(JsonKey.STATUS,response); - response.put(JsonKey.ERROR_MESSAGE, ""); - actualResponse.putPOJO(JsonKey.STATUS,response); - if (message != null) { - actualResponse.putPOJO(JsonKey.RESPONSE_DATA, message); - } - - return JSONObjectUtil.getJsonString(objectMapper,actualResponse); - } -} diff --git a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseRecorder.java b/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseRecorder.java deleted file mode 100644 index 5003d37a5ed..00000000000 --- a/business-services/dashboard-analytics/src/main/java/com/tarento/analytics/utils/ResponseRecorder.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.tarento.analytics.utils; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; -import org.springframework.web.context.annotation.RequestScope; - -import com.tarento.analytics.constant.Constants; - -//@Component("responseRecorder") -public class ResponseRecorder { - - private static Logger logger = LoggerFactory.getLogger(ResponseRecorder.class); - public static HashMap> requestModuleResponseMap = new HashMap<>(); - - public Object get(String visualizationCode, String module) { - if(!StringUtils.isNotBlank(module)) { - module = Constants.Modules.COMMON.toString(); - } - if(requestModuleResponseMap.get(visualizationCode) != null && requestModuleResponseMap.get(visualizationCode).get(module) != null) { - return requestModuleResponseMap.get(visualizationCode).get(module); - } - return null; - } - - - public Boolean put(String visualizationCode, String module, Object object) { - if(!StringUtils.isNotBlank(module)) { - module = Constants.Modules.COMMON.toString(); - } - if(requestModuleResponseMap.containsKey(visualizationCode)) { - Map innerMap = requestModuleResponseMap.get(visualizationCode); - innerMap.put(module, object); - } else { - Map innerMap = new HashMap<>(); - innerMap.put(module, object); - requestModuleResponseMap.put(visualizationCode, innerMap); - } - return Boolean.TRUE; - } - - -} diff --git a/business-services/dashboard-analytics/src/main/resources/application.properties b/business-services/dashboard-analytics/src/main/resources/application.properties deleted file mode 100644 index 242c406d24d..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/application.properties +++ /dev/null @@ -1,57 +0,0 @@ -server.port=8280 -server.context-path=/dashboard-analytics -server.servlet.context-path=/dashboard-analytics - -spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration - -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://localhost:5432/test -spring.datasource.username=postgres -spring.datasource.password=postgres - - -#----------------------------- ELASTIC SEARCH CONFIGURATIONS ------------------------------# -services.esindexer.host=http://localhost:9200/ -services.esindexer.host.name=http://localhost -services.esindexer.host.port=9200 -services.esindexer.username=changeme -services.esindexer.password=changeme -es.index.name=_transaction -es.document.type=transaction -es.target.index.name=store_target -es.target.document.type=storeTarget -#egov.mdms-service.target.url=https://dev.digit.org/egov-mdms-service/v1/_get?masterName=tenants&moduleName=tenant&tenantId=pb -config.schema.paths=classpath*:schema/*.json - -#----------------------------- MISCELLANEOUS CONFIGURATION ----------------------------------# -top.performance.record.count=5 - -egov.services.esindexer.host.search=/_search -management.endpoints.web.base-path=/ - -egov.es.username=egov-admin -egov.es.password=TUSYns9mEcRPy77n - -#----------------------------- AMAZON S3 CREDENTIALS -------------------------------------------------# -aws.access.key.id = -aws.access.key.secret = -aws.region = ap-south-1 -aws.s3.audio.bucket = dss-project-bucket - -#---------------------------- MDMS ---------------------------------------------------------------------# -egov.statelevel.tenantId=pb - -egov.mdms.host=https://qa.digit.org -egov.mdms.search.endpoint=/egov-mdms-service/v1/_search - - -#Paramters for naming file for internal storage -filename.length=10 -filename.useletters=true -filename.usenumbers=false - -# CACHE CONFIG -cache.expiry.time.in.minutes=10 -cache.capacity=120 - -egov.targetacheivement.chartname.list=demandCollectionIndexDDRRevenue,demandCollectionIndexBoundaryRevenue,licenseIssuedDDRRevenue,licenseIssuedBoundaryRevenue diff --git a/business-services/dashboard-analytics/src/main/resources/application.properties.j2 b/business-services/dashboard-analytics/src/main/resources/application.properties.j2 deleted file mode 100644 index 2b63c74159d..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/application.properties.j2 +++ /dev/null @@ -1,75 +0,0 @@ -server.port=8089 - - -spring.datasource.url={{ datasource_url | b64decode }} -spring.datasource.username={{ datasource_user | b64decode }} -spring.datasource.password={{ datasource_pwd | b64decode }} -spring.datasource.driver-class-name=com.mysql.jdbc.Driver - -#----------------------------- ELASTIC SEARCH CONFIGURATIONS ------------------------------# -services.esindexer.host={{ es_host | b64decode }} -services.esindexer.host.name={{ es_host_name | b64decode }} -services.esindexer.host.port=9200 -services.esindexer.username={{ es_user | b64decode }} -services.esindexer.password={{ es_pwd | b64decode }} -es.index.name=_transaction -es.document.type=transaction -es.transaction.index.name=_transaction -es.transaction.document.type=transaction -es.target.index.name=store_target -es.target.document.type=storeTarget -es.index.name.storeTarget=store_target -es.index.name.feedback=_app_feedback -es.index.name.storeFeedback=rain_feedback -es.document.type.storeTarget=storeTarget -es.document.type.feedback=appFeedback -es.document.type.storeFeedback=rainFeedback - -#---------------------------------Microservice details------------------------------------# -services.user.host.name=localhost -services.user.host.port=8081 -services.user.host.url=/user - -#----------------------------- MISCELLANEOUS CONFIGURATION ----------------------------------# -top.performance.store.count=5 - -#------------------------------ KAFKA CONFIGURATIONS ------------------------------# - -# KAFKA SERVER CONFIGURATIONS -kafka.config.bootstrap_server_config=localhost:9092 - -spring.kafka.consumer.value-deserializer=com.tarento.analytics.consumer.HashMapDeserializer -spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.group-id=rain-transaction-chain -spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer - -# KAFKA CONSUMER CONFIGURATIONS -kafka.consumer.config.auto_commit=true -kafka.consumer.config.auto_commit_interval=100 -kafka.consumer.config.session_timeout=15000 -kafka.consumer.config.group_id=rain-transaction-chain -kafka.consumer.config.auto_offset_reset=earliest - -# KAFKA PRODUCER CONFIGURATIONS -kafka.producer.config.retries_config=0 -kafka.producer.config.batch_size_config=100000 -kafka.producer.config.linger_ms_config=100 -kafka.producer.config.buffer_memory_config=66554432 - -#--------------------------- KAFKA TOPICS TO CONSUME ---------------------------# - -kafka.topics.notify.newmessage.name=NewContentMessage -kafka.topics.notify.newmessage.key=content - -kafka.topics.transaction.pushdata.name=RainTransactionData -kafka.topics.transaction.pushdata.key=transactiondata - -kafka.topics.target.pushdata.name=NewTargetData -kafka.topics.target.pushdata.key=targetdata - -kafka.topics.feedback.pushdata.name=NewFeedbackData -kafka.topics.feedback.pushdata.key=feedbackdata - -kafka.topics.rating.pushdata.name=RainRatingData -kafka.topics.rating.pushdata.key=ratingdata \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/resources/schema/ChartApiConfig.json b/business-services/dashboard-analytics/src/main/resources/schema/ChartApiConfig.json deleted file mode 100644 index 94bc6b15a8f..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/schema/ChartApiConfig.json +++ /dev/null @@ -1,4790 +0,0 @@ -{ - "wardDrillDown": { - "kind": "drillDown", - "chartName": "Ward", - "queries": [ - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\",\"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\r\n \"AGGR\":{\r\n \"filter\":{\r\n \"bool\":{\r\n \"must_not\":[\r\n {\r\n \"term\":{\r\n \"dataObject.tenantId.keyword\":\"tenant\"\r\n }\r\n },\r\n {\r\n \"terms\":{\r\n \"dataObject.paymentDetails.bill.status.keyword\":[\r\n \"Cancelled\"\r\n ]\r\n }\r\n }\r\n ]\r\n }\r\n },\r\n \"aggs\":{\r\n \"Ward \":{\r\n \"terms\":{\r\n \"field\":\"domainObject.ward.name.keyword\",\r\n \"size\":200\r\n },\r\n \"aggs\":{\r\n \"ULB\":{\r\n \"terms\":{\r\n \"field\":\"domainObject.tenantId.keyword\",\r\n \"size\":200\r\n },\r\n \"aggs\":{\r\n \"Receipt Number\":{\r\n \"terms\":{\r\n \"field\":\"dataObject.paymentDetails.receiptNumber.keyword\"\r\n },\r\n \"aggs\":{\r\n \"Amount Collected\":{\r\n \"sum\":{\r\n \"field\":\"dataObject.paymentDetails.totalAmountPaid\"\r\n }\r\n },\r\n \"Payment Mode\":{\r\n \"terms\":{\r\n \"field\":\"dataObject.paymentMode.keyword\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }}" - } - ], - "chartType": "table", - "valueType": "number", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "plotLabel": "Ward", - "aggregationPaths": [ - "ULB", - "Receipt Number", - "Amount Collected", - "Payment Mode" - ], - "pathDataTypeMapping": [ - { - "ULB": "string" - }, - { - "Receipt Number": "string" - }, - { - "Amount Collected": "amount" - }, - { - "Payment Mode": "string" - } - ], - "insight": { - }, - "_comment": "" - }, - - - "todaysCollectionv2": { - "chartName": "DSS_TODAYS_COLLECTION", - "queries": [ - { - "module": "PT", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\"}", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.paymentDetails.bill.billDetails.businessService.keyword\":\"PT\"}},{\"range\":{\"dataObject.paymentDetails.receiptDate\":{\"gt\":\"now-1d/d\",\"lte\":\"now\"}}}]}},\"aggs\":{\"Todays Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}" - }, - { - "module": "TL", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\"}", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.paymentDetails.bill.billDetails.businessService.keyword\":\"TL\"}},{\"range\":{\"dataObject.paymentDetails.receiptDate\":{\"gt\":\"now-1d/d\",\"lte\":\"now\"}}}]}},\"aggs\":{\"Todays Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}" - } - ], - "chartType": "metric", - "valueType": "Amount", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Todays Collection" - ], - "insight": { - "chartResponseMap" : "totalCollection", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " " - }, - - "totalCollectionv2": { - "chartName": "DSS_TOTAL_COLLECTION", - "queries": [ - { - "module": "PT", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\"}", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.paymentDetails.businessService.keyword\":\"PT\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}" - }, - { - "module": "TL", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\"}", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.paymentDetails.businessService.keyword\":\"TL\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}" - } - ], - "chartType": "metric", - "valueType": "Amount", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Total Collection" - ], - "insight": { - "chartResponseMap" : "totalCollection", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " " - }, - - "targetAchievedv2": { - "chartName": "DSS_TARGET_ACHIEVED", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\r\n \"module\" : \"businessService.keyword\", \n\"tenantId\" : \"tenantIdForMunicipalCorporation\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Actual collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"module\" : \"dataObject.paymentDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}" - } - - ], - "chartType": "metric", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "aggregationPaths": [ - "Total Collection", - "Actual collection" - ], - "insight": { - "chartResponseMap" : "targetAchieved", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " " - }, - "cumulativeCollectionv2": { - "chartName": "DSS_TOTAL_CUMULATIVE_COLLECTION", - "queries": [ - { - "module": "COMMON", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"module\" : \"dataObject.paymentDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"terms\":{\"dataObject.paymentDetails.businessService.keyword\":[\"PT\",\"TL\"]}}]}},\"aggs\":{\"Collections\":{\"date_histogram\":{\"field\":\"dataObject.paymentDetails.receiptDate\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "line", - "valueType": "amount", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Collections" - ], - "isCumulative": true, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - "topPerformingUlbsv2": { - "chartName": "DSS_PT_TOP_3_PERFORMING_ULBS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\r\n \"module\" : \"businessService.keyword\", \n\"tenantId\" : \"tenantIdForMunicipalCorporation\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"module\" : \"dataObject.paymentDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_TARGET_ACHIEVED", - "order": "desc", - "limit": 3, - "aggregationPaths": [ - "Total Collection","Target Collection" - ], - "insight": { - }, - "_comment": " Top Performing Ulbs for target achieved" - }, - "bottomPerformingUlbsv2": { - "chartName": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\",\"tenantId\" : \"tenantIdForMunicipalCorporation\" }", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"module\" : \"dataObject.paymentDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_TARGET_ACHIEVED", - "order": "asc", - "limit": 3, - "aggregationPaths": [ - "Total Collection", "Target Collection" - ], - "insight": { - }, - "_comment": " Bottom Performing Ulbs for target achieved" - }, - - "collectionByUsageTypev2": { - "chartName": "DSS_PT_COLLECTION_BY_USAGE_TYPE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"module\" : \"dataObject.paymentDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"Usage Type\":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"size\":200}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "amount", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Usage Type" - ], - "insight": { - }, - "_comment": " collection/amount per usage type" - }, - - - "demandCollectionIndexDDRRevenuev2": { - "chartName": "DSS_PT_KEY_FY_INDICATORS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.paymentDetails.id.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "demandCollectionIndexBoundaryRevenuev2", - "action": "", - "plotLabel": "DDRs", - "isPostResponseHandler": true, - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "demandCollectionIndexBoundaryRevenuev2": { - "chartName": "DSS_PT_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.paymentDetails.id.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":1000},\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "postAggregationTheory" : "repsonseToDifferenceOfDates", "chartType": "table", - "valueType": "number", - "drillChart": "boundaryDrillDownv2", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "boundaryDrillDown": { - "kind": "drillDown", - "chartName": "Boundary", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"domainObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.paymentDetails.id.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}" - } - ], - "chartType": "table", - "valueType": "number", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "plotLabel": "Ward", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "demandCollectionIndexUsageRevenuev2": { - "chartName": "DSS_PT_DEMAND_COLLECTION_USAGETYPE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"UsageType \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}},\"Transactions\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"cardinality\":{\"field\":\"dataObject.paymentDetails.id.keyword\"}}}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"attr\":{\"cardinality\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Usage Type", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - - "taxHeadsBreakupDDRRevenuev2": { - "chartName": "DSS_PT_TAX_HEAD_BREAKUP_REVENUE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.totalAmount\"}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Time Interest\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_INTEREST\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Round Off\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_ROUNDOFF\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "taxHeadsBreakupRevenuev2", - "isPostResponseHandler": true, - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPaths": [ - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty", - "Time Interest","Round Off" - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AdditiveComputedField", - "fields" : [ "PT Tax", "Fire Cess", "Cancer Cess", "Rebate", "Penalty", "Time Interest","Round Off"], - "newField" : "Total Amount", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "insight": { - }, - "_comment": "" - }, - "taxHeadsBreakupRevenuev2": { - "chartName": "DSS_PT_TAX_HEAD_BREAKUP_REVENUE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"PT Tax>aggrFilter>amount\",\"c2\":\"Fire Cess>aggrFilter>amount\",\"c3\":\"Cancer Cess>aggrFilter>amount\",\"c4\":\"Rebate>aggrFilter>amount\",\"c5\":\"Penalty>aggrFilter>amount\",\"c6\":\"Time Interest>aggrFilter>amount\",\"c7\":\"Round Off>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3+params.c4+params.c5+params.c6+params.c7\"}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Time Interest\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_INTEREST\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Round Off\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_ROUNDOFF\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "taxHeadsBreakupBoundaryDrillv2", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty", - "Time Interest","Round Off", "Total Amount" - ], - - "insight": { - }, - "_comment": "" - }, - "taxHeadsBreakupBoundaryDrillv2": { - "chartName": "Tax head Breakup boundary", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"domainObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"PT Tax>aggrFilter>amount\",\"c2\":\"Fire Cess>aggrFilter>amount\",\"c3\":\"Cancer Cess>aggrFilter>amount\",\"c4\":\"Rebate>aggrFilter>amount\",\"c5\":\"Penalty>aggrFilter>amount\",\"c6\":\"Time Interest>aggrFilter>amount\",\"c7\":\"Round Off>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3+params.c4+params.c5+params.c6+params.c7\"}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Time Interest\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_INTEREST\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Round Off\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_ROUNDOFF\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty", - "Time Interest","Round Off","Total Amount" - ], - - "insight": { - }, - "_comment": "" - }, - "taxHeadsBreakupUsagev2": { - "chartName": "DSS_PT_TAX_HEAD_BREAKUP_USAGE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"Usage \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"PT Tax>aggrFilter>amount\",\"c2\":\"Fire Cess>aggrFilter>amount\",\"c3\":\"Cancer Cess>aggrFilter>amount\",\"c4\":\"Rebate>aggrFilter>amount\",\"c5\":\"Penalty>aggrFilter>amount\",\"c6\":\"Time Interest>aggrFilter>amount\",\"c7\":\"Round Off>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3+params.c4+params.c5+params.c6+params.c7\"}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Time Interest\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_INTEREST\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Round Off\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_ROUNDOFF\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}}}" - } - ], - "filterKeys": [ - - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "documentType": "_doc", - "action": "", - "plotLabel": "Usage Type", - "aggregationPaths": [ - "Total Amount", - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty" - ], - "pathDataTypeMapping": [ - { - "Total Amount": "amount" - }, - { - "PT Tax": "amount" - }, - { - "Fire Cess": "amount" - }, - { - "Cancer Cess": "amount" - }, - { - "Rebate": "amount" - }, - { - "Penalty": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - - - "licenseByLicenseTypev2": { - "chartName": "DSS_TL_LICENSE_BY_TYPE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\"}", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"License Instrument Type\":{\"terms\":{\"field\":\"dataObject.paymentMode.keyword\"},\"aggs\":{\"Licens Issued\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "License Instrument Type" - ], - "insight": { - }, - "_comment": " License Application which are issued by License Type" - }, - - "licenseIssuedDDRRevenuev2": { - "chartName": "DSS_TL_KEY_FY_INDICATORS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.paymentDetails.id.keyword\"}},\"Total Licence Issued\":{\"value_count\":{\"field\":\"domainObject.tradelicense.licensenumber.keyword\"}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "isPostResponseHandler": true, - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "chartType": "table", - "valueType": "number", - "drillChart": "licenseIssuedBoundaryRevenuev2", - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Total Licence Issued", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Total Licence Issued": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "licenseIssuedBoundaryRevenuev2": { - "chartName": "DSS_TL_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.paymentDetails.id.keyword\"}},\"Total Licence Issued\":{\"value_count\":{\"field\":\"domainObject.tradelicense.licensenumber.keyword\"}}}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":1000},\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "chartType": "table", - "valueType": "number", - "drillChart": "licenseIssuedBoundaryDrillDown", - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Total Licence Issued", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Total Licence Issued": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "licenseIssuedBoundaryDrillDownv2": { - "chartName": "", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"domainObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.paymentDetails.id.keyword\"}},\"Total Licence Issued\":{\"value_count\":{\"field\":\"domainObject.tradelicense.licensenumber.keyword\"}}}}}}}}" - } - ], - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "chartType": "table", - "valueType": "number", - "drillChart": "", - "documentType": "_doc", - "action": "", - "plotLabel": "Ward", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Total Licence Issued", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Total Licence Issued": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - - "licenceTaxHeadsBreakupDDRv2": { - "chartName": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"TL Tax\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Penalty\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Rebate\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "isPostResponseHandlerA": true, - "chartType": "xtable", - "valueType": "number", - "drillChart": "licenceTaxHeadsBreakupBoundaryv2", - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPaths": [ - "TL Tax", - "Adhoc Penalty", - "Adhoc Rebate" - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AdditiveComputedField", - "fields" : ["TL Tax", "Adhoc Penalty", "Adhoc Rebate"], - "newField" : "Total Amount", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - - "insight": { - }, - "_comment": "" - }, - "licenceTaxHeadsBreakupBoundaryv2": { - "chartName": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"TL Tax>aggrFilter>amount\",\"c2\":\"Adhoc Penalty>aggrFilter>amount\",\"c3\":\"Adhoc Rebate>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3\"}}},\"TL Tax\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Penalty\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Rebate\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "licenceTaxHeadsBreakupWard", - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "TL Tax", - "Adhoc Penalty", - "Adhoc Rebate","Total Amount" - ], - "insight": { - }, - "_comment": "" - }, - "licenceTaxHeadsBreakupWardv2": { - "chartName": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"domainObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"TL Tax>aggrFilter>amount\",\"c2\":\"Adhoc Penalty>aggrFilter>amount\",\"c3\":\"Adhoc Rebate>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3\"}}},\"TL Tax\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Penalty\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Rebate\":{\"nested\":{\"path\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "", - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "TL Tax", - "Adhoc Penalty", - "Adhoc Rebate", "Total Amount" - ], - "insight": { - }, - "_comment": "" - }, - - "totalCollectionDeptWisev2": { - "chartName": "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.paymentDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "dateRefField": "dataObject.paymentDetails.receiptDate", - "indexName": "dss-payment_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.bill.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"terms\":{\"dataObject.paymentDetails.businessService.keyword\":[\"PT\",\"TL\"]}}]}},\"aggs\":{\"Business Service\":{\"terms\":{\"field\":\"dataObject.paymentDetails.businessService.keyword\"},\"aggs\":{\"total\":{\"sum\":{\"field\":\"dataObject.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "Amount", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Business Service" - ], - "insight": { - }, - "_comment": " " - }, - - - - - - - - - - - - - - "_comment": "dss-collectionindex new queries ", - "totalCollection": { - "chartName": "DSS_TOTAL_COLLECTION", - "queries": [ - { - "module": "PT", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.Bill.billDetails.businessService.keyword\":\"PT\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}" - }, - { - "module": "TL", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.Bill.billDetails.businessService.keyword\":\"TL\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}" - } - ], - "chartType": "metric", - "valueType": "Amount", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Total Collection" - ], - "insight": { - "chartResponseMap" : "totalCollection", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " " - }, - "cumulativeCollection": { - "chartName": "DSS_TOTAL_CUMULATIVE_COLLECTION", - "queries": [ - { - "module": "COMMON", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"terms\":{\"dataObject.Bill.billDetails.businessService.keyword\":[\"PT\",\"TL\"]}}]}},\"aggs\":{\"Collections\":{\"date_histogram\":{\"field\":\"dataObject.Bill.billDetails.receiptDate\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "line", - "valueType": "amount", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Collections" - ], - "isCumulative": true, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - "targetAchieved": { - "chartName": "DSS_TARGET_ACHIEVED", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\r\n \"module\" : \"businessService.keyword\", \n\"tenantId\" : \"tenantIdForMunicipalCorporation\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Actual collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"district\" : \"dataObject.tenantData.cityDistrictCode\", \"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}" - } - - ], - "chartType": "metric", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "aggregationPaths": [ - "Total Collection", - "Actual collection" - ], - "insight": { - "chartResponseMap" : "targetAchieved", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " " - }, - "todaysCollection": { - "chartName": "DSS_TOTAL_COLLECTION", - "queries": [ - { - "module": "PT", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.Bill.billDetails.businessService.keyword\":\"PT\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}" - }, - { - "module": "TL", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"term\":{\"dataObject.Bill.billDetails.businessService.keyword\":\"TL\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}" - } - ], - "chartType": "metric", - "valueType": "Amount", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Total Collection" - ], - "insight": { - }, - "_comment": " " - }, - "totalCollectionDeptWise": { - "chartName": "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}],\"must\":[{\"terms\":{\"dataObject.Bill.billDetails.businessService.keyword\":[\"PT\",\"TL\"]}}]}},\"aggs\":{\"Business Service\":{\"terms\":{\"field\":\"dataObject.Bill.billDetails.businessService.keyword\"},\"aggs\":{\"total\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "Amount", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Business Service" - ], - "insight": { - }, - "_comment": " " - }, - "topPerformingUlbs": { - "chartName": "DSS_PT_TOP_3_PERFORMING_ULBS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\r\n \"module\" : \"businessService.keyword\", \n\"tenantId\" : \"tenantIdForMunicipalCorporation\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\r\n \"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \n\"tenantId\" : \"dataObject.tenantId\"}", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_TARGET_ACHIEVED", - "order": "desc", - "limit": 3, - "aggregationPaths": [ - "Total Collection","Target Collection" - ], - "insight": { - }, - "_comment": " Top Performing Ulbs for target achieved" - }, - "bottomPerformingUlbs": { - "chartName": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\",\"tenantId\" : \"tenantIdForMunicipalCorporation\" }", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_TARGET_ACHIEVED", - "order": "asc", - "limit": 3, - "aggregationPaths": [ - "Total Collection", "Target Collection" - ], - "insight": { - }, - "_comment": " Bottom Performing Ulbs for target achieved" - }, - "licenseByLicenseType": { - "chartName": "DSS_TL_LICENSE_BY_TYPE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantData.code\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"License Instrument Type\":{\"terms\":{\"field\":\"dataObject.instrument.typeName.keyword\"},\"aggs\":{\"Licens Issued\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "License Instrument Type" - ], - "insight": { - }, - "_comment": " License Application which are issued by License Type" - }, - - "_comment": "COMMON NON-COLLECTION CHARTS", - "totalApplication": { - "chartName": "DSS_TOTAL_APPLICATION", - "queries": [ - { - "module": "PT", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"value_count\":{\"field\":\"Data.propertyId.keyword\"}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "dateRefField": "Data.@timestamp" - }, - { - "module": "TL", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"value_count\":{\"field\":\"Data.tradelicense.applicationnumber.keyword\"}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tradelicense.tenantid.keyword\" \r\n}", - "dateRefField": "Data.tradelicense.applicationdate" - }, - { - "module": "PGR", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "dateRefField": "Data.dateOfComplaint" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Total Application" - ], - "insight": { - "chartResponseMap" : "totalApplication", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " totalApplication is the chartId" - }, - "closedApplication": { - "chartName": "DSS_CLOSED_APPLICATION", - "queries": [ - { - "module": "PT", - "dateRefField": "Data.@timestamp", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Applications Closed\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.status.keyword\":[\"closed\",\"resolved\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.propertyId.keyword\"}}}}}}}}" - }, - { - "module": "TL", - "dateRefField": "Data.tradelicense.applicationdate", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tradelicense.tenantid.keyword\" \r\n}", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Applications Closed\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.status.keyword\":[\"closed\",\"resolved\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tradelicense.applicationnumber.keyword\"}}}}}}}}" - }, - { - "module": "PGR", - "dateRefField": "Data.dateOfComplaint", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Applications Closed\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.status.keyword\":[\"closed\",\"resolved\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Applications Closed" - ], - "insight": { - "chartResponseMap" : "closedApplication", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " totalApplication is the chartId" - }, - "citizenRegistered": { - "chartName": "DSS_CITIZEN_REGISTERED", - "queries": [ - { - "module": "PGR", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Citizen Registered\":{\"terms\":{\"field\":\"Data.citizen.uuid.keyword\"},\"aggs\":{\"type_count\":{\"cardinality\":{\"field\":\"Data.citizen.uuid.keyword\"}}}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"district\" : \"Data.tenantData.city.districtCode\", \"tenantId\" : \"Data.tenantId\", \"status\" : \"Data.status\"}", - "dateRefField": "Data.dateOfComplaint" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Citizen Registered" - ], - "insight": { - "chartResponseMap" : "citizenRegistered", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " totalApplication is the chartId" - }, - "totalApplicationDeptWise": { - "chartName": "DSS_TOTAL_APPLICATIONS:_DEPARTMENT_WISE", - "queries": [ - { - "module": "PT", - "dateRefField": "Data.@timestamp", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Property Tax\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}" - }, - { - "module": "TL", - "dateRefField": "Data.@timestamp", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Trade Licence\":{\"value_count\":{\"field\":\"Data.tradelicense.tenantid.keyword\"}}}}}}" - }, - { - "module": "PGR", - "dateRefField": "Data.@timestamp", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"PGR\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Property Tax", - "Trade Licence", - "PGR" - ], - "insight": { - }, - "_comment": " totalApplication is the chartId" - }, - "totalApplication&ClosedApplication": { - "chartName": "DSS_TOTAL_APPLICATION_&_CLOSED_APPLICATION", - "queries": [ - { - "module": "PT", - "dateRefField": "Data.@timestamp", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId.keyword\" \r\n}", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"date_histogram\":{\"field\":\"Data.@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.propertyId.keyword\"}}}},\"Closed Application\":{\"date_histogram\":{\"field\":\"Data.@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Applications Closed\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.status.keyword\":[\"closed\",\"resolved\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.propertyId.keyword\"}}}}}}}}}}" - }, - { - "module": "TL", - "dateRefField": "Data.tradelicense.applicationdate", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tradelicense.tenantid.keyword\" \r\n}", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"date_histogram\":{\"field\":\"Data.tradelicense.applicationdate\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tradelicense.applicationnumber.keyword\"}}}},\"Closed Application\":{\"date_histogram\":{\"field\":\"Data.tradelicense.applicationdate\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Applications Closed\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.status.keyword\":[\"closed\",\"resolved\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tradelicense.applicationnumber.keyword\"}}}}}}}}}}" - - }, - { - "module": "PGR", - "dateRefField": "Data.dateOfComplaint", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tenantId\" \r\n}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Closed Application\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Applications Closed\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.status.keyword\":[\"closed\",\"resolved\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}}}" - - } - ], - "chartType": "line", - "valueType": "number", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Total Application", - "Closed Application" - ], - "isCumulative": false, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - "topPerformingUlbsCompletionRate": { - "chartName": "DSS_PT_TOP_3_PERFORMING_ULBS", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"module\" : \"businessService.keyword\",\"tenantId\" : \"Data.tenantId\" , \"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.@timestamp", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Application\":{\"filter\":{\"term\":{\"Data.status.keyword\":\"resolved\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantId.keyword\",\"order\":{\"_key\":\"asc\"},\"size\":100},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}},\"Total Application\":{\"terms\":{\"field\":\"Data.tenantId.keyword\",\"order\":{\"_key\":\"asc\"},\"size\":100},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}" - }, - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"module\" : \"businessService.keyword\",\"tenantId\" : \"Data.tenantId\" , \"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Application\":{\"filter\":{\"exists\":{\"field\":\"Data.propertyId.keyword\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}},\"Total Application\":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}" - }, - { - "module": "TL", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"module\" : \"businessService.keyword\",\"tenantId\" : \"Data.tenantData.code\" , \"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.tradelicense.applicationdate", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Application\":{\"filter\":{\"exists\":{\"field\":\"Data.tradelicense.issueddate\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantData.code.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantData.code.keyword\"}}}}}},\"Total Application\":{\"filter\":{\"exists\":{\"field\":\"Data.tradelicense.applicationdate\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantData.code.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantData.code.keyword\"}}}}}}}}}}" - } - ], - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_COMPLETION_RATE", - "order": "desc", - "limit": 3, - "aggregationPaths": [ - "Closed Application", - "Total Application" - ], - "insight": { - }, - "_comment": " Top Performing Ulbs for Completion rate" - }, - "bottomPerformingUlbsCompletionRate": { - "chartName": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"module\" : \"businessService.keyword\",\"tenantId\" : \"Data.tenantId\" , \"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.@timestamp", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Application\":{\"filter\":{\"term\":{\"Data.status.keyword\":\"resolved\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}},\"Total Application\":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}" - }, - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"module\" : \"businessService.keyword\",\"tenantId\" : \"Data.tenantId\" ,\"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Application\":{\"filter\":{\"exists\":{\"field\":\"Data.propertyId.keyword\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}},\"Total Application\":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}" - }, - { - "module": "TL", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"module\" : \"businessService.keyword\",\"tenantId\" : \"Data.tenantData.code\" , \"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.tradelicense.applicationdate", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Application\":{\"filter\":{\"exists\":{\"field\":\"Data.tradelicense.issueddate\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantData.code.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantData.code.keyword\"}}}}}},\"Total Application\":{\"filter\":{\"exists\":{\"field\":\"Data.tradelicense.applicationdate\"}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.tenantData.code.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.tenantData.code.keyword\"}}}}}}}}}}" - } - ], - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_COMPLETION_RATE", - "order": "asc", - "limit": 3, - "aggregationPaths": [ - "Closed Application", - "Total Application" - ], - "insight": { - }, - "_comment": " Bottom Performing Ulbs for Completion rate" - }, - - "_comment": "COMMON COLLECTION CHARTS", - "targetCollection": { - "chartName": "DSS_TARGET_COLLECTION", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}" - } - ], - "chartType": "metric", - "valueType": "amount", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Target Collection" - ], - "isDayUnit": true, - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "insight": { - }, - "_comment": " " - }, - "collectionByUsageType": { - "chartName": "DSS_PT_COLLECTION_BY_USAGE_TYPE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"Usage Type\":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"size\":200}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "amount", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Usage Type" - ], - "insight": { - }, - "_comment": " collection/amount per usage type" - }, - - "_comment": "PT NON-COLLECTION CHARTS", - "propertiesByUsageType": { - "chartName": "DSS_PT_PROPERTIES_BY_USAGE_TYPE", - "queries": [ - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\",\"module\" : \"Data.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"Data.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Usage Type\":{\"terms\":{\"field\":\"Data.propertyDetails.units.usageCategoryMajor.keyword\"},\"aggs\":{\"Assessed Properties\":{\"value_count\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}" - - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Usage Type" - ], - "insight": { - }, - "_comment": " properties having assessmentNumber per usage type" - }, - "propertiesByTenant": { - "chartName": "DSS_PT_PROPERTIES_BY_USAGE_TYPE", - "queries": [ - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\",\"module\" : \"Data.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"Data.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\"}", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Type\":{\"terms\":{\"field\":\"Data.address.city.keyword\"},\"aggs\":{\"Assessed Properties\":{\"value_count\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}" - - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Type" - ], - "insight": { - }, - "_comment": " properties having assessmentNumber per usage type" - }, - - "propertiesAssessed": { - "chartName": "DSS_PT_TOTAL_PROPERTIES_ASSESSED", - "queries": [ - { - "module": "PT", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Assessed Properties\":{\"value_count\":{\"field\":\"Data.propertyId.keyword\"}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\",\"tenantId\" : \"Data.tenantId\" ,\"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.@timestamp" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Assessed Properties" - ], - "insight": { - "chartResponseMap" : "propertiesAssessed", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " totol properties having assessmentNumber " - }, - "totalAssessment": { - "chartName": "DSS_PT_TOTAL_ASSESSMENTS", - "queries": [ - { - "module": "PT", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Assessed Properties\":{\"value_count\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}", - - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantId\" ,\"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.@timestamp" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Assessed Properties" - ], - "insight": { - "chartResponseMap" : "totalAssessment", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " totol properties having assessmentNumber " - }, - "cumulativePropertiesAssessed": { - "chartName": "DSS_PT_CUMULATIVE_PROPERTIES_ASSESSED", - "queries": [ - { - "module": "PT", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Collections\":{\"date_histogram\":{\"field\":\"Data.@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantId\" ,\"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.@timestamp" - } - ], - "chartType": "line", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Collections" - ], - "isCumulative": true, - "interval": "week", - "insight": { - }, - "_comment": " totol properties having assessmentNumber " - }, - "activeUlbs": { - "chartName": "DSS_PT_TOTAL_ACTIVE_ULBS", - "queries": [ - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Active ULBs\":{\"cardinality\":{\"field\":\"Data.tenantId.keyword\"}}}}}}" - }, - { - "module": "TL", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\"}", - "dateRefField": "Data.tradelicense.@timestamp", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantData.code.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Active ULBs\":{\"cardinality\":{\"field\":\"Data.tenantData.code.keyword\"}}}}}}" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Active ULBs" - ], - "insight": { - "chartResponseMap" : "activeUlbs", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " total ULBs count" - }, - - "_comment": "PT COLLECTION CHARTS (Tax heads)", - - "_comment": "PT COLLECTION CHARTS (Demands) ", - "demandCollectionIndexDDRRevenue": { - "chartName": "DSS_PT_KEY_FY_INDICATORS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "demandCollectionIndexBoundaryRevenue", - "action": "", - "plotLabel": "DDRs", - "isPostResponseHandler": true, - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "demandCollectionIndexBoundaryRevenue": { - "chartName": "DSS_PT_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"domainObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":1000},\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "postAggregationTheory" : "repsonseToDifferenceOfDates", "chartType": "table", - "valueType": "number", - "drillChart": "boundaryDrillDown", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "boundaryDrillDown": { - "kind": "drillDown", - "chartName": "Boundary", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\",\"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"domainObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}" - } - ], - "chartType": "table", - "valueType": "number", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "plotLabel": "Ward", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - - - "_comment": " PT Nested Array related new queries", - "taxHeadsBreakupDDRRevenue": { - "chartName": "DSS_PT_TAX_HEAD_BREAKUP_REVENUE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.totalAmount\"}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Time Interest\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_INTEREST\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Round Off\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_ROUNDOFF\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "taxHeadsBreakupRevenue", - "isPostResponseHandler": true, - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPaths": [ - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty", - "Time Interest","Round Off" - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AdditiveComputedField", - "fields" : [ "PT Tax", "Fire Cess", "Cancer Cess", "Rebate", "Penalty", "Time Interest","Round Off"], - "newField" : "Total Amount", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "insight": { - }, - "_comment": "" - }, - "taxHeadsBreakupRevenue": { - "chartName": "DSS_PT_TAX_HEAD_BREAKUP_REVENUE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"PT Tax>aggrFilter>amount\",\"c2\":\"Fire Cess>aggrFilter>amount\",\"c3\":\"Cancer Cess>aggrFilter>amount\",\"c4\":\"Rebate>aggrFilter>amount\",\"c5\":\"Penalty>aggrFilter>amount\",\"c6\":\"Time Interest>aggrFilter>amount\",\"c7\":\"Round Off>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3+params.c4+params.c5+params.c6+params.c7\"}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Time Interest\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_INTEREST\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Round Off\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_ROUNDOFF\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "taxHeadsBreakupBoundaryDrill", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty", - "Time Interest","Round Off", "Total Amount" - ], - - "insight": { - }, - "_comment": "" - }, - "taxHeadsBreakupBoundaryDrill": { - "chartName": "Tax head Breakup boundary", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"usageId\" : \"domainObject.propertyDetails.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"domainObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"PT Tax>aggrFilter>amount\",\"c2\":\"Fire Cess>aggrFilter>amount\",\"c3\":\"Cancer Cess>aggrFilter>amount\",\"c4\":\"Rebate>aggrFilter>amount\",\"c5\":\"Penalty>aggrFilter>amount\",\"c6\":\"Time Interest>aggrFilter>amount\",\"c7\":\"Round Off>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3+params.c4+params.c5+params.c6+params.c7\"}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Time Interest\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_INTEREST\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Round Off\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_ROUNDOFF\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty", - "Time Interest","Round Off","Total Amount" - ], - - "insight": { - }, - "_comment": "" - }, - - "taxHeadsBreakupUsage": { - "chartName": "DSS_PT_TAX_HEAD_BREAKUP_USAGE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"Usage \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"nested\":{\"path\":\"dataObject.Bill.taxAndPayments\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.taxAndPayments.businessService.keyword\":[\"PT\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.taxAndPayments.taxAmount\"}}}}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}}}" - } - ], - "filterKeys": [ - - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "documentType": "_doc", - "action": "", - "plotLabel": "Usage Type", - "aggregationPaths": [ - "Total Amount", - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty" - ], - "pathDataTypeMapping": [ - { - "Total Amount": "amount" - }, - { - "PT Tax": "amount" - }, - { - "Fire Cess": "amount" - }, - { - "Cancer Cess": "amount" - }, - { - "Rebate": "amount" - }, - { - "Penalty": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "taxHeadsBreakupUsageMinor": { - "chartName": "", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"usageId\" : \"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.units.usageCategoryMinor.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"Usage \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMinor.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"nested\":{\"path\":\"dataObject.Bill.taxAndPayments\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.taxAndPayments.businessService.keyword\":[\"PT\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.taxAndPayments.taxAmount\"}}}}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "minorUsageId", "column": "Minor Usage Type"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "taxHeadsBreakupUsageSubMinor", - "documentType": "_doc", - "action": "", - "plotLabel": "Minor Usage Type", - "aggregationPaths": [ - "Total Amount", - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty" - ], - "pathDataTypeMapping": [ - { - "Total Amount": "amount" - }, - { - "PT Tax": "amount" - }, - { - "Fire Cess": "amount" - }, - { - "Cancer Cess": "amount" - }, - { - "Rebate": "amount" - }, - { - "Penalty": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "taxHeadsBreakupUsageSubMinor": { - "chartName": "", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"usageId\" : \"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.units.usageCategoryMinor.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"Usage \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategorySubMinor.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"nested\":{\"path\":\"dataObject.Bill.taxAndPayments\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.taxAndPayments.businessService.keyword\":[\"PT\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.taxAndPayments.taxAmount\"}}}}}},\"PT Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Fire Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_FIRE_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Cancer Cess\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_CANCER_CESS\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"PT_TIME_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}}}" - } - ], - "filterKeys": [ - "" - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "documentType": "_doc", - "action": "", - "plotLabel": "Sub Minor Usage Type", - "aggregationPaths": [ - "Total Amount", - "PT Tax", - "Fire Cess", - "Cancer Cess", - "Rebate", - "Penalty" - ], - "pathDataTypeMapping": [ - { - "Total Amount": "amount" - }, - { - "PT Tax": "amount" - }, - { - "Fire Cess": "amount" - }, - { - "Cancer Cess": "amount" - }, - { - "Rebate": "amount" - }, - { - "Penalty": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "demandCollectionIndexUsageRevenue": { - "chartName": "DSS_PT_DEMAND_COLLECTION_USAGETYPE", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\",\"usageId\" : \"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.units.usageCategoryMinor.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"UsageType \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}},\"Transactions\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"cardinality\":{\"field\":\"dataObject.transactionId.keyword\"}}}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"attr\":{\"cardinality\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}}}", - "aggrQuerybc": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}}],\"must\":[{\"term\":{\"dataObject.Bill.billDetails.status.keyword\":\"Approved\"}}]}},\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"UsageType \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"Data.propertyDetails\"},\"aggs\":{\"attr\":{\"cardinality\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "drillFields": [ - "Ward", - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Usage Type", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "usageRevenueDrillDownMinor": { - "chartName": "", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"usageId\" : \"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.units.usageCategoryMinor.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"UsageType \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMinor.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}},\"Transactions\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"cardinality\":{\"field\":\"dataObject.transactionId.keyword\"}}}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"attr\":{\"cardinality\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}}}", - "aggrQuerybc": "{\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"UsageType \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategoryMinor.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"Data.propertyDetails\"},\"aggs\":{\"attr\":{\"cardinality\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "minorUsageId", "column": "Minor Usage Type"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "usageRevenueDrillDownSubMinor", - "documentType": "_doc", - "action": "", - "plotLabel": "Minor Usage Type", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "usageRevenueDrillDownSubMinor": { - "chartName": "", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"usageId\" : \"domainObject.propertyDetails.units.usageCategoryMajor.keyword\",\"minorUsageId\" : \"domainObject.propertyDetails.units.usageCategoryMinor.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"UsageType \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategorySubMinor.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}}}},\"Transactions\":{\"reverse_nested\":{},\"aggs\":{\"top_tags_per_comment\":{\"cardinality\":{\"field\":\"dataObject.transactionId.keyword\"}}}},\"Assessed Properties\":{\"nested\":{\"path\":\"domainObject.propertyDetails\"},\"aggs\":{\"attr\":{\"cardinality\":{\"field\":\"domainObject.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}}}", - "aggrQuerybc": "{\"aggs\":{\"attrs_root\":{\"nested\":{\"path\":\"domainObject.propertyDetails.units\"},\"aggs\":{\"UsageType \":{\"terms\":{\"field\":\"domainObject.propertyDetails.units.usageCategorySubMinor.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Assessed Properties\":{\"nested\":{\"path\":\"Data.propertyDetails\"},\"aggs\":{\"attr\":{\"cardinality\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}}}" - } - ], - "filterKeys": [ - - ], - "chartType": "table", - "valueType": "number", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "plotLabel": "Sub Minor Usage Type", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Assessed Properties" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Assessed Properties": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - - - - "_comment": "TL COLLECTION CHARTS", - - "licenseIssuedDDRRevenue": { - "chartName": "DSS_TL_KEY_FY_INDICATORS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Total Licence Issued\":{\"value_count\":{\"field\":\"domainObject.tradelicense.licensenumber.keyword\"}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "isPostResponseHandler": true, - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "chartType": "table", - "valueType": "number", - "drillChart": "licenseIssuedBoundaryRevenue", - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Total Licence Issued", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Total Licence Issued": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "licenseIssuedBoundaryRevenue": { - "chartName": "DSS_TL_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Total Licence Issued\":{\"value_count\":{\"field\":\"domainObject.tradelicense.licensenumber.keyword\"}}}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":1000},\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "chartType": "table", - "valueType": "number", - "drillChart": "licenseIssuedBoundaryDrillDown", - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Total Licence Issued", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Total Licence Issued": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "licenseIssuedBoundaryDrillDown": { - "chartName": "", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"domainObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Total Licence Issued\":{\"value_count\":{\"field\":\"domainObject.tradelicense.licensenumber.keyword\"}}}}}}}}" - } - ], - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "chartType": "table", - "valueType": "number", - "drillChart": "", - "documentType": "_doc", - "action": "", - "plotLabel": "Ward", - "aggregationPaths": [ - "Total Collection", - "Transactions", - "Total Licence Issued", - "Target Collection" - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Transactions": "number" - }, - { - "Total Licence Issued": "number" - }, - { - "Target Collection": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - - "_comment": " TL Nested Array related newer queries", - "licenceTaxHeadsBreakupDDR": { - "chartName": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Total Amount\":{\"nested\":{\"path\":\"dataObject.Bill.taxAndPayments\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.taxAndPayments.businessService.keyword\":[\"TL\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.taxAndPayments.taxAmount\"}}}}}},\"TL Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "isPostResponseHandlerA": true, - "chartType": "xtable", - "valueType": "number", - "drillChart": "licenceTaxHeadsBreakupBoundary", - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPaths": [ - "TL Tax", - "Adhoc Penalty", - "Adhoc Rebate" - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AdditiveComputedField", - "fields" : ["TL Tax", "Adhoc Penalty", "Adhoc Rebate"], - "newField" : "Total Amount", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - - "insight": { - }, - "_comment": "" - }, - "licenceTaxHeadsBreakupBoundary": { - "chartName": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"TL Tax>aggrFilter>amount\",\"c2\":\"Adhoc Penalty>aggrFilter>amount\",\"c3\":\"Adhoc Rebate>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3\"}}},\"TL Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "licenceTaxHeadsBreakupWard", - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "TL Tax", - "Adhoc Penalty", - "Adhoc Rebate","Total Amount" - ], - "insight": { - }, - "_comment": "" - }, - "licenceTaxHeadsBreakupWard": { - "chartName": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.ward.name.keyword\",\"size\":200},\"aggs\":{\"Total Amount\":{\"bucket_script\":{\"buckets_path\":{\"c1\":\"TL Tax>aggrFilter>amount\",\"c2\":\"Adhoc Penalty>aggrFilter>amount\",\"c3\":\"Adhoc Rebate>aggrFilter>amount\"},\"script\":{\"source\":\"params.c1+params.c2+params.c3\"}}},\"TL Tax\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_TAX\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Penalty\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_PENALTY\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}},\"Adhoc Rebate\":{\"nested\":{\"path\":\"dataObject.Bill.billDetails.billAccountDetails\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"dataObject.Bill.billDetails.billAccountDetails.taxHeadCode.keyword\":[\"TL_ADHOC_REBATE\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.billAccountDetails.amount\"}}}}}}}}}}}}" - } - ], - "filterKeys": [ - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "", - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "TL Tax", - "Adhoc Penalty", - "Adhoc Rebate", "Total Amount" - ], - "insight": { - }, - "_comment": "" - }, - - - "_comment": "TL NON-COLLECTION CHARTS", - "licenseIssued": { - "chartName": "DSS_TL_LICENSE_ISSUED", - "queries": [ - { - "module": "TL", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\": {\"License Issued\": {\"value_count\": {\"field\": \"Data.tradelicense.licensenumber.keyword\"}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \r\n \"district\" : \"Data.tenantData.city.districtCode\", \r\n\"tenantId\" : \"Data.tradelicense.tenantid\" \r\n, \r\n\"businessService\" : \"dataObject.Bill.billDetails.businessServices\" \r\n}", - "dateRefField": "Data.tradelicense.issueddate" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "License Issued" - ], - "insight": { - "chartResponseMap" : "licenseIssued", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " licenseIssued is the Chart ID" - }, - "cumulativeLicenseIssued": { - "chartName": "DSS_TL_CUMULATIVE_LICENSE_ISSUED", - "queries": [ - { - "module": "TL", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Trade Licence Issued\":{\"date_histogram\":{\"field\":\"Data.tradelicense.issueddate\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tradelicense.licensenumber.keyword\"}}}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,\"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.tradelicense.issueddate" - }, - { - "module": "TL", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"date_histogram\":{\"field\":\"Data.tradelicense.applicationdate\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tradelicense.applicationnumber.keyword\"}}}}}}}}", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,\"district\" : \"Data.tenantData.city.districtCode\"}", - "dateRefField": "Data.tradelicense.applicationdate" - } - ], - "chartType": "line", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Trade Licence Issued", - "Total Application" - ], - "isCumulative": true, - "interval": "month", - "insight": { - }, - "_comment": " Total Number of License having issued" - }, - "licenseApplicationByStatus": { - "chartName": "DSS_TL_LICENSE_BY_STATUS", - "queries": [ - { - "module": "TL", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\", \"district\" : \"Data.tenantData.cityDistrictCode\"}", - "dateRefField": "Data.tradelicense.issueddate", - "indexName": "tlindex-v1", - "aggrQueryBc": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Status\":{\"terms\":{\"field\":\"Data.tradelicense.status.keyword\"},\"aggs\":{\"License Issued\":{\"value_count\":{\"field\":\"Data.tradelicense.status.keyword\"}}}}}}}}", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Status\":{\"terms\":{\"field\":\"Data.tradelicense.status.keyword\",\"size\":1000,\"min_doc_count\":0},\"aggs\":{\"License Issued\":{\"cardinality\":{\"field\":\"Data.tradelicense.licensenumber.keyword\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Status" - ], - "insight": { - }, - "_comment": " License Application which are issued by License Type" - }, - "slaAchieved": { - "chartName": "DSS_SLA_ACHIEVED", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \r\n \"module\" : \"businessService.keyword\", \n\"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}, \"withinSLA\":{\"range\":{\"script\":{\"lang\":\"painless\",\"source\":\"doc['Data.slaHours'].value\"},\"ranges\":[{\"key\":\"Within SLA\",\"from\":0,\"to\":360}]}}}}}}" - } - ], - "chartType": "metric", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "aggregationPaths": [ - "withinSLA", - "Total Application" - ], - "insight": { - "chartResponseMap" : "slaAchieved", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " SLA Achieved Percentage " - }, - "tlStatusByDDR": { - "chartName": "DSS_TL_STATUS_BY_DDR", - "queries": [ - { - "module": "TL", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tradelicense.tenantid.keyword\" }", - "dateRefField": "Data.tradelicense.issueddate", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Status\":{\"terms\":{\"field\":\"Data.tradelicense.status.keyword\",\"size\":1000,\"min_doc_count\":0},\"aggs\":{\"License Issued\":{\"value_count\":{\"field\":\"Data.tradelicense.licensenumber.keyword\"}}}}}}}}", - "aggrQueryBC": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Status\":{\"filters\":{\"filters\":{\"Approved\":{\"match\":{\"Data.tradelicense.status.keyword\":\"APPROVED\"}},\"Initiated\":{\"match\":{\"Data.tradelicense.status.keyword\":\"INITIATED\"}},\"Applied\":{\"match\":{\"Data.tradelicense.status.keyword\":\"APPLIED\"}},\"Rejected\":{\"match\":{\"Data.tradelicense.status.keyword\":\"REJECTED\"}},\"Pending Approval\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PENDINGAPPROVAL\"}},\"Field Inspection\":{\"match\":{\"Data.tradelicense.status.keyword\":\"FIELDINSPECTION\"}},\"Cancelled\":{\"match\":{\"Data.tradelicense.status.keyword\":\"CANCELLED\"}},\"Pending Payment\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PENDINGPAYMENT\"}},\"Paid\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PAID\"}}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "tlStatusByTenant", - "drillFields": [ - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPathsA": [ - "Approved", - "Initiated", - "Applied", - "Rejected", - "Pending Approval", - "Field Inspection", - "Cancelled", - "Pending Payment", - "Paid" - ], - "pathDataTypeMappingA": [ - { - "Approved": "number" - }, - { - "Initiated": "number" - }, - { - "Applied": "number" - }, - { - "Rejected": "number" - }, - { - "Pending Approval": "number" - }, - { - "Field Inspection": "number" - }, - { - "Cancelled": "number" - }, - { - "Pending Payment": "number" - }, - { - "Paid": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "tlStatusByTenant": { - "chartName": "DSS_TL_STATUS_BY_TENANT", - "queries": [ - { - "module": "TL", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tradelicense.tenantid.keyword\" }", - "dateRefField": "Data.tradelicense.issueddate", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"Data.tradelicense.tenantid.keyword\",\"size\":1000},\"aggs\":{\"Status\":{\"terms\":{\"field\":\"Data.tradelicense.status.keyword\",\"size\":1000,\"min_doc_count\":0},\"aggs\":{\"License Issued\":{\"value_count\":{\"field\":\"Data.tradelicense.licensenumber.keyword\"}}}}}}}}}}", - "aggrQueryBc": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"Data.tradelicense.tenantId.keyword\",\"size\":1000},\"aggs\":{\"Status\":{\"filters\":{\"filters\":{\"Approved\":{\"match\":{\"Data.tradelicense.status.keyword\":\"APPROVED\"}},\"Initiated\":{\"match\":{\"Data.tradelicense.status.keyword\":\"INITIATED\"}},\"Applied\":{\"match\":{\"Data.tradelicense.status.keyword\":\"APPLIED\"}},\"Rejected\":{\"match\":{\"Data.tradelicense.status.keyword\":\"REJECTED\"}},\"Pending Approval\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PENDINGAPPROVAL\"}},\"Field Inspection\":{\"match\":{\"Data.tradelicense.status.keyword\":\"FIELDINSPECTION\"}},\"Cancelled\":{\"match\":{\"Data.tradelicense.status.keyword\":\"CANCELLED\"}},\"Pending Payment\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PENDINGPAYMENT\"}},\"Paid\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PAID\"}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "tlStatusByTenantDrillDown", - "drillFields": [ - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "ULBs", - "aggregationPaths": [ - - ], - "pathDataTypeMapping": [ - - ], - "insight": { - }, - "_comment": "" - }, - "tlStatusByTenantDrillDown": { - "chartName": "DSS_TL_STATUS_BY_WARD", - "queries": [ - { - "module": "TL", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tradelicense.tenantid.keyword\" }", - "dateRefField": "Data.tradelicense.issueddate", - "indexName": "tlindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantid.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"Data.ward.name.keyword\",\"size\":1000},\"aggs\":{\"Status\":{\"terms\":{\"field\":\"Data.tradelicense.status.keyword\",\"size\":1000,\"min_doc_count\":0},\"aggs\":{\"License Issued\":{\"value_count\":{\"field\":\"Data.tradelicense.licensenumber.keyword\"}}}}}}}}}}", - "aggrQueryBc": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tradelicense.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"Data.ward.name.keyword\",\"size\":1000},\"aggs\":{\"Status\":{\"filters\":{\"filters\":{\"Approved\":{\"match\":{\"Data.tradelicense.status.keyword\":\"APPROVED\"}},\"Initiated\":{\"match\":{\"Data.tradelicense.status.keyword\":\"INITIATED\"}},\"Applied\":{\"match\":{\"Data.tradelicense.status.keyword\":\"APPLIED\"}},\"Rejected\":{\"match\":{\"Data.tradelicense.status.keyword\":\"REJECTED\"}},\"Pending Approval\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PENDINGAPPROVAL\"}},\"Field Inspection\":{\"match\":{\"Data.tradelicense.status.keyword\":\"FIELDINSPECTION\"}},\"Cancelled\":{\"match\":{\"Data.tradelicense.status.keyword\":\"CANCELLED\"}},\"Pending Payment\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PENDINGPAYMENT\"}},\"Paid\":{\"match\":{\"Data.tradelicense.status.keyword\":\"PAID\"}}}}}}}}}}}" - } - ], - "filterKeys": [ - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "", - "drillFields": [ - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Ward", - "aggregationPathsA": [ - "Approved", - "Initiated", - "Applied", - "Rejected", - "Pending Approval", - "Field Inspection", - "Cancelled", - "Pending Payment", - "Paid" - ], - "pathDataTypeMappingA": [ - { - "Approved": "number" - }, - { - "Initiated": "number" - }, - { - "Applied": "number" - }, - { - "Rejected": "number" - }, - { - "Pending Approval": "number" - }, - { - "Field Inspection": "number" - }, - { - "Cancelled": "number" - }, - { - "Pending Payment": "number" - }, - { - "Paid": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - - "_comment": "Enhanced table charts..TODO: refactor to remove xtable type ", - "xlicenseIssuedBoundaryRevenue": { - "chartName": "DSS_TL_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"wardId\" : \"domainObject.ward.name.keyword\",\"module\" : \"dataObject.Bill.billDetails.businessService.keyword\", \"tenantId\" : \"dataObject.tenantId\", \"district\" : \"dataObject.tenantData.cityDistrictCode\" }", - "dateRefField": "dataObject.Bill.billDetails.receiptDate", - "indexName": "dss-collection_v2", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"dataObject.tenantId.keyword\":\"pb.testing\"}},{\"terms\":{\"dataObject.Bill.billDetails.status.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"dataObject.tenantId.keyword\",\"size\":200,\"min_doc_count\":0},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"dataObject.Bill.billDetails.amountPaid\"}},\"Transactions\":{\"value_count\":{\"field\":\"dataObject.transactionId.keyword\"}},\"Total Licence Issued\":{\"value_count\":{\"field\":\"domainObject.tradelicense.licensenumber.keyword\"}}}}}}}}" - }, - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"tenantIdForMunicipalCorporation.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"tenantIdForMunicipalCorporation.keyword\",\"size\":1000,\"min_doc_count\":0},\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "chartType": "xtable", - "valueType": "number", - "drillChart": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - ], - "computedFields": [ - { - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "actionName": "PercentageComputedField", - "fields" : ["Target Collection", "Total Collection"], - "newField" : "Target Achieved", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - }, - { - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "actionName": "PercentageComputedField", - "fields" : ["Target Collection", "Total Collection"], - "newField" : "Target Achieved", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "pathDataTypeMapping": [ - ], - "insight": { - }, - "_comment": "" - }, - "xptFyByDDR": { - "chartName": "DSS_TL_STATUS_BY_TENANT", - "queries": [ - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\",\"tenantId\" : \"Data.tenantId.keyword\" }", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Fys\":{\"terms\":{\"field\":\"Data.propertyDetails.financialYear.keyword\",\"min_doc_count\":0}}}}}}" - }, - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" }", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total\":{\"value_count\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "xptFyByTenant", - "plotLabel": "DDRs", - "insight": { - }, - "_comment": "" - }, - "xptFyByTenant": { - "chartName": "DSS_TL_STATUS_BY_TENANT", - "queries": [ - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\",\"tenantId\" : \"Data.tenantId.keyword\" }", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBS \":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"Fys\":{\"terms\":{\"field\":\"Data.propertyDetails.financialYear.keyword\",\"min_doc_count\":0}}}}}}}}" - }, - { - "module": "PT", - "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\",\"tenantId\" : \"Data.tenantId.keyword\" }", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBS \":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"Total\":{\"value_count\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "xptFyByWard", - "plotLabel": "Boundary", - "insight": { - }, - "_comment": "" - }, - "xptFyByWard": { - "chartName": "DSS_TL_STATUS_BY_TENANT", - "queries": [ - { - "module": "PT", - "requestQueryMap": "{\"tenantId\" : \"Data.tenantId.keyword\" , \"wardId\" : \"Data.ward.name.keyword\"}", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"Data.ward.name.keyword\"},\"aggs\":{\"Fys\":{\"terms\":{\"field\":\"Data.propertyDetails.financialYear.keyword\",\"min_doc_count\":0}}}}}}}}" - }, - { - "module": "PT", - "requestQueryMap": "{\"tenantId\" : \"Data.tenantId.keyword\" , \"wardId\" : \"Data.ward.name.keyword\"}", - "dateRefField": "Data.@timestamp", - "indexName": "ptindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"Data.ward.name.keyword\"},\"aggs\":{\"Total\":{\"value_count\":{\"field\":\"Data.propertyDetails.assessmentNumber.keyword\"}}}}}}}}" - } - ], - "filterKeys": [ - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "none", - "plotLabel": "Wards", - "insight": { - }, - "_comment": "" - }, - - "xpgrStatusByDDR": { - "chartName": "DSS_PGR_STATUS_BY_TENANT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"withinSLA\":{\"range\":{\"script\":{\"lang\":\"painless\",\"source\":\"doc['Data.slaHours'].value\"},\"ranges\":[{\"key\":\"withinSLA\",\"from\":0,\"to\":360}]}},\"Total Complaints\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}},\"Closed_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"closed\",\"rejected\",\"resolved\"]}},\"aggs\":{\"Closed Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Open_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"open\"]}},\"aggs\":{\"Open Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Reopened_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"reopen\"]}},\"aggs\":{\"Reopened Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "xpgrStatusByTenant", - "plotLabel": "DDRs", - "excludedColumns": ["withinSLA"], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Closed Complaints", "Total Complaints"], - "newField" : "Completion Rate", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - }, - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["withinSLA","Total Complaints"], - "newField" : "Sla Achieved", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "insight": { - }, - "_comment": "" - }, - "xpgrStatusByTenant": { - "chartName": "DSS_PGR_STATUS_BY_TENANT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"Data.tenantId.keyword\",\"size\":1000},\"aggs\":{\"withinSLA\":{\"range\":{\"script\":{\"lang\":\"painless\",\"source\":\"doc['Data.slaHours'].value\"},\"ranges\":[{\"key\":\"withinSLA\",\"from\":0,\"to\":360}]}},\"Total Complaints\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}},\"Closed_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"closed\",\"rejected\",\"resolved\"]}},\"aggs\":{\"Closed Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Open_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"open\"]}},\"aggs\":{\"Open Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Reopened_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"reopen\"]}},\"aggs\":{\"Reopened Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "xpgrStatusByWard", - "plotLabel": "Boundary", - "excludedColumns": ["withinSLA"], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Closed Complaints", "Total Complaints"], - "newField" : "Completion Rate", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - }, - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Total Complaints", "withinSLA"], - "newField" : "Sla Achieved", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "insight": { - }, - "_comment": "" - }, - "xpgrStatusByWard": { - "chartName": "DSS_PGR_STATUS_BY_TENANT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"Data.complaintWard.name.keyword\",\"size\":1000},\"aggs\":{\"withinSLA\":{\"range\":{\"script\":{\"lang\":\"painless\",\"source\":\"doc['Data.slaHours'].value\"},\"ranges\":[{\"key\":\"withinSLA\",\"from\":0,\"to\":360}]}},\"Total Complaints\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}},\"Closed_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"closed\",\"rejected\",\"resolved\"]}},\"aggs\":{\"Closed Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Open_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"open\"]}},\"aggs\":{\"Open Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Reopened_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"reopen\"]}},\"aggs\":{\"Reopened Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "none", - - "documentType": "_doc", - "action": "", - "plotLabel": "Ward", - "excludedColumns": ["withinSLA"], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Closed Complaints", "Total Complaints"], - "newField" : "Completion Rate", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - }, - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Total Complaints", "withinSLA"], - "newField" : "Sla Achieved", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "insight": { - }, - "_comment": "" - }, - "xpgrStatusByDept": { - "chartName": "DSS_PGR_STATUS_BY_TENANT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\",\"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Department \":{\"terms\":{\"field\":\"Data.department.keyword\",\"size\":1000},\"aggs\":{\"withinSLA\":{\"range\":{\"script\":{\"lang\":\"painless\",\"source\":\"doc['Data.slaHours'].value\"},\"ranges\":[{\"key\":\"withinSLA\",\"from\":0,\"to\":360}]}},\"Total Complaints\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}},\"Closed_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"closed\",\"rejected\",\"resolved\"]}},\"aggs\":{\"Closed Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Open_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"open\"]}},\"aggs\":{\"Open Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Reopened_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"reopen\"]}},\"aggs\":{\"Reopened Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "departmentId", "column": "Department"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "xpgrStatusByCatagory", - - "documentType": "_doc", - "action": "", - "plotLabel": "Department", - "excludedColumns": ["withinSLA"], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Closed Complaints", "Total Complaints"], - "newField" : "Completion Rate", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - }, - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Total Complaints", "withinSLA"], - "newField" : "Sla Achieved", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "insight": { - }, - "_comment": "" - }, - "xpgrStatusByCatagory": { - "chartName": "DSS_PGR_STATUS_BY_TENANT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Category \":{\"terms\":{\"field\":\"Data.complainCategory.keyword\",\"size\":1000},\"aggs\":{\"withinSLA\":{\"range\":{\"script\":{\"lang\":\"painless\",\"source\":\"doc['Data.slaHours'].value\"},\"ranges\":[{\"key\":\"withinSLA\",\"from\":0,\"to\":360}]}},\"Total Complaints\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}},\"Closed_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"closed\",\"rejected\",\"resolved\"]}},\"aggs\":{\"Closed Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Open_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"open\"]}},\"aggs\":{\"Open Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Reopened_Complaints\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"reopen\"]}},\"aggs\":{\"Reopened Complaints\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "departmentId", "column": "Department"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "none", - - "documentType": "_doc", - "action": "", - "plotLabel": "Complaint Category", - "excludedColumns": ["withinSLA"], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Closed Complaints", "Total Complaints"], - "newField" : "Completion Rate", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - }, - { - "postAggregationTheory" : "", - "actionName": "PercentageComputedField", - "fields" : ["Total Complaints", "withinSLA"], - "newField" : "Sla Achieved", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "insight": { - }, - "_comment": "" - }, - - "_comment": "PGR NON-COLLECTION CHARTS", - "completionRate": { - "chartName": "DSS_PGR_COMPLETION_RATE", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Complaints\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}},\"Closed Complaints\":{\"filters\":{\"filters\":{\"closed\":{\"match\":{\"Data.status.keyword\":\"closed\"}},\"resolved\":{\"match\":{\"Data.status.keyword\":\"resolved\"}},\"rejected\":{\"match\":{\"Data.status.keyword\":\"rejected\"}}}}}}}}}" - } - ], - "chartType": "metric", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "aggregationPaths": [ - "Closed Complaints", - "Total Complaints" - ], - "insight": { - "chartResponseMap" : "completionRate", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " Total Number of Complaints " - }, - "totalComplaints": { - "chartName": "DSS_PGR_TOTAL_COMPLAINTS", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Complaints\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}" - } - ], - "chartType": "metric", - "valueType": "number", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Total Complaints" - ], - "insight": { - "chartResponseMap" : "totalComplaints", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " Total Number of Complaints " - }, - "closedComplaints": { - "chartName": "DSS_PGR_CLOSED_COMPLAINTS", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Complaints\":{\"filters\":{\"filters\":{\"closed\":{\"match\":{\"Data.status.keyword\":\"closed\"}},\"resolved\":{\"match\":{\"Data.status.keyword\":\"resolved\"}},\"rejected\":{\"match\":{\"Data.status.keyword\":\"rejected\"}}}}}}}}}" - } - ], - "chartType": "metric", - "valueType": "number", - "drillChart": "none", - "documentType": "_doc", - "action": "", - "aggregationPaths": [ - "Closed Complaints" - ], - "insight": { - "chartResponseMap" : "closedComplaints", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " Total Number of Closed Complaints " - }, - "cumulativeClosedComplaints": { - "chartName": "DSS_TOTAL_CUMULATIVE_CLOSED_COMPLAINTS", - "queries": [ - { - "module": "PGR", - "dateRefField": "Data.dateOfComplaint", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\",\"tenantId\" : \"Data.tenantId\"}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Complaints\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}},\"Closed Complaints\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Closed\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"closed\",\"rejected\",\"resolved\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}},\"Reopened Complaints\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Reopened\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"reopened\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.tenantId.keyword\"}}}}}}}}}}" - } - ], - "chartType": "line", - "valueType": "number", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Closed Complaints", - "Reopened Complaints", - "Total Complaints" - - ], - "isCumulative": true, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - "totalComplaintsbySource": { - "chartName": "DSS_PGR_TOTAL_COMPLAINTS_BY_SOURCE", - "queries": [ - { - "module": "PGR", - "dateRefField": "Data.dateOfComplaint", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ivr\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"ivr\":{\"filter\":{\"terms\":{\"Data.source.keyword\":[\"ivr\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}},\"Web\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"web\":{\"filter\":{\"terms\":{\"Data.source.keyword\":[\"web\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}},\"Whatsapp\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"whatapp\":{\"filter\":{\"terms\":{\"Data.source.keyword\":[\"whatsapp\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}},\"Mobileapp\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"mobileapp\":{\"filter\":{\"terms\":{\"Data.source.keyword\":[\"mobileapp\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}}}" - } - ], - "chartType": "line", - "valueType": "number", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Ivr", - "Web", - "Whatsapp", - "Mobileapp" - ], - "isCumulative": false, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - "totalComplaintsbyStatus": { - "chartName": "DSS_PGR_TOTAL_COMPLAINTS_BY_STATUS", - "queries": [ - { - "module": "PGR", - "dateRefField": "Data.dateOfComplaint", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\",\"tenantId\" : \"Data.tenantId\"}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Open\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"open\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"open\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}},\"Closed\":{\"date_histogram\":{\"field\":\"Data.dateOfComplaint\",\"interval\":\"intervalvalue\"},\"aggs\":{\"closed\":{\"filter\":{\"terms\":{\"Data.status.keyword\":[\"closed\"]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}}}" - } - ], - "chartType": "line", - "valueType": "number", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Open", - "Closed" - ], - "isCumulative": false, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - "complaintsByStatus": { - "chartName": "DSS_PGR_COMPLAINTS_BY_STATUS", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\",\"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Status\":{\"terms\":{\"field\":\"Data.status.keyword\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Complaints By Status" - ], - "insight": { - }, - "_comment": " Complaints By Their Statuses" - }, - "complaintsByChannel": { - "chartName": "DSS_PGR_COMPLAINTS_BY_CHANNELS", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Channels\":{\"terms\":{\"field\":\"Data.source.keyword\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Complaints By Channels" - ], - "insight": { - }, - "_comment": " Top 3 Channels For Complaints" - }, - "complaintsByCategory": { - "chartName": "DSS_PGR_COMPLAINTS_BY_CATEGORY", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\",\"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Category\":{\"terms\":{\"field\":\"Data.complainCategory.keyword\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Complaints By Category" - ], - "insight": { - }, - "_comment": " Top 3 Channels For Complaints" - }, - "complaintsByTenant": { - "chartName": "DSS_PGR_COMPLAINTS_BY_TENANT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Tenant\":{\"terms\":{\"field\":\"Data.tenantId.keyword\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Complaints By Tenant" - ], - "insight": { - }, - "_comment": " Complaints by Tenant" - }, - "complaintsByDistrict": { - "chartName": "DSS_PGR_COMPLAINTS_BY_DISTRICT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By District\":{\"terms\":{\"field\":\"Data.tenantData.city.districtName.keyword\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Complaints By District" - ], - "insight": { - }, - "_comment": " Complaints by District" - }, - "complaintsByDepartment": { - "chartName": "DSS_PGR_COMPLAINTS_BY_DEPARTMENT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints By Department\":{\"terms\":{\"field\":\"Data.department.keyword\"},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.dateOfComplaint\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Complaints By Department" - ], - "insight": { - }, - "_comment": " Complaints by Department" - }, - "pgrStatusByDDR": { - "chartName": "DSS_PGR_STATUS_BY_DDR", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\",\"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed Complaints\":{\"filters\":{\"filters\":{\"Open\":{\"match\":{\"Data.status.keyword\":\"open\"}},\"Reopen\":{\"match\":{\"Data.status.keyword\":\"reopen\"}},\"Assigned\":{\"match\":{\"Data.status.keyword\":\"assigned\"}},\"Closed\":{\"match\":{\"Data.status.keyword\":\"closed\"}},\"Resolved\":{\"match\":{\"Data.status.keyword\":\"resolved\"}},\"Rejected\":{\"match\":{\"Data.status.keyword\":\"rejected\"}},\"ReassignRequested\":{\"match\":{\"Data.status.keyword\":\"reassignrequested\"}}}}}}}}}" - } - ], - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "pgrStatusByTenant", - "drillFields": [ - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "DDRs", - "aggregationPaths": [ - "Open", - "Reopen", - "Assigned", - "Closed", - "Resolved", - "Rejected", - "ReassignRequested" - ], - "pathDataTypeMapping": [ - { - "Open": "number" - }, - { - "Reopen": "number" - }, - { - "Assigned": "number" - }, - { - "Closed": "number" - }, - { - "Resolved": "number" - }, - { - "Rejected": "number" - }, - { - "ReassignRequested": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "pgrStatusByTenant": { - "chartName": "DSS_PGR_STATUS_BY_TENANT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"Data.tenantId.keyword\",\"size\":1000},\"aggs\":{\"Closed Complaints\":{\"filters\":{\"filters\":{\"Open\":{\"match\":{\"Data.status.keyword\":\"open\"}},\"Reopen\":{\"match\":{\"Data.status.keyword\":\"reopen\"}},\"Assigned\":{\"match\":{\"Data.status.keyword\":\"assigned\"}},\"Closed\":{\"match\":{\"Data.status.keyword\":\"closed\"}},\"Resolved\":{\"match\":{\"Data.status.keyword\":\"resolved\"}},\"Rejected\":{\"match\":{\"Data.status.keyword\":\"rejected\"}},\"ReassignRequested\":{\"match\":{\"Data.status.keyword\":\"reassignrequested\"}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "tenantId", "column": "Boundary"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "pgrStatusWardDrillDown", - "drillFields": [ - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Boundary", - "aggregationPaths": [ - "Open", - "Reopen", - "Assigned", - "Closed", - "Resolved", - "Rejected", - "ReassignRequested" - ], - "pathDataTypeMapping": [ - { - "Open": "number" - }, - { - "Reopen": "number" - }, - { - "Assigned": "number" - }, - { - "Closed": "number" - }, - { - "Resolved": "number" - }, - { - "Rejected": "number" - }, - { - "ReassignRequested": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "pgrStatusWardDrillDown": { - "chartName": "", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ward \":{\"terms\":{\"field\":\"Data.complaintWard.name.keyword\",\"size\":1000},\"aggs\":{\"Closed Complaints\":{\"filters\":{\"filters\":{\"Open\":{\"match\":{\"Data.status.keyword\":\"open\"}},\"Reopen\":{\"match\":{\"Data.status.keyword\":\"reopen\"}},\"Assigned\":{\"match\":{\"Data.status.keyword\":\"assigned\"}},\"Closed\":{\"match\":{\"Data.status.keyword\":\"closed\"}},\"Resolved\":{\"match\":{\"Data.status.keyword\":\"resolved\"}},\"Rejected\":{\"match\":{\"Data.status.keyword\":\"rejected\"}},\"ReassignRequested\":{\"match\":{\"Data.status.keyword\":\"reassignrequested\"}}}}}}}}}}}" - } - ], - "filterKeys": [ - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "drillFields": [ - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Complaint Ward", - "aggregationPaths": [ - "Open", - "Reopen", - "Assigned", - "Closed", - "Resolved", - "Rejected", - "ReassignRequested" - ], - "pathDataTypeMapping": [ - { - "Open": "number" - }, - { - "Reopen": "number" - }, - { - "Assigned": "number" - }, - { - "Closed": "number" - }, - { - "Resolved": "number" - }, - { - "Rejected": "number" - }, - { - "ReassignRequested": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "pgrStatusByDepartment": { - "chartName": "DSS_PGR_STATUS_BY_DEPARTMENT", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" }", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Department \":{\"terms\":{\"field\":\"Data.department.keyword\",\"size\":1000},\"aggs\":{\"Closed Complaints\":{\"filters\":{\"filters\":{\"Open\":{\"match\":{\"Data.status.keyword\":\"open\"}},\"Reopen\":{\"match\":{\"Data.status.keyword\":\"reopen\"}},\"Assigned\":{\"match\":{\"Data.status.keyword\":\"assigned\"}},\"Closed\":{\"match\":{\"Data.status.keyword\":\"closed\"}},\"Resolved\":{\"match\":{\"Data.status.keyword\":\"resolved\"}},\"Rejected\":{\"match\":{\"Data.status.keyword\":\"rejected\"}},\"ReassignRequested\":{\"match\":{\"Data.status.keyword\":\"reassignrequested\"}}}}}}}}}}}" - } - ], - "filterKeys": [ - {"key": "departmentId", "column": "Department"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "pgrStatusCategoryDrillDown", - "documentType": "_doc", - "action": "", - "plotLabel": "Department", - "aggregationPaths": [ - "Open", - "Reopen", - "Assigned", - "Closed", - "Resolved", - "Rejected", - "ReassignRequested" - ], - "pathDataTypeMapping": [ - { - "Open": "number" - }, - { - "Reopen": "number" - }, - { - "Assigned": "number" - }, - { - "Closed": "number" - }, - { - "Resolved": "number" - }, - { - "Rejected": "number" - }, - { - "ReassignRequested": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "pgrStatusCategoryDrillDown": { - "chartName": "", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId.keyword\" , \"departmentId\" : \"Data.department.keyword\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Category \":{\"terms\":{\"field\":\"Data.complainCategory.keyword\",\"size\":1000},\"aggs\":{\"Closed Complaints\":{\"filters\":{\"filters\":{\"Open\":{\"match\":{\"Data.status.keyword\":\"open\"}},\"Reopen\":{\"match\":{\"Data.status.keyword\":\"reopen\"}},\"Assigned\":{\"match\":{\"Data.status.keyword\":\"assigned\"}},\"Closed\":{\"match\":{\"Data.status.keyword\":\"closed\"}},\"Resolved\":{\"match\":{\"Data.status.keyword\":\"resolved\"}},\"Rejected\":{\"match\":{\"Data.status.keyword\":\"rejected\"}},\"ReassignRequested\":{\"match\":{\"Data.status.keyword\":\"reassignrequested\"}}}}}}}}}}}" - } - ], - "filterKeys": [ - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "drillFields": [ - "" - ], - "documentType": "_doc", - "action": "", - "plotLabel": "Complaint Category", - "aggregationPaths": [ - "Open", - "Reopen", - "Assigned", - "Closed", - "Resolved", - "Rejected", - "ReassignRequested" - ], - "pathDataTypeMapping": [ - { - "Open": "number" - }, - { - "Reopen": "number" - }, - { - "Assigned": "number" - }, - { - "Closed": "number" - }, - { - "Resolved": "number" - }, - { - "Rejected": "number" - }, - { - "ReassignRequested": "number" - } - ], - "insight": { - }, - "_comment": "" - }, - "topFiveComplaints": { - "chartName": "DSS_PGR_TOP_COMPLAINTS", - "queries": [ - { - "module": "PGR", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "dateRefField": "Data.dateOfComplaint", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complain Category\":{\"terms\":{\"field\":\"Data.complainCategory.keyword\",\"size\":6,\"order\":{\"Count\":\"desc\"}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.complainCategory.keyword\"}}}}}}}}" - } - ], - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Complain Category" - ], - "insight": { - }, - "_comment": " Complaints By Their Statuses" - }, - "averageTurnAroundTime": { - "chartName": "DSS_AVERAGE_TURN_AROUND_TIME", - "queries": [ - { - "module": "PGR", - "dateRefField": "Data.@timestamp", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"Complaints Average Turn Around Time (in Days)\":{\"date_histogram\":{\"field\":\"Data.@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"each_open\":{\"terms\":{\"field\":\"_id\",\"min_doc_count\":0, \"size\":200},\"aggs\":{\"Open_Complaints\":{\"nested\":{\"path\":\"Data.actionHistory.actions\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"Data.actionHistory.actions.status.keyword\":[\"open\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"Data.actionHistory.actions.when\"}}}}}},\"Closed_Complaints\":{\"nested\":{\"path\":\"Data.actionHistory.actions\"},\"aggs\":{\"aggrFilter\":{\"filter\":{\"terms\":{\"Data.actionHistory.actions.status.keyword\":[\"closed\"]}},\"aggs\":{\"amount\":{\"sum\":{\"field\":\"Data.actionHistory.actions.when\"}}}}}},\"computedValueATA\":{\"bucket_script\":{\"buckets_path\":{\"max\":\"Closed_Complaints>aggrFilter>amount\",\"min\":\"Open_Complaints>aggrFilter>amount\"},\"script\":{\"source\":\"params.max-params.min\"}}}}}}}}}", - "aggrQuerybc": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Complaints Average Turn Around Time (in Days)\":{\"date_histogram\":{\"field\":\"Data.@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"each_open\":{\"terms\":{\"field\":\"_id\",\"min_doc_count\":0},\"aggs\":{\"Open_Complaints\":{\"min\":{\"field\":\"Data.actionHistory.actions.when\"}},\"Closed_Complaints\":{\"max\":{\"field\":\"Data.actionHistory.actions.when\"}},\"computedValueATA\":{\"bucket_script\":{\"buckets_path\":{\"max\":\"Closed_Complaints\",\"min\":\"Open_Complaints\"},\"script\":{\"source\":\"if(params.max == null && params.min == null) {0} else {params.max-params.min}\"}}}}}}}}}}}" - } - ], - "chartType": "line", - "valueType": "days", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Complaints Average Turn Around Time (in Days)" - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AverageComputedField", - "fields" : ["computedValueATA"], - "newField" : "ATA", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - "isCumulative": false, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - "pgrCitizenOnDateRange": { - "chartName": "DSS_PGR_CITIZEN", - "queries": [ - { - "module": "PGR", - "dateRefField": "Data.@timestamp", - "requestQueryMap": "{\"wardId\" : \"Data.complaintWard.name.keyword\", \"tenantId\" : \"Data.tenantId\"}", - "indexName": "pgrindex-v1", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Citizens\":{\"date_histogram\":{\"field\":\"Data.@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"count\":{\"cardinality\":{\"field\":\"Data.citizen.uuid.keyword\"}}}}}}}}" - } - ], - "chartType": "line", - "valueType": "number", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Citizens" - ], - "isCumulative": false, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - - - - - "_comment": "W&S charts below-----------------------------------------------------------------------", - "wstodaysCollection": { - "chartName": "DSS_W&S_TODAYS_COLLECTION", - "queries": [ - { - "module": "W&S", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"range\":{\"@timestamp\":{\"gte\":\"now-24h\",\"lte\":\"now\"}}}],\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"Total collection\":{\"sum\":{\"field\":\"totalamount\"}}}}}}", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "" - } - ], - "chartType": "metric", - "valueType": "number", - "action": "", - "drillChart": "none", - "aggregationPaths": [ - "Total Collection" - ], - "insight": { - }, - "_comment": "W&S total collections " - }, - "wstotalCollection": { - "chartName": "DSS_W&S_TOTAL_COLLECTION", - "queries": [ - { - "module": "W&S", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"totalamount\"}}}}}}", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "receiptdate" - } - ], - "translateTenantCode": true, - "chartType": "metric", - "valueType": "amount", - "action": "", - "drillChart": "none", - "aggregationPaths": [ - "Total Collection" - ], - "insight": { - }, - "_comment": "W&S total collections " - }, - "wstargetCollection": { - "chartName": "DSS_W&S_TARGET_COLLECTION", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\", \"tenantId\" : \"ulbName.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}" - } - ], - "chartType": "metric", - "valueType": "amount", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Target Collection" - ], - "isDayUnit": true, - "postAggregationTheory" : "repsonseToDifferenceOfDates", - "insight": { - }, - "_comment": " " - }, - "wstargetAchieved": { - "chartName": "DSS_W&S_TARGET_ACHIEVED", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\r\n \"module\" : \"businessService.keyword\", \n\"tenantId\" : \"ulbName.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Actual collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"totalamount\"}}}}}}" - } - - ], - "translateTenantCode": true, - "chartType": "metric", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "aggregationPaths": [ - "Total Collection", - "Actual collection" - ], - "insight": { - "chartResponseMap" : "wstargetAchieved", - "action" : "differenceOfNumbers", - "upwardIndicator" : "positive", - "downwardIndicator" : "negative", - "textMessage" : "$indicator$value% than last $insightInterval", - "colorCode" : "#228B22", - "insightInterval" : "month" - }, - "_comment": " " - }, - "wscumulativeCollections": { - "chartName": "DSS_W&S_TOTAL_CUMULATIVE_COLLECTION", - "queries": [ - { - "module": "W&S", - "dateRefField": "receiptdate", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"Water Sewerage\":{\"date_histogram\":{\"field\":\"receiptdate\",\"interval\":\"intervalvalue\"},\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"terms\":{\"status\":[\"Cancelled\"]}}]}},\"aggs\":{\"approved\":{\"sum\":{\"field\":\"totalamount\"}}}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "line", - "valueType": "amount", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Water Sewerage" - ], - "isCumulative": true, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - - "wstopPerformingUlbs": { - "chartName": "DSS_W&S_TOP_3_PERFORMING_ULBS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\r\n \"module\" : \"businessService.keyword\", \n\"tenantId\" : \"ulbName.keyword\"}", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"ulbName.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"cityname.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"totalamount\"}}}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_TARGET_ACHIEVED", - "order": "desc", - "limit": 3, - "aggregationPaths": [ - "Total Collection","Target Collection" - ], - "insight": { - }, - "_comment": " Top Performing Ulbs for target achieved" - }, - "wsbottomPerformingUlbs": { - "chartName": "DSS_W&S_BOTTOM_3_PERFORMING_ULBS", - "queries": [ - { - "module": "COMMON", - "requestQueryMap": "{\"module\" : \"businessService.keyword\",\"tenantId\" : \"ulbName.keyword\" }", - "dateRefField": "", - "indexName": "dss-target_v1", - "aggrQuery": "{\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"ulbName.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"cityname.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"totalamount\"}}}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "perform", - "valueType": "percentage", - "drillChart": "none", - "documentType": "_doc", - "action": "percentage", - "plotLabel": "DSS_TARGET_ACHIEVED", - "order": "asc", - "limit": 3, - "aggregationPaths": [ - "Total Collection", "Target Collection" - ], - "insight": { - }, - "_comment": " Bottom Performing Ulbs for target achieved" - }, - "wscollectionByUsage": { - "chartName": "DSS_W&S_COLLECTION_BY_USAGE", - "queries": [ - { - "module": "W&S", - "dateRefField": "receiptdate", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"Usage Type\":{\"terms\":{\"field\":\"consumertype.keyword\"},\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"approved\":{\"sum\":{\"field\":\"totalamount\"}}}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Usage Type" - ], - "insight": { - }, - "_comment": " " - }, - - "wsFinancialIndicatorDDR": { - "chartName": "DSS_W&S_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"Total Collection\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"collection\":{\"sum\":{\"field\":\"totalamount\"}}}},\"Total Receipt\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"receipt\":{\"value_count\":{\"field\":\"receiptnumber.keyword\"}}}}}}" - } - - ], - "isMdmsEnabled": true, - "translateTenantCode": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "wsFinancialIndicatorUlb", - "action": "", - "plotLabel": "DDRs", - "isPostResponseHandler": true, - "postAggregationTheory" : "", - "aggregationPaths": [ - "Total Collection", - "Total Receipt", - "No of Bill", - "Project Demand" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Total Receipt": "number" - }, - { - "No of Bill": "number" - }, - { - "Project Demand": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "wsFinancialIndicatorUlb": { - "chartName": "DSS_W&S_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"ULB\":{\"terms\":{\"field\":\"cityname.keyword\"},\"aggs\":{\"Total Collection\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"collection\":{\"sum\":{\"field\":\"totalamount\"}}}},\"Total Receipt\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"receipt\":{\"value_count\":{\"field\":\"receiptnumber.keyword\"}}}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{ \"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "billdate", - "indexName": "demandbillconsumers", - "aggrQuery": "{\"aggs\":{\"ULB\":{\"terms\":{\"field\":\"cityname.keyword\"},\"aggs\":{\"No of Bill\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"approved\":{\"value_count\":{\"field\":\"installmentfrom.keyword\"}}}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{ \"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "@timestamp", - "indexName": "projecteddemand-consumers", - "aggrQuery": "{\"aggs\":{\"ULB\":{\"terms\":{\"field\":\"cityname.keyword\"},\"aggs\":{\"Project Demand\":{\"sum\":{\"field\":\"projecteddemand\"}}}}}}" - } - ], - "isMdmsEnabled": false, - "translateTenantCode": true, - "filterKeys": [ - {"key": "tenantId", "column": "ULB"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "wsFinancialIndicatorWard", - "action": "", - "plotLabel": "ULB", - "isPostResponseHandler": true, - "postAggregationTheory" : "", - "aggregationPaths": [ - "Total Collection", - "Total Receipt", - "No of Bill", - "Project Demand" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Total Receipt": "number" - }, - { - "No of Bill": "number" - }, - { - "Project Demand": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "wsFinancialIndicatorWard": { - "chartName": "DSS_W&S_DEMAND_COLLECTION_BOUNDARY", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{ \"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"Ward\":{\"terms\":{\"field\":\"block\"},\"aggs\":{\"Total Collection\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"collection\":{\"sum\":{\"field\":\"totalamount\"}}}},\"Total Receipt\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"receipt\":{\"value_count\":{\"field\":\"receiptnumber.keyword\"}}}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{ \"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "billdate", - "indexName": "demandbillconsumers", - "aggrQuery": "{\"aggs\":{\"Ward\":{\"terms\":{\"field\":\"block.keyword\"},\"aggs\":{\"No of Bill\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"approved\":{\"value_count\":{\"field\":\"installmentfrom.keyword\"}}}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{ \"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "@timestamp", - "indexName": "projecteddemand-consumers", - "aggrQuery": "{\"aggs\":{\"Ward\":{\"terms\":{\"field\":\"block.keyword\"},\"aggs\":{\"Project Demand\":{\"sum\":{\"field\":\"projecteddemand\"}}}}}}" - } - ], - "isMdmsEnabled": false, - "translateTenantCode": true, - "filterKeys": [ - - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "action": "", - "plotLabel": "Ward", - "isPostResponseHandler": true, - "postAggregationTheory" : "", - "aggregationPaths": [ - "Total Collection", - "Total Receipt", - "No of Bill", - "Project Demand" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Total Receipt": "number" - }, - { - "No of Bill": "number" - }, - { - "Project Demand": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - - "wsTaxHeadDDR": { - "chartName": "DSS_W&S_TAX_HEAD_BOUNDARY", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"Total Collection\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"collection\":{\"sum\":{\"field\":\"totalamount\"}}}},\"Total Receipt\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"receipt\":{\"value_count\":{\"field\":\"receiptnumber.keyword\"}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "billdate", - "indexName": "demandbillconsumers", - "aggrQuery": "{\"aggs\":{\"No of Bill\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"approved\":{\"value_count\":{\"field\":\"installmentfrom.keyword\"}}}},\"Late charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"penalty\":{\"sum\":{\"field\":\"penaltycollection\"}}}},\"Interest\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"interest\":{\"sum\":{\"field\":\"interestcollection\"}}}},\"Advance\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"advancecollection\"}}}},\"Current Charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"currentcharges\"}}}},\"Arrear Charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"arrearcharges\"}}}}}}}" - } - ], - "translateTenantCode": true, - "isMdmsEnabled": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "wsTaxHeadUlb", - "action": "", - "plotLabel": "DDRs", - "postAggregationTheory" : "", - "aggregationPaths": [ - "Total Collection", - "Total Receipt", - "No of Bill", - "Late charges", - "Interest", - "Advance", - "Current Charges", - "Arrear Charges" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Total Receipt": "number" - }, - { - "No of Bill": "number" - }, - { - "Late charges": "amount" - }, - { - "Interest": "amount" - }, - { - "Advance": "amount" - }, - { - "Current Charges": "amount" - }, - { - "Arrear Charges": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "wsTaxHeadUlb": { - "chartName": "DSS_W&S_TAX_HEAD_BOUNDARY", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"ULB\":{\"terms\":{\"field\":\"cityname.keyword\"},\"aggs\":{\"Total Collection\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"collection\":{\"sum\":{\"field\":\"totalamount\"}}}},\"Total Reciept\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"reciept\":{\"value_count\":{\"field\":\"receiptnumber.keyword\"}}}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "billdate", - "indexName": "demandbillconsumers", - "aggrQuery": "{\"aggs\":{\"ULB\":{\"terms\":{\"field\":\"cityname.keyword\"},\"aggs\":{\"No of Bill\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"approved\":{\"value_count\":{\"field\":\"installmentfrom.keyword\"}}}},\"Late charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"penalty\":{\"sum\":{\"field\":\"penaltycollection\"}}}},\"Interest\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"interest\":{\"sum\":{\"field\":\"interestcollection\"}}}},\"Advance\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"advancecollection\"}}}},\"Current Charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"currentcharges\"}}}},\"Arrear Charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"arrearcharges\"}}}}}}}}" - } - ], - "translateTenantCode": true, - "isMdmsEnabled": false, - "filterKeys": [ - {"key": "tenantId", "column": "ULB"} - ], - "chartType": "table", - "valueType": "number", - "drillChart": "wsTaxHeadWard", - "action": "", - "plotLabel": "ULB", - "postAggregationTheory" : "", - "aggregationPaths": [ - "Total Collection", - "Total Receipt", - "No of Bill", - "Late charges", - "Interest", - "Advance", - "Current Charges", - "Arrear Charges" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Total Receipt": "number" - }, - { - "No of Bill": "number" - }, - { - "Late charges": "amount" - }, - { - "Interest": "amount" - }, - { - "Advance": "amount" - }, - { - "Current Charges": "amount" - }, - { - "Arrear Charges": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - "wsTaxHeadWard": { - "chartName": "DSS_W&S_TAX_HEAD_BOUNDARY", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "receiptdate", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"Ward\":{\"terms\":{\"field\":\"block\"},\"aggs\":{\"Total Collection\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"collection\":{\"sum\":{\"field\":\"totalamount\"}}}},\"Total Reciept\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"status\":\"Cancelled\"}}]}},\"aggs\":{\"reciept\":{\"value_count\":{\"field\":\"receiptnumber.keyword\"}}}}}}}}" - }, - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "billdate", - "indexName": "demandbillconsumers", - "aggrQuery": "{\"aggs\":{\"Ward\":{\"terms\":{\"field\":\"block.keyword\"},\"aggs\":{\"No of Bill\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"approved\":{\"value_count\":{\"field\":\"installmentfrom.keyword\"}}}},\"Late charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"penalty\":{\"sum\":{\"field\":\"penaltycollection\"}}}},\"Interest\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"interest\":{\"sum\":{\"field\":\"interestcollection\"}}}},\"Advance\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"advancecollection\"}}}},\"Current Charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"currentcharges\"}}}},\"Arrear Charges\":{\"filter\":{\"term\":{\"billgenerated\":true}},\"aggs\":{\"advance\":{\"sum\":{\"field\":\"arrearcharges\"}}}}}}}}" - } - ], - "isMdmsEnabled": false, - "translateTenantCode": true, - "filterKeys": [ - ], - "chartType": "table", - "valueType": "number", - "drillChart": "", - "action": "", - "plotLabel": "Ward", - "postAggregationTheory" : "", - "aggregationPaths": [ - "Total Collection", - "Total Receipt", - "No of Bill", - "Late charges", - "Interest", - "Advance", - "Current Charges", - "Arrear Charges" - - ], - "pathDataTypeMapping": [ - { - "Total Collection": "amount" - }, - { - "Total Receipt": "number" - }, - { - "No of Bill": "number" - }, - { - "Late charges": "amount" - }, - { - "Interest": "amount" - }, - { - "Advance": "amount" - }, - { - "Current Charges": "amount" - }, - { - "Arrear Charges": "amount" - } - ], - "insight": { - }, - "_comment": "" - }, - - "wstotalConnection": { - "chartName": "DSS_W&S_CONNECTIONS", - "queries": [ - { - "module": "W&S", - "indexName": "wsapplications", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"applicationstatus.keyword\":\"Cancelled\"}}],\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\",\"Sewerage Charges\"]}}]}},\"aggs\":{\"Total Connection\":{\"value_count\":{\"field\":\"applicationnumber.keyword\"}}}}}}", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "@timestamp" - } - ], - "translateTenantCode": true, - "chartType": "metric", - "valueType": "number", - "action": "", - "drillChart": "none", - "aggregationPaths": [ - "Total Connection" - ], - "insight": { - }, - "_comment": " " - }, - "wsActiveUlbs": { - "chartName": "DSS_W&S_ACTIVE_ULBS", - "queries": [ - { - "module": "W&S", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"Active Ulbs\":{\"cardinality\":{\"field\":\"cityname.keyword\"}}}}", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "receiptdate" - } - ], - "translateTenantCode": true, - "chartType": "metric", - "valueType": "number", - "action": "", - "drillChart": "none", - "aggregationPaths": [ - "Active Ulbs" - ], - "insight": { - }, - "_comment": " " - }, - "wsNewWaterConnection": { - "chartName": "DSS_W&S_WATER_CONNECTIONS", - "queries": [ - { - "module": "W&S", - "indexName": "wsapplications", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"applicationstatus.keyword\":\"Cancelled\"}}],\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\"]}}]}},\"aggs\":{\"Water Connections\":{\"value_count\":{\"field\":\"id.keyword\"}}}}}}", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "@timestamp" - } - ], - "translateTenantCode": true, - "chartType": "metric", - "valueType": "number", - "action": "", - "drillChart": "none", - "aggregationPaths": [ - "Water Connections" - ], - "insight": { - }, - "_comment": " " - }, - "wsNewSewerageConnection": { - "chartName": "DSS_W&S_WATER_CONNECTIONS", - "queries": [ - { - "module": "W&S", - "indexName": "wsapplications", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"applicationstatus.keyword\":\"Cancelled\"}}],\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Sewerage Charges\"]}}]}},\"aggs\":{\"Sewerage Connections\":{\"value_count\":{\"field\":\"id.keyword\"}}}}}}", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "dateRefField": "@timestamp" - } - ], - "translateTenantCode": true, - "chartType": "metric", - "valueType": "number", - "action": "", - "drillChart": "none", - "aggregationPaths": [ - "Sewerage Connections" - ], - "insight": { - }, - "_comment": " " - }, - - "wscumulativeConnections": { - "chartName": "DSS_W&S_CUMULATIVE_COLLECTION", - "queries": [ - { - "module": "W&S", - "dateRefField": "@timestamp", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "indexName": "wsapplications", - "aggrQuery": "{\"aggs\":{\"Water Connections\":{\"date_histogram\":{\"field\":\"@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Water\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\"]}}],\"must_not\":[{\"terms\":{\"applicationstatus.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"id.keyword\"}}}}}},\"Sewerage Connections\":{\"date_histogram\":{\"field\":\"@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Water\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Sewerage Charges\"]}}],\"must_not\":[{\"terms\":{\"applicationstatus.keyword\":[\"Cancelled\"]}}]}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"id.keyword\"}}}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "line", - "valueType": "number", - "action": "", - "drillChart": "none", - "documentType": "_doc", - "aggregationPaths": [ - "Water Connections", - "Sewerage Connections" - - ], - "isCumulative": true, - "interval": "month", - "insight": { - }, - "_comment": " " - }, - - "wsConsumersByConnectionType": { - "chartName": "DSS_W&S_WATER_CONNECTION_BY_USAGE", - "queries": [ - { - "module": "W&S", - "dateRefField": "@timestamp", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "indexName": "waterchargesconsumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\"]}},{\"terms\":{\"connectionstatus.keyword\":[\"ACTIVE\"]}}]}},\"aggs\":{\"Water Consumers by Connection Type\":{\"terms\":{\"field\":\"connectiontype.keyword\",\"size\":170}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "Water Consumers by Connection Type" - ], - "insight": { - }, - "_comment": " " - }, - - "wsConsumersByUsageType": { - "chartName": "DSS_W&S_CONNECTION_BY_USAGE", - "queries": [ - { - "module": "W&S", - "dateRefField": "@timestamp", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "indexName": "waterchargesconsumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"applicationstatus.keyword\":\"Cancelled\"}}],\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\",\"Sewerage Charges\"]}},{\"terms\":{\"connectionstatus.keyword\":[\"ACTIVE\"]}}]}},\"aggs\":{\"W & S Consumers by Usage Type\":{\"terms\":{\"field\":\"usage.keyword\"}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "W & S Consumers by Usage Type" - ], - "insight": { - }, - "_comment": " " - }, - - "wsConsumersByChannel": { - "chartName": "DSS_W&S_CONNECTION_BY_CHANNEL", - "queries": [ - { - "module": "W&S", - "dateRefField": "@timestamp", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\"}", - "indexName": "receipts-consumers", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"channel\":\"FIELD\"}},{\"term\":{\"channel\":\"SYSTEM\"}}],\"must\":[{\"term\":{\"status\":\"Approved\"}}]}},\"aggs\":{\"W & S Consumers by Channel\":{\"terms\":{\"field\":\"channel\",\"size\":7}}}}}}" - } - ], - "translateTenantCode": true, - "chartType": "pie", - "valueType": "number", - "action": "", - "documentType": "_doc", - "drillChart": "none", - "aggregationPaths": [ - "W & S Consumers by Channel" - ], - "insight": { - }, - "_comment": " " - }, - - "wsConnectionAgeingDDR": { - "chartName": "DSS_W&S_CONNECTION_AGEING", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "@timestamp", - "indexName": "wsapplications", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\",\"Sewerage Charges\"]}},{\"terms\":{\"applicationstatus.keyword\":[\"Created\",\"Rejected\",\"Verified\",\"verified\"]}}]}},\"aggs\":{\"Pending lt 3 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-3d/d\",\"to\":\"now\"}]}},\"Pending gt 3 and lt 7 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-1w\",\"to\":\"now-3d/d\"}]}},\"Pending gt 7 and lt 15 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-15d\",\"to\":\"now-1w\"}]}},\"Pending gt 15 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-2y\",\"to\":\"now-15d\"}]}}}}}}" - } - ], - "isMdmsEnabled": true, - "translateTenantCode": true, - "filterKeys": [ - {"key": "tenantId", "column": "DDRs"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "wsConnectionAgeingUlb", - "action": "", - "plotLabel": "DDRs", - "isPostResponseHandler": true, - "postAggregationTheory" : "", - "aggregationPaths": [ - "Pending lt 3 days", - "Pending gt 3 and lt 7 days", - "Pending gt 7 and lt 15 days", - "Pending gt 15 days" - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AdditiveComputedField", - "fields" : [ "Pending lt 3 days", "Pending gt 3 and lt 7 days", "Pending gt 7 and lt 15 days", "Pending gt 15 days"], - "newField" : "Total Pending", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - - "insight": { - }, - "_comment": "" - }, - "wsConnectionAgeingUlb": { - "chartName": "DSS_W&S_CONNECTION_AGEING", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "@timestamp", - "indexName": "wsapplications", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\",\"Sewerage Charges\"]}},{\"terms\":{\"applicationstatus.keyword\":[\"Created\",\"Rejected\",\"Verified\",\"verified\"]}}]}},\"aggs\":{\"2\":{\"terms\":{\"field\":\"cityname.keyword\",\"size\":170,\"order\":{\"_key\":\"asc\"}},\"aggs\":{\"Pending lt 3 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-3d/d\",\"to\":\"now\"}]}},\"Pending gt 3 and lt 7 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-1w\",\"to\":\"now-3d/d\"}]}},\"Pending gt 7 and lt 15 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-15d\",\"to\":\"now-1w\"}]}},\"Pending gt 15 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-2y\",\"to\":\"now-15d\"}]}}}}}}}}" - } - ], - "isMdmsEnabled": false, - "translateTenantCode": true, - "filterKeys": [ - {"key": "tenantId", "column": "ULB"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "wsConnectionAgeingWard", - "action": "", - "plotLabel": "ULB", - "isPostResponseHandler": true, - "postAggregationTheory" : "", - "aggregationPaths": [ - "Pending lt 3 days", - "Pending gt 3 and lt 7 days", - "Pending gt 7 and lt 15 days", - "Pending gt 15 days" - - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AdditiveComputedField", - "fields" : [ "Pending lt 3 days", "Pending gt 3 and lt 7 days", "Pending gt 7 and lt 15 days", "Pending gt 15 days"], - "newField" : "Total Pending", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - - "insight": { - }, - "_comment": "" - }, - "wsConnectionAgeingWard": { - "chartName": "DSS_W&S_CONNECTION_AGEING", - "queries": [ - { - "module": "W&S", - "requestQueryMap": "{\"tenantId\" : \"cityname.keyword\", \"wardId\" : \"block.keyword\" }", - "dateRefField": "@timestamp", - "indexName": "wsapplications", - "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"servicetype.keyword\":[\"Water Charges\",\"Sewerage Charges\"]}},{\"terms\":{\"applicationstatus.keyword\":[\"Created\",\"Rejected\",\"Verified\",\"verified\"]}}]}},\"aggs\":{\"2\":{\"terms\":{\"field\":\"block.keyword\",\"size\":170,\"order\":{\"_key\":\"asc\"}},\"aggs\":{\"Pending lt 3 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-3d/d\",\"to\":\"now\"}]}},\"Pending gt 3 and lt 7 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-1w\",\"to\":\"now-3d/d\"}]}},\"Pending gt 7 and lt 15 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-15d\",\"to\":\"now-1w\"}]}},\"Pending gt 15 days\":{\"date_range\":{\"field\":\"applicationdate\",\"ranges\":[{\"from\":\"now-2y\",\"to\":\"now-15d\"}]}}}}}}}}" - } - ], - "isMdmsEnabled": false, - "translateTenantCode": true, - "filterKeys": [ - {"key": "tenantId", "column": "Ward"} - ], - "chartType": "xtable", - "valueType": "number", - "drillChart": "", - "action": "", - "plotLabel": "Ward", - "isPostResponseHandler": true, - "postAggregationTheory" : "", - "aggregationPaths": [ - "Pending lt 3 days", - "Pending gt 3 and lt 7 days", - "Pending gt 7 and lt 15 days", - "Pending gt 15 days" - - ], - "computedFields": [ - { - "postAggregationTheory" : "", - "actionName": "AdditiveComputedField", - "fields" : [ "Pending lt 3 days", "Pending gt 3 and lt 7 days", "Pending gt 7 and lt 15 days", "Pending gt 15 days"], - "newField" : "Total Pending", - "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name " - } - ], - - "insight": { - }, - "_comment": "" - } -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/resources/schema/MasterDashboardConfig.json b/business-services/dashboard-analytics/src/main/resources/schema/MasterDashboardConfig.json deleted file mode 100644 index b15e9519c40..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/schema/MasterDashboardConfig.json +++ /dev/null @@ -1,3789 +0,0 @@ -{ - "_comment": "Master dashboard which holds all the possible visualisation. Note new dashboards/visualisations can be added", - "dashboards": [ - { - "name": "DSS_OVERVIEW_DASHBOARD", - "id": "overview", - "isActive": "", - "style": "", - "visualizations": [ - { - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 111, - "name": "DSS_OVERVIEW", - "vizType": "metric-collection", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "todaysCollectionv2", - "name": "DSS_TOTAL_COLLECTION_TODAY", - "code": "", - "chartType": "", - "filter": {"title": "TODAY"}, - "headers": [] - }, - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "DSS_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 112, - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "label": "", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeCollectionv2", - "name": "Weekly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 121, - "name": "DSS_TOP_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsv2", - "name": "DSS_TOP_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 122, - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsv2", - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 123, - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "totalCollectionDeptWisev2", - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 131, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 450, - "width": 5 - }, - "vizType": "metric-collection", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "closedApplication", - "name": "DSS_CLOSED_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "citizenRegistered", - "name": "DSS_CITIZEN_REGISTERED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 132, - "name": "DSS_TOTAL_APPLICATION_&_CLOSED_APPLICATION", - "dimensions": { - "height": 450, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "totalApplication&ClosedApplication", - "name": "DSS_TOTAL_APPLICATION_&_CLOSED_APPLICATION", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 141, - "name": "DSS_TOP_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "DSS_TOP_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 142, - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 143, - "name": "DSS_TOTAL_APPLICATIONS:_DEPARTMENT_WISE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "totalApplicationDeptWise", - "name": "DSS_TOTAL_APPLICATIONS:_DEPARTMENT_WISE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - } - ] - }, - { - "name": "DSS_TRADE_LICENSE_DASHBOARD", - "id": "tradeLicense", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 311, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "label": "DSS_OVERVIEW", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "todaysCollectionv2", - "name": "DSS_TOTAL_COLLECTION_TODAY", - "code": "", - "chartType": "metric", - "filter": {"title": "TODAY"}, - "headers": [] - }, - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "DSS_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 312, - "name": "Total Cumulative Collection", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "label": "", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeCollectionv2", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 321, - "name": "DSS_TL_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "topPerformingUlbsv2", - "name": "DSS_TL_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 322, - "name": "DSS_TL_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsv2", - "name": "DSS_TL_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 323, - "name": "DSS_TL_LICENSE_BY_TYPE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "licenseByLicenseTypev2", - "name": "DSS_TL_LICENSE_BY_TYPE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_TL_KEY_FY_INDICATORS", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "licenseIssuedDDRRevenuev2", - "name": "DSS_TL_DEMAND_COLLECTION_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 5, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_TL_TAX_HEAD_BREAKUP", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "licenceTaxHeadsBreakupDDRv2", - "name": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 6, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 341, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "licenseIssued", - "name": "DSS_TL_LICENSE_ISSUED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "activeUlbs", - "name": "DSS_PT_TOTAL_ACTIVE_ULBS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 342, - "name": "DSS_TL_CUMULATIVE_LICENSE_ISSUED", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeLicenseIssued", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 7, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 351, - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 352, - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 353, - "name": "DSS_TL_LICENSE_BY_STATUS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "licenseApplicationByStatus", - "name": "DSS_TL_LICENSE_BY_STATUS", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 8, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 351, - "name": "DSS_TL_STATUS_BOUNDARY", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "tlStatusByDDR", - "name": "", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - - } - ] - } - ] - } - ] - }, - { - "name": "DSS_PGR_DASHBOARD", - "id": "pgr", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 412, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "label": "DSS_OVERVIEW", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "totalComplaints", - "name": "DSS_PGR_TOTAL_COMPLAINTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "closedComplaints", - "name": "DSS_PGR_CLOSED_COMPLAINTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "completionRate", - "name": "DSS_PGR_COMPLETION_RATE", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 412, - "name": "DSS_TOTAL_CUMULATIVE_CLOSED_COMPLAINTS", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "cumulativeClosedComplaints", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 412, - "name": "DSS_TOTAL_COMPLAINTS_BY_SOURCE", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "totalComplaintsbySource", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 413, - "name": "DSS_TOTAL_COMPLAINTS_STATUS", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "totalComplaintsbyStatus", - "name": "", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 421, - "name": "DSS_PGR_COMPLAINTS_BY_STATUS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "complaintsByStatus", - "name": "DSS_PGR_COMPLAINTS_BY_STATUS", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 423, - "name": "DSS_PGR_COMPLAINTS_BY_CHANNEL", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "complaintsByChannel", - "name": "DSS_PGR_COMPLAINTS_BY_CHANNEL", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 423, - "name": "DSS_PGR_COMPLAINTS_BY_DEPARTMENT", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "complaintsByDepartment", - "name": "DSS_PGR_COMPLAINTS_BY_DEPARTMENT", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - - ] - }, - { - "row": 4, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 421, - "name": "DSS_PGR_CITIZENS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "pgrCitizenOnDateRange", - "name": "DSS_PGR_CITIZENS", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 424, - "name": "DSS_PGR_TOP_COMPLAINTS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "topFiveComplaints", - "name": "DSS_PGR_TOP_COMPLAINTS", - "code": "", - "chartType": "horizontalBar", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 431, - "name": "DSS_PGR_STATUS_BY_TENANT", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "xpgrStatusByDDR", - "name": "DSS_PGR_STATUS_BY_TENANT", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - }, - { - "id": "xpgrStatusByDept", - "name": "DSS_PGR_STATUS_BY_DEPARTMENT", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Department" - } - ] - } - ] - } - ] - }, - - { - "name": "DSS_HOME_DASHBOARD", - "id": "home", - "isActive": "", - "style": "", - "title": "title", - "visualizations": [ - { - "name": "DSS_OVERVIEW", - "row": 1, - "vizArray": [ - { - "id": 111, - "name": "DSS_OVERVIEW", - "vizType": "collection", - "noUnit": true, - "isCollapsible": false, - "ref": { - "url": "overview", - "logoUrl": "", - "type": "internal" - }, - "charts": [ - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_OVERVIEW", - "vizArray": [ - { - "id": 121, - "name": "DSS_PROPERTY_TAX", - "vizType": "module", - "moduleLevel": "PT", - "type": "", - "noUnit": false, - "isCollapsible": false, - "ref": { - "url": "propertytax", - "logoUrl": "", - "type": "internal" - }, - "label": "", - "charts": [ - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "propertiesAssessed", - "name": "DSS_PT_TOTAL_PROPERTIES_ASSESSED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 141, - "name": "DSS_TRADE_LICENCE", - "vizType": "module", - "moduleLevel": "TL", - "ref": { - "url": "tradelicense", - "logoUrl": "", - "type": "internal" - }, - "label": "", - "charts": [ - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 141, - "name": "DSS_COMPLAINS", - "vizType": "module", - "moduleLevel": "PGR", - "ref": { - "url": "pgr", - "logoUrl": "", - "type": "internal" - }, - "label": "", - "charts": [ - { - "id": "totalComplaints", - "name": "DSS_PGR_TOTAL_COMPLAINTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 142, - "name": "DSS_WATER_SEWERAGE", - "vizType": "module", - "moduleLevel": "W&S", - "ref": { - "url": "ws", - "logoUrl": "", - "type": "internal" - }, - "label": "", - "charts": [ - { - "id": "wstotalCollection", - "name": "DSS_WS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wstotalConnection", - "name": "DSS_WS_TOTAL_CONNECTIONS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - } - ] - } - ] - }, - { - "name": "DSS_PROPERTY_TAX_DASHBOARD", - "id": "propertyTax", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 211, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "noUnit": true, - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - - { - "id": "todaysCollectionv2", - "name": "DSS_TOTAL_COLLECTION_TODAY", - "code": "", - "chartType": "metric", - "filter": {"title": "TODAY"}, - "headers": [] - }, - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "DSS_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 212, - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeCollectionv2", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 221, - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsv2", - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 222, - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsv2", - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 223, - "name": "DSS_PT_COLLECTION_BY_USAGE_TYPE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "collectionByUsageTypev2", - "name": "DSS_PT_COLLECTION_BY_USAGE_TYPE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_PT_KEY_FY_INDICATORS", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "demandCollectionIndexDDRRevenuev2", - "name": "DSS_PT_DEMAND_COLLECTION_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - }, - { - "id": "demandCollectionIndexUsageRevenuev2", - "name": "DSS_PT_DEMAND_COLLECTION_USAGETYPE", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Usage" - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_PT_TAX_HEAD", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "taxHeadsBreakupDDRRevenuev2", - "name": "DSS_PT_TAX_HEAD_BREAKUP_REVENUE", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - }, - { - "id": "taxHeadsBreakupUsagev2", - "name": "DSS_PT_TAX_HEAD_BREAKUP_USAGE", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Usage" - } - ] - } - ] - }, - { - "row": 5, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 241, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - { - "id": "propertiesAssessed", - "name": "DSS_PT_TOTAL_PROPERTIES_ASSESSED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "totalAssessment", - "name": "DSS_PT_TOTAL_ASSESSMENTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "activeUlbs", - "name": "DSS_PT_TOTAL_ACTIVE_ULBS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 242, - "name": "DSS_PT_CUMULATIVE_PROPERTIES_ASSESSED", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "cumulativePropertiesAssessed", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 6, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 251, - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 252, - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 253, - "name": "DSS_PT_PROPERTIES_BY_USAGE_TYPE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "propertiesByUsageType", - "name": "DSS_PT_PROPERTIES_BY_USAGE_TYPE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 254, - "name": "DSS_PT_PROPERTIES_BY_TENANT", - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "propertiesByTenant", - "name": "DSS_PT_PROPERTIES_BY_TENANT", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 7, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_PT_PROPERTIES_BY_FINANCIAL_YEAR", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "xptFyByDDR", - "name": "", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - } - ] - }, - - { - "name": "DSS_PGR_DASHBOARD", - "id": "ulb-pgr", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 412, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "label": "DSS_OVERVIEW", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "totalComplaints", - "name": "DSS_PGR_TOTAL_COMPLAINTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "closedComplaints", - "name": "DSS_PGR_CLOSED_COMPLAINTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "completionRate", - "name": "DSS_PGR_COMPLETION_RATE", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 412, - "name": "DSS_TOTAL_CUMULATIVE_CLOSED_COMPLAINTS", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "cumulativeClosedComplaints", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 412, - "name": "DSS_TOTAL_COMPLAINTS_BY_SOURCE", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "totalComplaintsbySource", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 413, - "name": "DSS_TOTAL_COMPLAINTS_STATUS", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "totalComplaintsbyStatus", - "name": "", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 421, - "name": "DSS_PGR_COMPLAINTS_BY_STATUS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "complaintsByStatus", - "name": "DSS_PGR_COMPLAINTS_BY_STATUS", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 423, - "name": "DSS_PGR_COMPLAINTS_BY_CHANNEL", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "complaintsByChannel", - "name": "DSS_PGR_COMPLAINTS_BY_CHANNEL", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 423, - "name": "DSS_PGR_COMPLAINTS_BY_DEPARTMENT", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "complaintsByDepartment", - "name": "DSS_PGR_COMPLAINTS_BY_DEPARTMENT", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - - ] - }, - { - "row": 4, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 421, - "name": "DSS_PGR_AVARAGE_TURN_AROUND", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "averageTurnAroundTime", - "name": "DSS_PGR_AVARAGE_TURN_AROUND", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 424, - "name": "DSS_PGR_TOP_COMPLAINTS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "topFiveComplaints", - "name": "DSS_PGR_TOP_COMPLAINTS", - "code": "", - "chartType": "horizontalBar", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 431, - "name": "DSS_PGR_STATUS_BY_TENANT", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "xpgrStatusByDDR", - "name": "DSS_PGR_STATUS_BY_TENANT", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - }, - { - "id": "xpgrStatusByDept", - "name": "DSS_PGR_STATUS_BY_DEPARTMENT", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Department" - } - ] - } - ] - } - ] - }, - { - "name": "DSS_PROPERTY_TAX_DASHBOARD", - "id": "ulb-propertyTax", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 211, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "noUnit": true, - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - { - "id": "todaysCollectionv2", - "name": "DSS_TOTAL_COLLECTION_TODAY", - "code": "", - "chartType": "metric", - "filter": {"title": "TODAY"}, - "headers": [] - }, - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "DSS_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 212, - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeCollectionv2", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 221, - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsv2", - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 222, - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsv2", - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 223, - "name": "DSS_PT_COLLECTION_BY_USAGE_TYPE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "collectionByUsageTypev2", - "name": "DSS_PT_COLLECTION_BY_USAGE_TYPE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_PT_DEMAND_COLLECTION", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "demandCollectionIndexDDRRevenuev2", - "name": "DSS_PT_DEMAND_COLLECTION_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - }, - { - "id": "demandCollectionIndexUsageRevenuev2", - "name": "DSS_PT_DEMAND_COLLECTION_USAGETYPE", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Usage" - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_PT_TAX_HEAD", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "taxHeadsBreakupDDRRevenuev2", - "name": "DSS_PT_TAX_HEAD_BREAKUP_REVENUE", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - }, - { - "id": "taxHeadsBreakupUsagev2", - "name": "DSS_PT_TAX_HEAD_BREAKUP_USAGE", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Usage" - } - ] - } - ] - }, - { - "row": 5, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 241, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - { - "id": "propertiesAssessed", - "name": "DSS_PT_TOTAL_PROPERTIES_ASSESSED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "totalAssessment", - "name": "DSS_PT_TOTAL_ASSESSMENTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "activeUlbs", - "name": "DSS_PT_TOTAL_ACTIVE_ULBS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 242, - "name": "DSS_PT_CUMULATIVE_PROPERTIES_ASSESSED", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "cumulativePropertiesAssessed", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 6, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 251, - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 252, - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 253, - "name": "DSS_PT_PROPERTIES_BY_USAGE_TYPE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "propertiesByUsageType", - "name": "DSS_PT_PROPERTIES_BY_USAGE_TYPE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 7, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_PT_PROPERTIES_BY_FINANCIAL_YEAR", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "xptFyByDDR", - "name": "", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - } - ] - }, - { - "name": "DSS_TRADE_LICENSE_DASHBOARD", - "id": "ulb-tradeLicense", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 311, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "label": "DSS_OVERVIEW", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "todaysCollectionv2", - "name": "DSS_TOTAL_COLLECTION_TODAY", - "code": "", - "chartType": "metric", - "filter": {"title": "TODAY"}, - "headers": [] - }, - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "DSS_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 312, - "name": "Total Cumulative Collection", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "label": "", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeCollectionv2", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 321, - "name": "DSS_TL_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "topPerformingUlbsv2", - "name": "DSS_TL_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 322, - "name": "DSS_TL_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsv2", - "name": "DSS_TL_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 323, - "name": "DSS_TL_LICENSE_BY_TYPE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "licenseByLicenseTypev2", - "name": "DSS_TL_LICENSE_BY_TYPE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_TL_KEY_FY_INDICATORS", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "licenseIssuedDDRRevenuev2", - "name": "DSS_TL_DEMAND_COLLECTION_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 5, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_TL_TAX_HEAD_BREAKUP", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "licenceTaxHeadsBreakupDDRv2", - "name": "DSS_TL_TAX_HEAD_BREAKUP_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 6, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 341, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "licenseIssued", - "name": "DSS_TL_LICENSE_ISSUED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "activeUlbs", - "name": "DSS_PT_TOTAL_ACTIVE_ULBS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 342, - "name": "DSS_TL_CUMULATIVE_LICENSE_ISSUED", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeLicenseIssued", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 7, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 351, - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "label": "", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "DSS_PT_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 352, - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "DSS_PT_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 353, - "name": "DSS_TL_LICENSE_BY_STATUS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "licenseApplicationByStatus", - "name": "DSS_TL_LICENSE_BY_STATUS", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 8, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 351, - "name": "DSS_TL_STATUS_BOUNDARY", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "tlStatusByDDR", - "name": "", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - - } - ] - } - ] - } - ] - }, - { - "name": "DSS_OVERVIEW_DASHBOARD", - "id": "ulb-overview", - "isActive": "", - "style": "", - "visualizations": [ - { - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 111, - "name": "DSS_OVERVIEW", - "vizType": "metric-collection", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "todaysCollectionv2", - "name": "DSS_TOTAL_COLLECTION_TODAY", - "code": "", - "chartType": "", - "filter": {"title": "TODAY"}, - "headers": [] - }, - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "DSS_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 112, - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "label": "", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "cumulativeCollectionv2", - "name": "Weekly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 121, - "name": "DSS_TOP_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsv2", - "name": "DSS_TOP_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 122, - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsv2", - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 123, - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "totalCollectionDeptWisev2", - "name": "DSS_TOTAL_CUMULATIVE_COLLECTION:_DEPARTMENT_WISE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 131, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 450, - "width": 5 - }, - "vizType": "metric-collection", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "closedApplication", - "name": "DSS_CLOSED_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "citizenRegistered", - "name": "DSS_CITIZEN_REGISTERED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 132, - "name": "DSS_TOTAL_APPLICATION_&_CLOSED_APPLICATION", - "dimensions": { - "height": 450, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "totalApplication&ClosedApplication", - "name": "DSS_TOTAL_APPLICATION_&_CLOSED_APPLICATION", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 141, - "name": "DSS_TOP_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "DSS_TOP_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 142, - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "isCollapsible": false, - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "DSS_BOTTOM_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 143, - "name": "DSS_TOTAL_APPLICATIONS:_DEPARTMENT_WISE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "totalApplicationDeptWise", - "name": "DSS_TOTAL_APPLICATIONS:_DEPARTMENT_WISE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - } - ] - }, - { - "name": "DSS_HOME_DASHBOARD", - "id": "ulb-home", - "isActive": "", - "style": "", - "title": "title", - "visualizations": [ - { - "name": "DSS_OVERVIEW", - "row": 1, - "vizArray": [ - { - "id": 111, - "name": "DSS_OVERVIEW", - "vizType": "collection", - "noUnit": true, - "isCollapsible": false, - "ref": { - "url": "ulb-overview", - "logoUrl": "", - "type": "internal" - }, - "charts": [ - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchievedv2", - "name": "DSS_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_OVERVIEW", - "vizArray": [ - { - "id": 121, - "name": "DSS_PROPERTY_TAX", - "vizType": "module", - "moduleLevel": "PT", - "type": "", - "noUnit": false, - "isCollapsible": false, - "ref": { - "url": "ulb-propertyTax", - "logoUrl": "", - "type": "internal" - }, - "label": "", - "charts": [ - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "propertiesAssessed", - "name": "DSS_PT_TOTAL_PROPERTIES_ASSESSED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 131, - "name": "DSS_TRADE_LICENCE", - "vizType": "module", - "moduleLevel": "TL", - "ref": { - "url": "ulb-tradeLicense", - "logoUrl": "", - "type": "internal" - }, - "label": "", - "charts": [ - { - "id": "totalCollectionv2", - "name": "DSS_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "totalApplication", - "name": "DSS_TOTAL_APPLICATION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 141, - "name": "DSS_COMPLAINS", - "vizType": "module", - "moduleLevel": "PGR", - "ref": { - "url": "ulb-pgr", - "logoUrl": "", - "type": "internal" - }, - "label": "", - "charts": [ - { - "id": "totalComplaints", - "name": "DSS_PGR_TOTAL_COMPLAINTS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "slaAchieved", - "name": "DSS_SLA_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - } - ] - } - ] - }, - - { - "name": "DSS_W&S_DASHBOARD", - "id": "ws", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 211, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "noUnit": true, - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - { - "id": "wstodaysCollection", - "name": "DSS_W&S_TODAYS_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wstotalCollection", - "name": "DSS_W&S_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wstargetCollection", - "name": "DSS_W&S_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wstargetAchieved", - "name": "DSS_W&S_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 212, - "name": "DSS_W&S_TOTAL_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "wscumulativeCollections", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 221, - "name": "DSS_W&S_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "wstopPerformingUlbs", - "name": "DSS_W&S_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 222, - "name": "DSS_W&S_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "wsbottomPerformingUlbs", - "name": "DSS_W&S_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 223, - "name": "DSS_W&S_COLLECTION_BY_USAGE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "wscollectionByUsage", - "name": "DSS_W&S_COLLECTION_BY_USAGE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_DEMAND_COLLECTION_BOUNDARY", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "wsFinancialIndicatorDDR", - "name": "DSS_W&S_DEMAND_COLLECTION_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_TAX_HEAD_BOUNDARY", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsTaxHeadDDR", - "name": "DSS_W&S_TAX_HEAD_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 7, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "metric-collection", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wstotalConnection", - "name": "DSS_W&S_CONNECTIONS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wsNewWaterConnection", - "name": "DSS_W&S_WATER_CONNECTIONS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wsNewSewerageConnection", - "name": "DSS_W&S_SEWERAGE_CONNECTIONS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wsActiveUlbs", - "name": "DSS_W&S_ACTIVE_ULBS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 232, - "name": "DSS_W&S_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "wscumulativeConnections", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 8, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_WATER_CONNECTION_BY_USAGE", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConsumersByConnectionType", - "name": "", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 232, - "name": "DSS_W&S_CONNECTION_BY_USAGE", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConsumersByUsageType", - "name": "", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 233, - "name": "DSS_W&S_CONNECTION_BY_CHANNEL", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConsumersByChannel", - "name": "", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 9, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_CONNECTION_AGEING", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConnectionAgeingDDR", - "name": "", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - - ] - } - ] - }, - { - "name": "DSS_W&S_DASHBOARD", - "id": "ulb-ws", - "isActive": "", - "style": "linear", - "visualizations": [ - { - "row": 1, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 211, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "noUnit": true, - "isCollapsible": false, - "label": "DSS_OVERVIEW", - "charts": [ - { - "id": "wstodaysCollection", - "name": "DSS_W&S_TODAYS_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wstotalCollection", - "name": "DSS_W&S_TOTAL_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wstargetCollection", - "name": "DSS_W&S_TARGET_COLLECTION", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wstargetAchieved", - "name": "DSS_W&S_TARGET_ACHIEVED", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 212, - "name": "DSS_W&S_TOTAL_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "wscumulativeCollections", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 221, - "name": "DSS_W&S_TOP_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "label": "", - "charts": [ - { - "id": "wstopPerformingUlbs", - "name": "DSS_W&S_TOP_3_PERFORMING_ULBS", - "code": "", - "chartType": "", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 222, - "name": "DSS_W&S_BOTTOM_3_PERFORMING_ULBS", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "wsbottomPerformingUlbs", - "name": "DSS_W&S_BOTTOM_3_PERFORMING_ULBS", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 223, - "name": "DSS_W&S_COLLECTION_BY_USAGE", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "noUnit": true, - "isCollapsible": false, - "charts": [ - { - "id": "wscollectionByUsage", - "name": "DSS_W&S_COLLECTION_BY_USAGE", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_DEMAND_COLLECTION_BOUNDARY", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "noUnit": false, - "isCollapsible": false, - "charts": [ - { - "id": "wsFinancialIndicatorDDR", - "name": "DSS_W&S_DEMAND_COLLECTION_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 4, - "name": "DSS_REVENUE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_TAX_HEAD_BOUNDARY", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsTaxHeadDDR", - "name": "DSS_W&S_TAX_HEAD_BOUNDARY", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - ] - }, - { - "row": 7, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_OVERVIEW", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "metric-collection", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wstotalConnection", - "name": "DSS_W&S_CONNECTIONS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wsNewWaterConnection", - "name": "DSS_W&S_WATER_CONNECTIONS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wsNewSewerageConnection", - "name": "DSS_W&S_SEWERAGE_CONNECTIONS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "wsActiveUlbs", - "name": "DSS_W&S_ACTIVE_ULBS", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 232, - "name": "DSS_W&S_CUMULATIVE_COLLECTION", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "isCollapsible": false, - "charts": [ - { - "id": "wscumulativeConnections", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 8, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_WATER_CONNECTION_BY_USAGE", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConsumersByConnectionType", - "name": "", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 232, - "name": "DSS_W&S_CONNECTION_BY_USAGE", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConsumersByUsageType", - "name": "", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 233, - "name": "DSS_W&S_CONNECTION_BY_CHANNEL", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConsumersByChannel", - "name": "", - "code": "", - "chartType": "donut", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 9, - "name": "DSS_SERVICE", - "vizArray": [ - { - "id": 231, - "name": "DSS_W&S_CONNECTION_AGEING", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "label": "", - "noUnit": false, - "isCollapsible": true, - "charts": [ - { - "id": "wsConnectionAgeingDDR", - "name": "", - "code": "", - "chartType": "table", - "filter": "", - "headers": [], - "tabName": "Boundary" - } - ] - } - - ] - } - ] - } - ] -} diff --git a/business-services/dashboard-analytics/src/main/resources/schema/RoleDashboardConfig.json b/business-services/dashboard-analytics/src/main/resources/schema/RoleDashboardConfig.json deleted file mode 100644 index df88cb557b8..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/schema/RoleDashboardConfig.json +++ /dev/null @@ -1,562 +0,0 @@ -{ - "_comment": "TODO: denormalize the role & visualisations", - "roles" : [ - { - "roleId": 6, - "roleName" : "R1", - "isSuper" : "", - "orgId": "", - "dashboards": [ - { - "name": "My Dashboard", - "id": "home", - "isActive": "", - "style" : "tabbed", - "visualizations": [ - { - "row": 1, - "name": "Revenue", - "vizArray": [ - { - "id": 11, - "name": "", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "charts": [ - { - "id": "totalCollection", - "name": "Total Collection", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "Target Collection", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchieved", - "name": "Target Achieved", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 12, - "name": "Total Cumulative Collection", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "charts": [ - { - "id": "cumulativeCollection", - "name": "Weekly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "Revenue", - "vizArray": [ - { - "id": 21, - "name": "Top Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "topPerformingUlbs", - "name": "Top Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 22, - "name": "Bottom Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "bottomPerformingUlbs", - "name": "Bottom Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 23, - "name": "Total Cumulative Collection: Department Wise", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "charts": [ - { - "id": "totalCollectionDeptWise", - "name": "Total Cumulative Collection: Department Wise", - "code": "", - "chartType": "pie", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "Service", - "vizArray": [ - { - "id": 31, - "name": "", - "dimensions": { - "height": 450, - "width": 5 - }, - "vizType": "metric-collection", - "charts": [ - { - "id": "totalApplication", - "name": "Total Application", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "closedApplication", - "name": "Closed Application", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "", - "name": "SLA Achieved", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "citizenRegistered", - "name": "Citizen Registered", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 32, - "name": "Total Application & Closed Application", - "dimensions": { - "height": 450, - "width": 7 - }, - "vizType": "chart", - "charts": [ - { - "id": "totalApplication&ClosedApplication", - "name": "", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "Service", - "vizArray": [ - { - "id": 41, - "name": "Top Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "Top Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 42, - "name": "Bottom Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "Bottom Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 43, - "name": "Total Applications: Department Wise", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "charts": [ - { - "id": "totalApplicationDeptWise", - "name": "Total Cumulative Collection: Department Wise", - "code": "", - "chartType": "pie", - "filter": "", - "headers": [] - } - ] - } - ] - } - ] - }, - { - "name": "Property Tax", - "id": "propertyTax", - "isActive":"", - "style" : "linear", - "visualizations": [ - { - "row": 1, - "name": "Revenue", - "vizArray": [ - { - "id": 11, - "name": "", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "charts": [ - { - "id": "totalCollection", - "name": "Total Collection", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetCollection", - "name": "Target Collection", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "targetAchieved", - "name": "Target Achieved", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 12, - "name": "Total Cumulative Collection", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "charts": [ - { - "id": "cumulativeCollection", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 2, - "name": "Revenue", - "vizArray": [ - { - "id": 21, - "name": "Top 3 Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "topPerformingUlbs", - "name": "Top 3 Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 22, - "name": "Bottom 3 Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "bottomPerformingUlbs", - "name": "Bottom 3 Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 23, - "name": "Collection by Usage type", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "charts": [ - { - "id": "collectionByUsageType", - "name": "Collection by Usage type", - "code": "", - "chartType": "pie", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 3, - "name": "Revenue", - "vizArray": [ - { - "id": 31, - "name": "", - "dimensions": { - "height": 350, - "width": 12 - }, - "vizType": "chart", - "charts": [ - { - "id": "demandCollectionIndexBoundaryRevenue", - "name": "Demand & Collection Index", - "code": "", - "chartType": "table", - "filter": "", - "headers": [] - }, - { - "id": "demandCollectionIndexUsageRevenue", - "name": "Demand & Collection Index", - "code": "", - "chartType": "table", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 4, - "name": "Service", - "vizArray": [ - { - "id": 41, - "name": "", - "dimensions": { - "height": 350, - "width": 5 - }, - "vizType": "metric-collection", - "charts": [ - { - "id": "propertiesAssessed", - "name": "Total Properties Assessed", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "propertiesAssessed", - "name": "Total Assessments", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - }, - { - "id": "activeUlbs", - "name": "Total Active ULBs", - "code": "", - "chartType": "metric", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 42, - "name": "Total Properties Assessed", - "dimensions": { - "height": 350, - "width": 7 - }, - "vizType": "chart", - "charts": [ - { - "id": "cumulativePropertiesAssessed", - "name": "Monthly", - "code": "", - "chartType": "line", - "filter": "", - "headers": [] - } - ] - } - ] - }, - { - "row": 5, - "name": "Service", - "vizArray": [ - { - "id": 21, - "name": "Top 3 Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "topPerformingUlbsCompletionRate", - "name": "Top 3 Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 22, - "name": "Bottom 3 Performing ULBs", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "performing-metric", - "charts": [ - { - "id": "bottomPerformingUlbsCompletionRate", - "name": "Bottom 3 Performing ULBs", - "code": "", - "chartType": "bar", - "filter": "", - "headers": [] - } - ] - }, - { - "id": 23, - "name": "Properties by Usage type", - "dimensions": { - "height": 250, - "width": 4 - }, - "vizType": "chart", - "charts": [ - { - "id": "propertiesByUsageType", - "name": "Properties by Usage type", - "code": "", - "chartType": "pie", - "filter": "", - "headers": [] - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/business-services/dashboard-analytics/src/main/resources/schema/RoleDashboardMappingsConf.json b/business-services/dashboard-analytics/src/main/resources/schema/RoleDashboardMappingsConf.json deleted file mode 100644 index f1839227c77..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/schema/RoleDashboardMappingsConf.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_comment": "Holds mapping for each role with and its associated dashboards", - "roles" : [ - { - "_comment":"This role is super role which can access all the available dashboards: [other/new roles are suppose to be added]", - "roleId": "roleId#1", - "roleName" : "Admin", - "isSuper" : "", - "orgId": "", - "dashboards": [ - { - "name": "My Dashboard", - "id": "home" - }, - { - "name": "My Dashboard v2", - "id": "homev2" - }, - { - "name": "Property Tax", - "id": "propertyTax" - }, - { - "name": "Trade License", - "id": "tradeLicense" - }, - { - "name": "PGR", - "id": "pgr" - }, - { - "id": "overview" - }, - { - "id": "ws" - } - ] - }, - { - "_comment":"This role is super role which can access all the available dashboards: [other/new roles are suppose to be added]", - "roleId": "roleId#2", - "roleName" : "Commissioner", - "isSuper" : "", - "orgId": "", - "dashboards": [ - { - "id": "ulb-pgr" - }, - { - "id": "ulb-propertyTax" - }, - { - "id": "ulb-tradeLicense" - }, - { - "id": "ulb-overview" - }, - { - "id": "ulb-home" - }, - { - "id": "ulb-ws" - } - ] - } - - ] -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/resources/schema/TenantCodeNameMappings.json b/business-services/dashboard-analytics/src/main/resources/schema/TenantCodeNameMappings.json deleted file mode 100644 index 313879e4a17..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/schema/TenantCodeNameMappings.json +++ /dev/null @@ -1,549 +0,0 @@ -{ - "comment" : "This mapping is used for resolving the miss match between MDM citynames and waterchargesconsumers citynames", - "ulbCityNamesMappings": [ - { - "tenantCode":"pb.kapurthala", - "tenantValue":"Kapurthala" - }, - { - "tenantCode": "pb.ropar", - "tenantValue":"Ropar" - }, - { - "tenantCode": "pb.rajpura", - "tenantValue":"Rajpura" - }, - { - "tenantCode":"pb.kharar", - "tenantValue":"Kharar" - }, - { - "tenantCode":"pb.barnala", - "tenantValue":"Barnala" - }, - { - "tenantCode":"pb.abohar", - "tenantValue":"Abohar" - }, - { - "tenantCode":"pb.phagwara", - "tenantValue":"Phagwara" - }, - { - "tenantCode":"pb.sangrur", - "tenantValue":"Sangrur" - }, - { - "tenantCode":"pb.mansa", - "tenantValue":"Mansa" - }, - { - "tenantCode":"pb.ferozepur", - "tenantValue":"Ferozepur" - }, - { - "tenantCode":"pb.dhuri", - "tenantValue":"Dhuri" - }, - { - "tenantCode":"pb.gidderbaha", - "tenantValue":"Gidderbaha" - }, - { - "tenantCode":"pb.moga", - "tenantValue":"Moga" - }, - { - "tenantCode":"pb.fazilka", - "tenantValue":"Fazilka" - }, - { - "tenantCode":"pb.kurali", - "tenantValue":"Kurali" - }, - { - "tenantCode":"pb.sunam", - "tenantValue":"Sunam" - }, - { - "tenantCode":"pb.anandpursahib", - "tenantValue":"Anandpur Sahib" - }, - { - "tenantCode":"pb.malout", - "tenantValue":"Malout" - }, - { - "tenantCode":"pb.nawanshahr", - "tenantValue":"Nawanshahr" - }, - { - "tenantCode":"pb.kotkapura", - "tenantValue":"Kotkapura" - }, - { - "tenantCode":"pb.bhuchomandi", - "tenantValue":"Bhucho Mandi" - }, - { - "tenantCode":"pb.maur", - "tenantValue":"Maur" - }, - { - "tenantCode":"pb.hoshiarpur", - "tenantValue":"Hoshiarpur" - }, - { - "tenantCode": "pb.jaitu", - "tenantValue":"Jaitu" - }, - { - "tenantCode":"pb.samana", - "tenantValue":"Samana" - }, - { - "tenantCode":"pb.ahmedgarh", - "tenantValue":"Ahmedgarh" - }, - { - "tenantCode":"pb.mohali", - "tenantValue":"Mohali" - }, - { - "tenantCode":"pb.derabassi", - "tenantValue":"DeraBassi" - }, - { - "tenantCode":"pb.mandigobindgarh", - "tenantValue":"Mandi Gobindgarh" - }, - { - "tenantCode":"pb.mukerian", - "tenantValue":"Mukerian" - }, - { - "tenantCode":"pb.bhogpur", - "tenantValue":"Bhogpur" - }, - { - "tenantCode":"pb.nabha", - "tenantValue":"Nabha" - }, - { - "tenantCode":"pb.batala", - "tenantValue":"Batala" - }, - { - "tenantCode":"pb.mullanpur", - "tenantValue":"MullanpurDakha" - }, - { - "tenantCode":"pb.budhlada", - "tenantValue":"Budhlada" - }, - { - "tenantCode":"pb.gurdaspur", - "tenantValue":"Gurdaspur" - }, - { - "tenantCode":"pb.jagraon", - "tenantValue":"Jagraon" - }, - { - "tenantCode":"pb.bhawanigarh", - "tenantValue":"Bhawanigarh" - }, - { - "tenantCode":"pb.banga", - "tenantValue":"Banga" - }, - { - "tenantCode":"pb.sirhind", - "tenantValue":"Sirhind" - }, - { - "tenantCode":"pb.phillaur", - "tenantValue":"Phillaur" - }, - { - "tenantCode":"pb.goniana", - "tenantValue":"Goniana" - }, - { - "tenantCode":"pb.talwandibhai", - "tenantValue":"TalwandiBhai" - }, - { - "tenantCode":"pb.khanauri", - "tenantValue":"Khanauri" - }, - { - "tenantCode":"pb.ajnala", - "tenantValue":"Ajnala" - }, - { - "tenantCode":"pb.nakodar", - "tenantValue":"Nakodar" - }, - { - "tenantCode":"pb.sardulgarh", - "tenantValue":"Sardulgarh" - }, - { - "tenantCode":"pb.morinda", - "tenantValue":"Morinda" - }, - { - "tenantCode":"pb.rahon", - "tenantValue":"Rahon" - }, - { - "tenantCode":"pb.raikot", - "tenantValue":"Raikot" - }, - { - "tenantCode":"pb.garhshankar", - "tenantValue":"Garhshankar" - }, - { - "tenantCode":"pb.zira", - "tenantValue":"Zira" - }, - { - "tenantCode":"pb.handiaya", - "tenantValue":"Handiaya" - }, - { - "tenantCode":"pb.lehragaga", - "tenantValue":"Lehragaga" - }, - { - "tenantCode":"pb.nurmahal", - "tenantValue":"Nurmahal" - }, - { - "tenantCode":"pb.goraya", - "tenantValue":"Goraya" - }, - { - "tenantCode":"pb.nangal", - "tenantValue":"Nangal" - }, - { - "tenantCode":"pb.alawalpur", - "tenantValue":"Alawalpur" - }, - { - "tenantCode":"pb.urmartanda", - "tenantValue":"Urmar Tanda" - }, - { - "tenantCode":"pb.doraha", - "tenantValue":"Doraha" - }, - { - "tenantCode":"pb.sanaur", - "tenantValue":"Sanaur" - }, - { - "tenantCode":"pb.mahilpur", - "tenantValue":"Mahilpur" - }, - { - "tenantCode":"pb.sultanpurlodhi", - "tenantValue":"Sultanpur Lodhi" - }, - { - "tenantCode":"pb.ghanaur", - "tenantValue":"Ghanaur" - }, - { - "tenantCode":"pb.malerkotla", - "tenantValue":"Malerkotla" - }, - { - "tenantCode":"pb.srihargobindpur", - "tenantValue":"Sri Hargobindpur" - }, - { - "tenantCode":"pb.talwandisabo", - "tenantValue":"Talwandi Sabo" - }, - { - "tenantCode":"pb.raman", - "tenantValue":"Raman" - }, - { - "tenantCode":"pb.dinanagar", - "tenantValue":"Dina Nagar" - }, - { - "tenantCode":"pb.longowal", - "tenantValue":"Longowal" - }, - { - "tenantCode":"pb.bhulath", - "tenantValue":"Bhulath" - }, - { - "tenantCode":"pb.bhadaur", - "tenantValue":"Bhadaur" - }, - { - "tenantCode":"pb.jandialaguru", - "tenantValue":"Jandiala Guru" - }, - { - "tenantCode":"pb.sangatmandi", - "tenantValue":"Sangat Mandi" - }, - { - "tenantCode":"pb.bareta", - "tenantValue":"Bareta" - }, - { - "tenantCode":"pb.garhdiwala", - "tenantValue":"Garhdiwala" - }, - { - "tenantCode":"pb.kotfatta", - "tenantValue":"Kotfatta" - }, - { - "tenantCode":"pb.faridkot", - "tenantValue":"Faridkot" - }, - { - "tenantCode":"pb.bariwala", - "tenantValue":"Bariwala" - }, - { - "tenantCode":"pb.banur", - "tenantValue":"Banur" - }, - { - "tenantCode":"pb.samrala", - "tenantValue":"Samrala" - }, - { - "tenantCode":"pb.jalalabad", - "tenantValue":"Jalalabad" - }, - { - "tenantCode":"pb.boha", - "tenantValue":"Boha" - }, - { - "tenantCode":"pb.talwara", - "tenantValue":"Talwara" - }, - { - "tenantCode":"pb.quadian", - "tenantValue":"Quadian" - }, - { - "tenantCode":"pb.moonak", - "tenantValue":"Moonak" - }, - { - "tenantCode":"pb.fatehgarhchurian", - "tenantValue":"Fatehgarh Churian" - }, - { - "tenantCode":"pb.dharamkot", - "tenantValue":"Dharamkot" - }, - { - "tenantCode":"pb.payal", - "tenantValue":"Payal" - }, - { - "tenantCode":"pb.dasuya", - "tenantValue":"Dasuya" - }, - { - "tenantCode":"pb.bhikhi", - "tenantValue":"Bhikhi" - }, - { - "tenantCode":"pb.mallanwala", - "tenantValue":"Mallanwala" - }, - { - "tenantCode":"pb.guruharsahai", - "tenantValue":"Guru Harsahai" - }, - { - "tenantCode":"pb.balachaur", - "tenantValue":"Balachaur" - }, - { - "tenantCode":"pb.kartarpur", - "tenantValue":"Kartarpur" - }, - { - "tenantCode":"pb.pathankot", - "tenantValue":"Pathankot" - }, - { - "tenantCode":"pb.tarntaran", - "tenantValue":"Tarn Taran" - }, - { - "tenantCode":"pb.machhiwara", - "tenantValue":"Machiwara" - }, - { - "tenantCode":"pb.sujanpur", - "tenantValue":"Sujanpur" - }, - { - "tenantCode":"pb.shamchurasi", - "tenantValue":"Shamchurasi" - }, - { - "tenantCode":"pb.ramdass", - "tenantValue":"Ramdass" - }, - { - "tenantCode":"pb.dirba", - "tenantValue":"Dirba" - }, - { - "tenantCode":"pb.maloud", - "tenantValue":"Maloud" - }, - { - "tenantCode":"pb.bassipathana", - "tenantValue":"Bassi Pathana" - }, - { - "tenantCode":"pb.baghapurana", - "tenantValue":"Baghapurana" - }, - { - "tenantCode":"pb.rajasansi", - "tenantValue":"Raja Sansi" - }, - { - "tenantCode":"pb.hariana", - "tenantValue":"Hariana" - }, - { - "tenantCode":"pb.cheema", - "tenantValue":"Cheema" - }, - { - "tenantCode":"pb.majitha", - "tenantValue":"Majitha" - }, - { - "tenantCode":"pb.dhanaula", - "tenantValue":"Dhanaula" - }, - { - "tenantCode":"pb.kiratpur", - "tenantValue":"Kiratpur Sahib" - }, - { - "tenantCode":"pb.tapa", - "tenantValue":"Tapa" - }, - { - "tenantCode":"pb.chamkaursahib", - "tenantValue":"Chamkaur Sahib" - }, - { - "tenantCode":"pb.dhilwan", - "tenantValue":"Dhilwan" - }, - { - "tenantCode":"pb.patran", - "tenantValue":"Patran" - }, - { - "tenantCode":"pb.ghagga", - "tenantValue":"Ghagga" - }, - { - "tenantCode":"pb.adampur", - "tenantValue":"Adampur" - }, - { - "tenantCode":"pb.amargarh", - "tenantValue":"Amargarh" - }, - { - "tenantCode":"pb.badhnikalan", - "tenantValue":"Badhni Kalan" - }, - { - "tenantCode":"pb.shahkot", - "tenantValue":"Shahkot" - }, - { - "tenantCode":"pb.lalru", - "tenantValue":"Lalru" - }, - { - "tenantCode":"pb.patti", - "tenantValue":"Patti" - }, - { - "tenantCode":"pb.rayya", - "tenantValue":"Rayya" - }, - { - "tenantCode":"pb.khemkaran", - "tenantValue":"Khemkaran" - }, - { - "tenantCode":"pb.khamano", - "tenantValue":"Khamano" - }, - { - "tenantCode":"pb.bhadson", - "tenantValue":"Bhadson" - }, - { - "tenantCode":"pb.mudki", - "tenantValue":"Mudki" - }, - { - "tenantCode":"pb.begowal", - "tenantValue":"Begowal" - }, - { - "tenantCode":"pb.derababananak", - "tenantValue":"Dera Baba Nanak" - }, - { - "tenantCode":"pb.nihalsinghwala", - "tenantValue":"Nihal Singh Wala" - }, - { - "tenantCode":"pb.amloh", - "tenantValue":"Amloh" - }, - { - "tenantCode":"pb.makhu", - "tenantValue":"Makhu" - }, - { - "tenantCode":"pb.dhariwal", - "tenantValue":"Dhariwal" - }, - { - "tenantCode":"pb.nadala", - "tenantValue":"Nadala" - }, - { - "tenantCode":"pb.amritsar", - "tenantValue":"Amritsar" - }, - { - "tenantCode":"pb.mamdot", - "tenantValue":"Mamdot" - } - ] -} \ No newline at end of file diff --git a/business-services/dashboard-analytics/src/main/resources/schema/getchart.json b/business-services/dashboard-analytics/src/main/resources/schema/getchart.json deleted file mode 100644 index 9f9e5ef8927..00000000000 --- a/business-services/dashboard-analytics/src/main/resources/schema/getchart.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "ain/getchart/schema1#", - "title": "getchart", - "description": "getchart api schema", - "type": "object", - "properties": { - "header": { - "type": "object", - "properties": { - "tenantId": { - "type": "string" - } - } - }, - "requestInfo": { - "type": "object", - "properties": { - "chartType":{ - "type":"string", - "enum":["bar","line","stackedbar","pie", "horizontalBar", "doughnut", "doubledonut","heat","radar"] - }, - "chartFormat":{ - "type":"string" - }, - "serviceApi":{ - "type":"string" - }, - "dates":{ - "type":"object", - "properties":{ - "startDate":{ - "type":"string" - }, - "endData":{ - "type":"string" - } - } - } - }, - "required": ["chartType","chartFormat", "serviceApi","dates"] - } - } -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/CHANGELOG.md b/business-services/dashboard-ingest/CHANGELOG.md deleted file mode 100644 index 71afc5a0fe6..00000000000 --- a/business-services/dashboard-ingest/CHANGELOG.md +++ /dev/null @@ -1,34 +0,0 @@ -#Changelog - -All notable changes to this module will be documented in this file. - -## 1.1.4 - 2023-02-02 - -- Transition from 1.1.4-beta version to 1.1.4 version - -## 1.1.4-beta - 2022-01-13 -- Updated to log4j2 version 2.17.1 - -## 1.1.3 - 2021-05-11 - -- security fixes - -## 1.1.2 - 2021-03-09 - -- Updated README file - -## 1.1.1 - 2020-09-01 - -- Added README and LOCALSETUP -- Changes in assessment indexing - -## 1.1.0 - 2020-06-23 - -- Added typescript definition generation plugin -- Upgraded to `tracer:2.0.0-SNAPSHOT` -- Upgraded to spring boot `2.2.6-RELEASE` -- Removed Kafka dependency - -## 1.0.0 - -- Base version diff --git a/business-services/dashboard-ingest/LOCALSETUP.md b/business-services/dashboard-ingest/LOCALSETUP.md deleted file mode 100644 index 1fd6e8ee5ad..00000000000 --- a/business-services/dashboard-ingest/LOCALSETUP.md +++ /dev/null @@ -1,27 +0,0 @@ -# Local Setup - -To setup the dashboard-ingest in your local system, clone the [Business Service repository](https://github.com/egovernments/business-services). - -## Dependencies - -### Infra Dependency - -- [ ] Postgres DB -- [ ] Redis -- [X] Elastic search -- [X] Kafka - - [X] Consumer - - [X] Producer - -## Running Locally - -To run the dashboard-ingest locally, update below listed properties in `application.properties` prior to running the project: - -```ini -services.esindexer.host = Elasticsearch hostname -services.esindexer.host.port = Elasticsearch port number -services.esindexer.username = Username for elasticsearch index -services.esindexer.password = Password for elastic search index -spring.data.elasticsearch.cluster.name = Elasticsearch cluster name -spring.data.elasticsearch.cluster.nodes = Elasticsearch node name -``` diff --git a/business-services/dashboard-ingest/README.md b/business-services/dashboard-ingest/README.md deleted file mode 100644 index f6ac05b8f7d..00000000000 --- a/business-services/dashboard-ingest/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# Dashboard-Ingest - -Dashboard-Ingest module runs as a pipeline and manages to validate, transform and enrich the incoming data and pushes the same to ElasticSearch Index. - -### DB UML Diagram - -- To Do - -### Service Dependencies - -- elasticsearch - -### Swagger API Contract - -- Please refer to the [Swagger API contarct](https://raw.githubusercontent.com/egovernments/business-services/master/Docs/dss-dashboard/DSS%20Ingest%20YAML%20Spec%201.0.0.yaml) for dashboard-ingest to understand the structure of APIs and to have visualization of all internal APIs. - - -## Service Details - -Below are list of configurations - -- Topic Context Configurations - -- Validator Schema - -- JOLT Transformation Schema - -- Enrichment Domain Configuration - -- JOLT Domain Transformation Schema - -####Descriptions - -**Topic Context Configurations** - -Topic Context Configuration is an outline to define which data is received on which Kafka Topic. -Indexer Service and many other services are sending out data on different Kafka Topics. If the Ingest Service is asked to receive those data and pass it through the pipeline, the context and the version of the data being received has to be set. This configuration is used to identify as in which kafka topic consumed the data and what is the mapping for that. -[Click here for full configuration](https://github.com/egovernments/configs/blob/master/egov-dss-dashboards/dashboard-ingest/TopicContextConfiguration.json) - -| Parameter Name | Description | -| ----------------------------------| ------------------------------------------------------------------------------------------------------------------| -| `topic` | Holds the name of the Kafka Topic on which the data is being received | -| `dataContext` | Context Name which needs to be set for further actions in the pipeline | -| `dataContextVersion` | Version of the Data Structure is set here as there might be different structured data at different point of time | - -**Validator Schema** - -Validator Schema is a configuration Schema Library from Everit -By passing the data against this schema, it ensures whether the data abides by the rules and requirements of the schema which has been defined. [Click here for example configuration](https://github.com/egovernments/configs/blob/master/egov-dss-dashboards/dashboard-ingest/validator_transaction_v1.json) - - - -**JOLT Transformation Schema** - -JOLT is a JSON to JSON Transformation Library. In order to change the structure of the data and transform it in a generic way, JOLT has been used. -While the transformation schemas are written for each Data Context, the data is transformed against the schema to obtain a transformed data. -[Click here for example configuration](https://github.com/egovernments/configs/blob/master/egov-dss-dashboards/dashboard-ingest/transform_collection_v1.json) - -**Enrichment Domain Configuration** - -This configuration defines and directs the Enrichment Process which the data goes through. - -For example, if the Data which is incoming is belonging to a Collection Module data, then the Collection Domain Config is picked. And the based on the Business Type specified in the data, the right config is picked. -In order to enhance the data of Collection, the domain index specified in the configuration is queried with the right arguments and the response data is obtained, transformed and set. -[Click here for example configuration](https://github.com/egovernments/configs/blob/master/egov-dss-dashboards/dashboard-ingest/DomainConfig.json) - -| Parameter Name | Description | -| ---------------------------------------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `id` | Unique Identifier for the Configuration within the configuration document | -| `businessType` | This defines as in which kind of Domain / Service is the data related to. Based on this business type, query and enhancements are decided | -| `indexName` | Based on Business Type, Index Name is defined as to which index has to be queried to get the enhancements done from | -| `query` | Query to execute to get the Domain Level Object is defined here. | -| `targetReferences / sourceReferences` | Fields which are variables in order to get the domain level objects are defined here. The variables and where all the values has to be picked from are documented here. | - -**JOLT Domain Transformation Schema** - -As a part of Enhancement, once the domain level object is obtained, we might not need the complete document as is in the end data product. - -Only those parameters which should be or can be used for an aggregation and representation are to be held and others are to be discarded. - -In order to do that, we make use of JOLT again and write schemas to keep the required ones and discard the unwanted ones. - -The [configuration](https://github.com/egovernments/configs/blob/master/egov-dss-dashboards/dashboard-ingest/transform_tl_v1.json) is used to transform the data response in the enrichment layer. - -**JOLT Transformation Schema for collection V2** - -JOLT transformation schema for payment-v1 has taken as a use case to explain the context collection and context version v2. The payment records are processed/transformed with the schema. The schema supports splitting the billing records in a independent new record. So if there are 2 bill items in the collection/payment incoming data then this results into 2 collection records in turn. -[Click for example configuration](https://github.com/egovernments/configs/blob/master/egov-dss-dashboards/dashboard-ingest/transform_collection_v2.json) - -Here: $i, the variable value that gets incremented for the number of records of paymentDetails -$j, the variable value that gets incremented for the number of records of billDetails. - ->Note: For kafka connect to work, Ingest pipeline application properties or in environments direct push must be disabled. -es.push.direct=false - - - -### API Details - -`BasePath` /dashboard-ingest/ingest/[API endpoint] - -##### Method - -- `save` - - This API receives the Transaction Details JSON Request and passes it on to the Service Layer for further process of persisting into elastic search. - -- `upload` - - This API use to provide response for external data upload. Uploded file get parsed and stores target data to Elastic search. - -- `/migrate/{indexName}/{version}` - - This api is used for scroll search. - -- `/pause/{consumerId}` - - This API use to pause a active kafka consumer. - -- `/resume/{consumerId}` - - This API is to resume a paused kafka consumer. - -### Kafka Consumers -Following are the kafka consumer topic -- `ingestData`:- The consumer listen on this kafka topic to get the required data for ingest pipleine. -- `dss-collection-update`:- The consumer listen on this topic to get the collection index data. -- `validData` :- The consumer listen on this topic to valida the data before transformation. -- `transformedData`:- The consumer listen on this topic consumes the collection/incoming data and transforms the data using jolt configurations. -- `egov-dss-ingest-enriched`:- The consumer listen on this kafka topic in order to hook the collection data to its business module data. - -### Kafka Producers -Following are the kafka producer topic -- `validData`:- The producer send the data to this topic to valid the data before transformation. -- `transformedData` :- The producer send the data to this topic in order to transorm collection/incoming data using jolt configurations. -- `egov-dss-ingest-enriched`:- The producer send the data to this topic after transormation in order to hook the collection data to its business module data. diff --git a/business-services/dashboard-ingest/pom.xml b/business-services/dashboard-ingest/pom.xml deleted file mode 100644 index 9fe207633de..00000000000 --- a/business-services/dashboard-ingest/pom.xml +++ /dev/null @@ -1,242 +0,0 @@ - - 4.0.0 - - com.ingestpipeline - ingestpipeline - 1.1.4-SNAPSHOT - jar - - ingestpipeline - - - org.springframework.boot - spring-boot-starter-parent - 2.2.6.RELEASE - - - - 2.17.1 - 1.8 - UTF-8 - UTF-8 - 1.8 - 3.0.1 - - - - - org.springframework.boot - spring-boot-starter-web - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - 2.10.3 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - 2.10.3 - - - com.fasterxml.jackson.core - jackson-annotations - 2.10.3 - - - com.fasterxml.jackson.core - jackson-core - 2.10.3 - - - com.fasterxml.jackson.core - jackson-databind - 2.10.3 - - - org.egov.services - tracer - 2.0.0-SNAPSHOT - - - - com.google.code.gson - gson - 2.8.0 - - - com.bazaarvoice.jolt - jolt-core - 0.1.1 - - - com.bazaarvoice.jolt - json-utils - 0.1.1 - - - javax.ws.rs - jsr311-api - 1.1.1 - - - org.apache.commons - commons-lang3 - 3.4 - - - commons-io - commons-io - 2.6 - - - org.everit.json - org.everit.json.schema - 1.3.0 - - - org.elasticsearch - elasticsearch - 6.6.0 - - - org.elasticsearch.client - elasticsearch-rest-high-level-client - 6.6.0 - - - commons-fileupload - commons-fileupload - 1.4 - - - org.apache.poi - poi - 4.1.0 - - - org.apache.poi - poi-ooxml - 4.1.0 - - - - commons-beanutils - commons-beanutils - 1.8.3 - - - net.sf.ezmorph - ezmorph - 1.0.6 - - - commons-collections - commons-collections - 3.2.2 - - - commons-lang - commons-lang - 2.6 - - - org.json - json - 20160810 - - - - org.springframework.boot - spring-boot-starter-data-jpa - 2.1.4.RELEASE - - - com.h2database - h2 - runtime - 2.1.210 - - - org.apache.commons - commons-lang3 - 3.7 - - - - com.github.wnameless - json-flattener - 0.2.2 - - - - - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework - spring-jdbc - - - org.springframework - spring-beans - 5.2.20.RELEASE - - - org.json - json - 20190722 - - - - com.google.guava - guava - 20.0 - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - cz.habarta.typescript-generator - typescript-generator-maven-plugin - 2.22.595 - - - generate - - generate - - process-classes - - - - jackson2 - - com.ingestpipeline.model.TargetData - com.ingestpipeline.model.References - com.ingestpipeline.model.TargetData - - - com.ingestpipeline.util.ResponseCode$ResponseCode:ResponseCode - - Digit - true - module - - - - - \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/AppStartupRunner.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/AppStartupRunner.java deleted file mode 100644 index bdcf3bbdb83..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/AppStartupRunner.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.ingestpipeline; - -import com.ingestpipeline.service.IngestServiceImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.stereotype.Component; - -import com.ingestpipeline.config.DomainConfig; -import com.ingestpipeline.config.DomainConfigFactory; -import com.ingestpipeline.controller.RestApiController; -import com.ingestpipeline.util.ConfigLoader; -import com.ingestpipeline.util.ReadUtil; - -/** - * The App Startup Runner runs on the start of the application as it implements Application Runner - * This will be responsible to load the configurations which are necessary for the Enrichment in the Data Pipeline - * Resources and Domain level configurations are fetched here. - * @author Pritha - * - */ -@Component -public class AppStartupRunner implements ApplicationRunner { - - private static Logger logger = LoggerFactory.getLogger(AppStartupRunner.class); - - @Autowired - ConfigLoader configLoader; - @Autowired - DomainConfigFactory domainConfigFactory; - - @Autowired ReadUtil readutil; - - @Autowired RestApiController restApiController; - - @Autowired IngestServiceImpl ingestService; - - @SuppressWarnings("static-access") - @Override - public void run(ApplicationArguments args) throws Exception { - logger.info("On Boot starts loading: config resources "); - configLoader.loadResources(); - for(DomainConfig domainConfig : domainConfigFactory.getAllConfigs()) { - domainConfig.loadDomains(); - } - - ingestService.loadTopicsConfig(); - - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/IngestApp.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/IngestApp.java deleted file mode 100644 index 8f5f90b1945..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/IngestApp.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.ingestpipeline; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import com.ingestpipeline.util.Constants; - - -@SpringBootApplication(scanBasePackages={"com.ingestpipeline"})// same as @Configuration @EnableAutoConfiguration @ComponentScan combined -public class IngestApp { - - public static void main(String[] args) { - SpringApplication.run(IngestApp.class, args); - } - - @Bean - public RestTemplate restTemplate() { - return new RestTemplate(); - } - - @Bean - public WebMvcConfigurer corsConfigurer() { - return new WebMvcConfigurerAdapter() { - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**").allowedMethods(Constants.ALLOWED_METHODS_GET,Constants.ALLOWED_METHODS_POST - ).allowedOrigins("*") - .allowedHeaders("*"); - } - }; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/DomainConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/DomainConfig.java deleted file mode 100644 index 5e553117ba0..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/DomainConfig.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ingestpipeline.config; - -import com.ingestpipeline.model.DomainIndexConfig; - -public interface DomainConfig { - - public static final String DOMAIN_CONFIG ="domainConfig"; - public DomainIndexConfig getIndexConfig(String domainName); - public void loadDomains(); - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/DomainConfigFactory.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/DomainConfigFactory.java deleted file mode 100644 index 67951c31f73..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/DomainConfigFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ingestpipeline.config; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.ingestpipeline.configfactory.CollectionDomainConfig; -import com.ingestpipeline.configfactory.EnhanceDomainConfig; - -@Component -public class DomainConfigFactory { - - @Autowired - private CollectionDomainConfig collectionDomainConfig; - - @Autowired - private EnhanceDomainConfig enhanceDomainConfig; - - public DomainConfig getConfiguration(String type) { - - if (type.equals("collection")) { - return collectionDomainConfig; - - } else if(type.equals("dataEnhancement")) { - return enhanceDomainConfig; - - } - return null; - } - - public List getAllConfigs() { - List domainConfigList = new ArrayList<>(); - domainConfigList.add(collectionDomainConfig); - domainConfigList.add(enhanceDomainConfig); - return domainConfigList; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/ElasticSearchConfiguration.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/ElasticSearchConfiguration.java deleted file mode 100644 index 2bf42053330..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/config/ElasticSearchConfiguration.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.ingestpipeline.config; - -import org.apache.http.HttpHost; -import org.elasticsearch.client.RestClient; -import org.elasticsearch.client.RestHighLevelClient; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.beans.factory.config.AbstractFactoryBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import com.ingestpipeline.service.ElasticService; -import com.ingestpipeline.service.IESService; - -@Configuration -public class ElasticSearchConfiguration extends AbstractFactoryBean { - - private static final Logger logger = LoggerFactory.getLogger(ElasticSearchConfiguration.class); - @Value("${spring.data.elasticsearch.cluster.nodes}") - private String clusterNodes; - @Value("${spring.data.elasticsearch.cluster.name}") - private String clusterName; - private RestHighLevelClient restHighLevelClient; - @Value("${services.esindexer.host.name}") - private String esIndexerHostName; - @Value("${services.esindexer.host.port}") - private int esIndexerHostPort; - - @Override - public void destroy() { - try { - if (restHighLevelClient != null) { - restHighLevelClient.close(); - } - } catch (final Exception e) { - logger.error("Error closing ElasticSearch client: ", e); - } - } - - @Override - public Class getObjectType() { - return RestHighLevelClient.class; - } - - @Override - public boolean isSingleton() { - return false; - } - - @Override - public RestHighLevelClient createInstance() { - return buildClient(); - } - - private RestHighLevelClient buildClient() { - try { - restHighLevelClient = new RestHighLevelClient( - RestClient.builder(new HttpHost(esIndexerHostName, esIndexerHostPort, "http"))); - } catch (Exception e) { - logger.error(e.getMessage()); - } - return restHighLevelClient; - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/configfactory/CollectionDomainConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/configfactory/CollectionDomainConfig.java deleted file mode 100644 index 0f0141d7c1c..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/configfactory/CollectionDomainConfig.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.ingestpipeline.configfactory; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.ingestpipeline.config.DomainConfig; -import com.ingestpipeline.model.DomainIndexConfig; -import com.ingestpipeline.util.ConfigLoader; -import com.ingestpipeline.util.Constants; - -//@JsonIgnoreProperties(ignoreUnknown=true) -@Component(Constants.DomainConfigurations.COLLECTION_DOMAIN_CONFIG) -public class CollectionDomainConfig implements DomainConfig { - - private static final Logger LOGGER = LoggerFactory.getLogger(CollectionDomainConfig.class); - private static final String COLLECTION_DOMAIN_CONFIG = Constants.DomainConfigurations.COLLECTION_DOMAIN_CONFIG + ".json"; - - - @Autowired - private ConfigLoader configLoader; - /** - * Holds domain name as key and it's index config detail as value. - */ - private Map domainIndexConfigMap = new HashMap<>(); - - public void putDomain(String domainName, DomainIndexConfig domainIndexConfig){ - domainIndexConfigMap.put(domainName, domainIndexConfig); - } - - @Override - public DomainIndexConfig getIndexConfig(String domainName){ - return domainIndexConfigMap.get(domainName); - } - - - /** - * loads once on application start up. - */ - @Override - public void loadDomains(){ - String collectionConfigContent = configLoader.get(COLLECTION_DOMAIN_CONFIG); - //LOGGER.info("collectionConfigContent json string = "+collectionConfigContent); - - try{ - - ObjectMapper mapper = new ObjectMapper(); - JsonNode root = new ObjectMapper().readTree(collectionConfigContent); - ArrayNode domainConfigArr = (ArrayNode) root.path(DOMAIN_CONFIG); - - Iterator iterator = domainConfigArr.elements(); - while (iterator.hasNext()) { - DomainIndexConfig domainIndexConfig = mapper.readValue(iterator.next().toString(), DomainIndexConfig.class); - LOGGER.info("DomainIndexConfig id:: " + domainIndexConfig.getDomain()); - domainIndexConfigMap.put(domainIndexConfig.getDomain(), domainIndexConfig); - - } - LOGGER.info("After loading, domainIndexConfigMap size = "+ domainIndexConfigMap.size()); - - } catch (Exception e){ - LOGGER.error("Error occurred on construction domain collection map: "+ e.getMessage()); - } - - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/configfactory/EnhanceDomainConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/configfactory/EnhanceDomainConfig.java deleted file mode 100644 index 1d4c7d431d0..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/configfactory/EnhanceDomainConfig.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.ingestpipeline.configfactory; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.ingestpipeline.config.DomainConfig; -import com.ingestpipeline.model.DomainIndexConfig; -import com.ingestpipeline.util.ConfigLoader; -import com.ingestpipeline.util.Constants; - -//@JsonIgnoreProperties(ignoreUnknown=true) -@Component(Constants.DomainConfigurations.ENHANCE_DOMAIN_CONFIG) -public class EnhanceDomainConfig implements DomainConfig { - - private static final Logger LOGGER = LoggerFactory.getLogger(EnhanceDomainConfig.class); - private static final String ENHANCE_DOMAIN_CONFIG = Constants.DomainConfigurations.ENHANCE_DOMAIN_CONFIG + ".json"; - - - @Autowired - private ConfigLoader configLoader; - /** - * Holds domain name as key and it's index config detail as value. - */ - private Map domainIndexConfigMap = new HashMap<>(); - - public void putDomain(String domainName, DomainIndexConfig domainIndexConfig){ - domainIndexConfigMap.put(domainName, domainIndexConfig); - } - - @Override - public DomainIndexConfig getIndexConfig(String domainName){ - return domainIndexConfigMap.get(domainName); - } - - - /** - * loads once on application start up. - */ - @Override - public void loadDomains(){ - String enhanceConfigContent = configLoader.get(ENHANCE_DOMAIN_CONFIG); - //LOGGER.info("collectionConfigContent json string = "+collectionConfigContent); - - try{ - - ObjectMapper mapper = new ObjectMapper(); - JsonNode root = new ObjectMapper().readTree(enhanceConfigContent); - ArrayNode domainConfigArr = (ArrayNode) root.path(DOMAIN_CONFIG); - - Iterator iterator = domainConfigArr.elements(); - while (iterator.hasNext()) { - DomainIndexConfig domainIndexConfig = mapper.readValue(iterator.next().toString(), DomainIndexConfig.class); - LOGGER.info("DomainIndexConfig id:: " + domainIndexConfig.getDomain()); - domainIndexConfigMap.put(domainIndexConfig.getDomain(), domainIndexConfig); - - } - LOGGER.info("After loading, domainIndexConfigMap size = "+ domainIndexConfigMap.size()); - - } catch (Exception e){ - LOGGER.error("Error occurred on construction domain collection map: "+ e.getMessage()); - } - - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/ConsumerConfigurations.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/ConsumerConfigurations.java deleted file mode 100644 index 078db23f315..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/ConsumerConfigurations.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.ingestpipeline.consumer; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.kafka.clients.consumer.ConsumerConfig; -import org.apache.kafka.common.serialization.StringDeserializer; -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.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.kafka.annotation.EnableKafka; -import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory; -import org.springframework.kafka.core.ConsumerFactory; -import org.springframework.kafka.core.DefaultKafkaConsumerFactory; -import org.springframework.kafka.support.serializer.JsonDeserializer; - -/** - * The configurations for the Kafka Consumers are fed from this Config Class - * @author Darshan Nagesh - * - */ -@PropertySource(value= {"classpath:application.properties"}) -@Configuration -@EnableKafka -public class ConsumerConfigurations { - - @Autowired - org.springframework.core.env.Environment env; - - @Value("${spring.kafka.bootstrap.servers}") - private String serverConfig; - - @Value("${kafka.consumer.config.auto_commit}") - private Boolean enableAutoCommit; - - @Value("${kafka.consumer.config.auto_commit_interval}") - private String autoCommitInterval; - - @Value("${kafka.consumer.config.session_timeout}") - private String sessionTimeout; - - @Value("${kafka.consumer.config.group_id}") - private String groupId; - - @Value("${kafka.consumer.config.auto_offset_reset}") - private String autoOffsetReset; - - @Value("${spring.kafka.consumer.value-deserializer}") - private String valueDeserializer; - - @Value("${spring.kafka.consumer.key-deserializer}") - private String keyDeserializer; - - - public ConsumerFactory kafkaConsumerFactory() { - JsonDeserializer deserializer = new JsonDeserializer<>(Map.class); - //deserializer.setRemoveTypeHeaders(false); - deserializer.addTrustedPackages("*"); - deserializer.setUseTypeMapperForKey(true); - - Map props = new HashMap<>(); - props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, serverConfig); - props.put(ConsumerConfig.GROUP_ID_CONFIG, groupId); - return new DefaultKafkaConsumerFactory<>(props, new StringDeserializer(), deserializer); - } - - @Bean - public ConcurrentKafkaListenerContainerFactory incomingKafkaListenerContainerFactory() { - ConcurrentKafkaListenerContainerFactory factory = new ConcurrentKafkaListenerContainerFactory<>(); - factory.setConsumerFactory(kafkaConsumerFactory()); - return factory; - } - - - - /*@Bean - KafkaListenerContainerFactory> kafkaListenerContainerFactory() { - System.out.println("kafkaListenerContainerFactory"); - final ConcurrentKafkaListenerContainerFactory factory = new ConcurrentKafkaListenerContainerFactory<>(); - factory.setConsumerFactory(consumerFactory()); - factory.setConcurrency(3); - factory.getContainerProperties().setPollTimeout(3000); - return factory; - } - - @Bean - public ConsumerFactory consumerFactory() { - System.out.println("consumerFactory"); - return new DefaultKafkaConsumerFactory<>(consumerConfigs()); - } - - @Bean - public Map consumerConfigs() { - // TODO - Load configs from env vars - final Map propsMap = new HashMap<>(); - propsMap.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, serverConfig); - propsMap.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, enableAutoCommit); - propsMap.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, autoCommitInterval); - propsMap.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, sessionTimeout); - propsMap.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, autoOffsetReset); - propsMap.put(ConsumerConfig.GROUP_ID_CONFIG, groupId); - propsMap.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); - propsMap.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, HashMapDeserializer.class); -*//* propsMap.put(JsonDeserializer., "*"); -*//* return propsMap; - } - - @Bean - public ConcurrentKafkaListenerContainerFactory incomingKafkaListenerContainerFactory() { - ConcurrentKafkaListenerContainerFactory factory = new ConcurrentKafkaListenerContainerFactory<>(); - factory.setConsumerFactory(taskConsumerFactory()); - return factory; - } - - public ConsumerFactory taskConsumerFactory() { - Map props = new HashMap<>(); - props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092"); - props.put(ConsumerConfig.GROUP_ID_CONFIG, "task-group-notify"); - return new DefaultKafkaConsumerFactory<>(props, new StringDeserializer(), new JsonDeserializer<>(IncomingData.class)); - } -*/ - /* - * @Bean public TransactionPersistConsumer listener() { return new TransactionPersistConsumer(); } - */ -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/DigressionConsumer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/DigressionConsumer.java deleted file mode 100644 index ebca3f16c4e..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/DigressionConsumer.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.ingestpipeline.consumer; - -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.kafka.support.KafkaHeaders; -import org.springframework.messaging.handler.annotation.Header; - -import com.ingestpipeline.service.DigressService; -import com.ingestpipeline.util.Constants; - -public class DigressionConsumer implements KafkaConsumer { - public static final Logger LOGGER = LoggerFactory.getLogger(DigressionConsumer.class); - public static final String INTENT = "digress"; - - @Autowired - private DigressService digressService; - - @Override - @KafkaListener(topics = { Constants.KafkaTopics.VALID_DATA }, containerFactory = Constants.BeanContainerFactory.INCOMING_KAFKA_LISTENER) - public void processMessage(Map incomingData, - @Header(KafkaHeaders.RECEIVED_TOPIC) final String topic) { - LOGGER.info("##KafkaMessageAlert## : key:" + topic + ":" + "value:" + incomingData.size()); - try { - - } catch (final Exception e) { - LOGGER.error("Exception Encountered while processing the received message : " + e.getMessage()); - } - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/EnrichmentConsumer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/EnrichmentConsumer.java deleted file mode 100644 index 603a7beb33f..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/EnrichmentConsumer.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.ingestpipeline.consumer; - -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.kafka.support.KafkaHeaders; -import org.springframework.messaging.handler.annotation.Header; -import org.springframework.stereotype.Service; - -import com.ingestpipeline.producer.IngestProducer; -import com.ingestpipeline.service.EnrichmentService; -import com.ingestpipeline.service.IESService; -import com.ingestpipeline.util.Constants; - -@Service -public class EnrichmentConsumer implements KafkaConsumer { - - public static final Logger LOGGER = LoggerFactory.getLogger(EnrichmentConsumer.class); - private static final String ERROR_INTENT = "DataError"; - private static final String INTENT = "enrichment" ; - - @Value("${es.push.direct}") - private Boolean esPushDirect; - - @Value("${kafka.topics.enriched.data}") - private String enrichedDataTopic; - - @Value("${kafka.topics.enriched.key}") - private String enrichedDataKey; - - @Autowired - private EnrichmentService enrichmentService; - - @Autowired - private IngestProducer ingestProducer; - - @Autowired - private IESService elasticService; - - @KafkaListener(id = INTENT, groupId = INTENT, topics = { Constants.KafkaTopics.TRANSFORMED_DATA}, containerFactory = Constants.BeanContainerFactory.INCOMING_KAFKA_LISTENER) - public void processMessage(final Map incomingData, - @Header(KafkaHeaders.RECEIVED_TOPIC) final String topic) { - - LOGGER.info("##KafkaMessageAlert## : key:" + topic + ":" + "value:" + incomingData.size()); - - if(incomingData.get(Constants.DATA_CONTEXT) != null && !incomingData.get(Constants.DATA_CONTEXT).equals(Constants.TransformationType.COLLECTION) ){ - push(incomingData, null); - } else { - for(Object key : incomingData.keySet()){ - push((Map)incomingData.get(key), key.toString()); - } - } - } - - private void push(Map incomingData, String docId ) { - - try { - Map updatedIncomingData = enrichmentService.enrichData(incomingData); - - if(esPushDirect) { - LOGGER.info("##esPushDirect## : "+esPushDirect); - elasticService.push(incomingData); - } else { - LOGGER.info("Pushing to:: {} :: docId:: {}" , enrichedDataTopic, " docId:: "+docId); - ingestProducer.pushToPipeline(incomingData, enrichedDataTopic, docId); - } - if(updatedIncomingData == null) { - LOGGER.info("Incoming Data is null::"); - ingestProducer.pushToPipeline(incomingData, ERROR_INTENT, null); - } - } catch (final Exception e) { - LOGGER.error("Exception Encountered while processing the received message : " + e.getMessage()); - } - - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/HashMapDeserializer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/HashMapDeserializer.java deleted file mode 100644 index 76941d4f372..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/HashMapDeserializer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ingestpipeline.consumer; - -import java.util.HashMap; - -import org.springframework.kafka.support.serializer.JsonDeserializer; - -@SuppressWarnings("rawtypes") -public class HashMapDeserializer extends JsonDeserializer { - - public HashMapDeserializer() { - super(HashMap.class); - } - -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/IngestConsumer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/IngestConsumer.java deleted file mode 100644 index 6bce91526c6..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/IngestConsumer.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.ingestpipeline.consumer; - -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.kafka.support.KafkaHeaders; -import org.springframework.messaging.handler.annotation.Header; -import org.springframework.stereotype.Service; - -import com.ingestpipeline.model.IncomingData; -import com.ingestpipeline.service.IngestService; -import com.ingestpipeline.util.Constants; - -@Service -public class IngestConsumer{ - public static final Logger LOGGER = LoggerFactory.getLogger(IngestConsumer.class); - - @Autowired - private IngestService ingestService; - - @KafkaListener(topics = { "${kafka.topics.incoming.collection}" }, containerFactory = Constants.BeanContainerFactory.INCOMING_KAFKA_LISTENER) - public void processMessage(Map data, - @Header(KafkaHeaders.RECEIVED_TOPIC) final String topic) { - LOGGER.info("##KafkaMessageAlert## : key:" + topic + ":" + "value:" + data.size()); - try { - LOGGER.info("IngestConsumer ## get data ## " +data +" ## TOPIC ## "+topic); - IncomingData incomingData = ingestService.getContextForIncomingTopic(topic); - // LOGGER.info("## incomingData: "+incomingData); - incomingData.setDataObject(data.get("Data")); - //incomingData.setDataObject(data); - ingestService.ingestToPipeline(incomingData); - } catch (final Exception e) { - LOGGER.error("Exception Encountered while processing the received message : " + e.getMessage()); - } - } - - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/KafkaConsumer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/KafkaConsumer.java deleted file mode 100644 index 69374842c0e..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/KafkaConsumer.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.ingestpipeline.consumer; - -import org.springframework.kafka.support.KafkaHeaders; -import org.springframework.messaging.handler.annotation.Header; - -import com.ingestpipeline.model.IncomingData; - -import java.util.Map; - -public interface KafkaConsumer { - - public void processMessage(final Map incomingData, - @Header(KafkaHeaders.RECEIVED_TOPIC) final String topic); - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/TransformConsumer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/TransformConsumer.java deleted file mode 100644 index 63e0ea5eb2c..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/TransformConsumer.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ingestpipeline.consumer; - -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.kafka.support.KafkaHeaders; -import org.springframework.messaging.handler.annotation.Header; -import org.springframework.stereotype.Service; - -import com.ingestpipeline.producer.IngestProducer; -import com.ingestpipeline.service.TransformService; -import com.ingestpipeline.util.ApplicationProperties; -import com.ingestpipeline.util.Constants; - -@Service -public class TransformConsumer implements KafkaConsumer { - - public static final Logger LOGGER = LoggerFactory.getLogger(TransformConsumer.class); - public static final String INTENT = "transform"; - - @Autowired - @Qualifier(Constants.Qualifiers.TRANSFORM_COLLECTION_SERVICE) - private TransformService collectiontransformService; - - @Autowired - @Qualifier(Constants.Qualifiers.TRANSFORM_SERVICE) - private TransformService defaulttransformService; - - @Autowired - private IngestProducer ingestProducer; - - @Autowired - private ApplicationProperties applicationProperties; - - @Override - @KafkaListener(id = INTENT, groupId = INTENT, topics = { Constants.KafkaTopics.VALID_DATA }, containerFactory = Constants.BeanContainerFactory.INCOMING_KAFKA_LISTENER) - public void processMessage(Map incomingData, - @Header(KafkaHeaders.RECEIVED_TOPIC) final String topic) { - LOGGER.info("##KafkaMessageAlert## : key:" + topic + ":" + "value:" + incomingData.size()); - try { - boolean isTransformed = false; - String dataContext = incomingData.get(Constants.DATA_CONTEXT).toString(); - if(dataContext.equals(Constants.TransformationType.COLLECTION)) { - - isTransformed = collectiontransformService.transformData(incomingData); - } else { - - isTransformed = defaulttransformService.transformData(incomingData); - } - if (isTransformed) { - ingestProducer.pushToPipeline(incomingData, applicationProperties.getTransactionTransformationTopic(), null); - } - } catch (final Exception e) { - LOGGER.error("Exception Encountered while processing the received message : " + e.getMessage()); - } - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/UpdateConsumer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/UpdateConsumer.java deleted file mode 100644 index c838cfbd5f1..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/UpdateConsumer.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.ingestpipeline.consumer; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.ingestpipeline.producer.IngestProducer; -import com.ingestpipeline.service.IESService; -import com.ingestpipeline.util.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.ResponseEntity; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.kafka.support.KafkaHeaders; -import org.springframework.messaging.handler.annotation.Header; -import org.springframework.stereotype.Component; - -import java.util.Map; -import java.net.URLEncoder; - -@Component -public class UpdateConsumer { - - - public static final Logger LOGGER = LoggerFactory.getLogger(UpdateConsumer.class); - private static final String ERROR_INTENT = "DataErrorBypass"; - @Autowired - private IngestProducer ingestProducer; - @Autowired - private ObjectMapper mapper; - @Autowired - private IESService elasticService; - - @Value("${kafka.topics.bypass.update.post}") - String updatedPostTopic; - - @Value("${es.bypass.push.direct}") - private Boolean esPushDirect; - - @KafkaListener(topics = "${kafka.topics.bypass.update.data}" , containerFactory = Constants.BeanContainerFactory.INCOMING_KAFKA_LISTENER) - public void processMessage(Map data, - @Header(KafkaHeaders.RECEIVED_TOPIC) final String topic) { - LOGGER.info("##KafkaMessageAlert## : key:" + topic + ":" + "value:" + data.size()); - try { - - String index = data.get("_index").toString(); - String type = data.get("_type").toString(); - JsonNode sourceNode = mapper.convertValue(data.get("_source"), JsonNode.class); - String _id = data.get("_id").toString(); - String id = URLEncoder.encode(data.get("_id").toString()); - - if(esPushDirect){ - ResponseEntity response = elasticService.post(index, type, id, "", sourceNode.toString()); - LOGGER.info("index :: {}, Response :: {} " ,index , response.getStatusCode()); - } else { - ingestProducer.pushToPipeline(sourceNode, updatedPostTopic, _id); - } - - } catch (final Exception e) { - StringBuilder str = new StringBuilder("Exception occurred while processing Message on Topic : "); - str.append(topic).append("Exception: "); - LOGGER.error(str.toString(), e); - if(!esPushDirect) - ingestProducer.pushToPipeline(data, ERROR_INTENT, null); - } - } - - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/ValidatorConsumer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/ValidatorConsumer.java deleted file mode 100644 index fec3b49fd83..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/consumer/ValidatorConsumer.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ingestpipeline.consumer; - -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.kafka.support.KafkaHeaders; -import org.springframework.messaging.handler.annotation.Header; -import org.springframework.stereotype.Service; - -import com.ingestpipeline.producer.IngestProducer; -import com.ingestpipeline.service.ValidationService; -import com.ingestpipeline.util.ApplicationProperties; -import com.ingestpipeline.util.Constants; - -@Service -public class ValidatorConsumer implements KafkaConsumer { - - public static final Logger LOGGER = LoggerFactory.getLogger(ValidatorConsumer.class); - - public static final String INTENT = "validator"; - - @Autowired - private ValidationService validationService; - - @Autowired - private IngestProducer ingestProducer; - - @Autowired - private ApplicationProperties applicationProperties; - - @KafkaListener(id = INTENT, groupId = INTENT, topics = {Constants.KafkaTopics.INGEST_DATA} , containerFactory = Constants.BeanContainerFactory.INCOMING_KAFKA_LISTENER) - public void processMessage(Map consumerRecord, - @Header(KafkaHeaders.RECEIVED_TOPIC) final String topic) { - LOGGER.info("##KafkaMessageAlert## Message Received at Validator Consumer : key:" + topic + ":" + "value:" + consumerRecord.size()); - try { - boolean isValid = validationService.validateData(consumerRecord); - String nextTopic = ""; - String nextKey = ""; - if (isValid) { - if(applicationProperties.getPipelineRules().get(Constants.PipelineRules.TRANSFORM_DATA)) { - nextTopic = applicationProperties.getTransactionValidationTopic(); - nextKey = applicationProperties.getTransactionValidationKey(); - } else if(applicationProperties.getPipelineRules().get(Constants.PipelineRules.ENRICH_DATA)) { - nextTopic = applicationProperties.getTransactionTransformationTopic(); - nextKey = applicationProperties.getTransactionTransformationKey(); - } - ingestProducer.pushToPipeline(consumerRecord, nextTopic, null); - } else { - ingestProducer.pushToPipeline(consumerRecord, Constants.KafkaTopics.ERROR_INTENT, null); - } - LOGGER.info("Next Topic: " + nextTopic); - LOGGER.info("Next Key: " + nextKey); - - } catch (final Exception e) { - LOGGER.error("Exception Encountered while processing the received message : " + e.getMessage()); - } - - - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/controller/ProducerController.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/controller/ProducerController.java deleted file mode 100644 index 7acc48402f7..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/controller/ProducerController.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.ingestpipeline.controller; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.ingestpipeline.model.Response; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.kafka.core.KafkaTemplate; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - - -@RestController -public class ProducerController { - - public static final Logger LOGGER = LoggerFactory.getLogger(ProducerController.class); - - @Value("${kafka.topics.bypass.update.data}") - private String topic; - @Value("${kafka.topics.bypass.update.key}") - private String topickey; - @Autowired - private KafkaTemplate kafkaTemplate; - - @PostMapping("/update/publish") - public ResponseEntity publish(@RequestBody String body){ - LOGGER.info("publishing request body "+body); - try{ - - JsonNode bodyNode = new ObjectMapper().readTree(body); - ArrayNode nodes = (ArrayNode) bodyNode.get("data"); - LOGGER.info("## nodes ## "+nodes); - for(JsonNode node : nodes ){ - LOGGER.info("single node "+node); - kafkaTemplate.send(topic, topickey, node); - - } - LOGGER.info("Published successfully"); - return new ResponseEntity(new Response("sucessful", "Published successfully"), HttpStatus.OK); - - } catch (Exception e){ - LOGGER.error("Published failed "+ e.getMessage()); - return new ResponseEntity(new Response("failed", e.getMessage()), HttpStatus.BAD_REQUEST); - } - - } - - @Value("${kafka.topics.incoming.collection}") - private String testTopic; - @Value("${kafka.topics.enriched.key}") - private String testKey; - - @PostMapping("/update/collection/test") - public String test(@RequestBody String body){ - try{ - JsonNode node = new ObjectMapper().readTree(body); - kafkaTemplate.send(testTopic, testKey, node.get("data")); - LOGGER.info("Published successfully"); - return "Published successfully"; - - } catch (Exception e){ - LOGGER.error("Published failed "+ e.getMessage()); - return "Published failed: "+e.getMessage(); - } - - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/controller/RestApiController.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/controller/RestApiController.java deleted file mode 100644 index 382b94914c2..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/controller/RestApiController.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.ingestpipeline.controller; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; - -import org.json.JSONArray; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.kafka.config.KafkaListenerEndpointRegistry; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.gson.Gson; -import com.ingestpipeline.model.IncomingData; -import com.ingestpipeline.model.TargetData; -import com.ingestpipeline.repository.TargetDataDao; -import com.ingestpipeline.service.ElasticService; -import com.ingestpipeline.service.IngestService; -import com.ingestpipeline.util.Constants; -import com.ingestpipeline.util.JSONUtil; -import com.ingestpipeline.util.ReadUtil; - -@RestController -@RequestMapping(Constants.Paths.ELASTIC_PUSH_CONTROLLER_PATH) -public class RestApiController { - - public static final Logger logger = LoggerFactory.getLogger(RestApiController.class); - - @Value("${id.timezone}") - private String timeZone; - - @Autowired - IngestService ingestService; - - @Autowired - TargetDataDao targetDataDao; - - @Autowired - private KafkaListenerEndpointRegistry endPointRegistry; - - @Autowired - private ElasticService elasticService; - - /** - * This API use to pause a active kafka consumer - * - * @param consumerId kafka consumer identifier - * @return - */ - @RequestMapping(value = "/pause/{consumerId}", method = RequestMethod.GET) - public Boolean pauseConsumer(@PathVariable final String consumerId) { - endPointRegistry.getListenerContainer(consumerId).pause(); - return Boolean.TRUE; - } - - /** - * This API is to resume a paused kafka consumer - * - * @param consumerId kafka consumer identifier - * @return - */ - @RequestMapping(value = "/resume/{consumerId}", method = RequestMethod.GET) - public Boolean resumeConsumer(@PathVariable final String consumerId) { - endPointRegistry.getListenerContainer(consumerId).resume(); - return Boolean.TRUE; - } - - /** - * This API receives the Transaction Details JSON Request and passes it on to - * the Service Layer for further process of persisting into elastic search - * database - * - * @param transaction - * @return - */ - @RequestMapping(value = Constants.Paths.SAVE, method = RequestMethod.POST) - public ResponseEntity save(@RequestBody IncomingData incomingData) { - logMyTime(); - Boolean status = ingestService.ingestToPipeline(incomingData); - if (status) { - return new ResponseEntity(HttpStatus.CREATED); - } - return new ResponseEntity(HttpStatus.SERVICE_UNAVAILABLE); - } - - /** - * This API use to provide response for external data upload - * - * @param get file - * @author Rahul - * @throws Exception - */ - @RequestMapping(value = Constants.Paths.Targets, method = RequestMethod.GET) - public String getTargets() throws Exception { - List datas = (List) targetDataDao.findAll(); - String response = JSONUtil.getJsonString(new ObjectMapper(), datas); - return response; - } - - /** - * This API use to import external data upload Request - * - * @param upload file - * @author Rahul - * @throws Exception - */ - @RequestMapping(value = Constants.Paths.UPLOAD, method = RequestMethod.POST) - public ResponseEntity handleFileUpload(@RequestParam("file") MultipartFile file) throws Exception { - Boolean status = ingestService.ingestToPipeline(getWrapper(file)); - if (status) { - return new ResponseEntity(HttpStatus.CREATED); - } - return new ResponseEntity(HttpStatus.SERVICE_UNAVAILABLE); - } - - public IncomingData getWrapper(MultipartFile file) throws Exception { - JSONArray jsonArray = new JSONArray(); - jsonArray = ReadUtil.getFiletoDirectory(file); - IncomingData incomingData = new IncomingData(); - incomingData.setDataContext("target"); - incomingData.setDataContextVersion("v1"); - Iterator itr = jsonArray.iterator(); - List list = new ArrayList(); - while (itr.hasNext()) { - JSONObject obj = (JSONObject) itr.next(); - Map mapJ = new Gson().fromJson(obj.toString(), Map.class); - list.add(mapJ); - } - incomingData.setDataObject(list); - return incomingData; - } - - /** - * This API to post documents from ES index - * - * @param post documents - * @author Rahul - * @throws Exception - */ - @RequestMapping(value = "/migrate/{indexName}/{version}", method = RequestMethod.POST) - public ResponseEntity migrateIndex(@PathVariable String indexName, @PathVariable String version) throws Exception { - String index = null, queryString = null, dataContext = null; - Boolean status = elasticService.searchIndex(indexName, queryString, version); - if (status) { - return new ResponseEntity(HttpStatus.CREATED); - } else { - return new ResponseEntity(HttpStatus.NOT_FOUND); - } - } - -/** - * This API to post documents from ES index - * - * @param post documents - * @author Rahul - * @throws Exception - */ - @RequestMapping(value = "/migrateV2/{indexName}/{version}", method = RequestMethod.GET) - public ResponseEntity migrateIndexV2(@PathVariable String indexName, @PathVariable String dataContextVersion) throws Exception { - String index = null, queryString = null, dataContext = null; - Boolean status = elasticService.searchIndex(indexName, queryString, dataContextVersion); - if (status) { - return new ResponseEntity(HttpStatus.CREATED); - } else if (index.equals("notDefinedIndex")) { - return new ResponseEntity(HttpStatus.NOT_FOUND); - } - return new ResponseEntity(HttpStatus.SERVICE_UNAVAILABLE); - } - - private void logMyTime() { - logger.info("System Time is : " + new Date()); - SimpleDateFormat sd = new SimpleDateFormat(Constants.DATE_FORMAT); - Date date = new Date(); - sd.setTimeZone(TimeZone.getTimeZone(timeZone)); - logger.info("Time at timezone IST : " + sd.format(date)); - } -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Consumable.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Consumable.java deleted file mode 100644 index 7f34f9f9539..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Consumable.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.ingestpipeline.model; - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ -"dataContext", -"topics" -}) -public class Consumable { - -@JsonProperty("dataContext") -private String dataContext; -@JsonProperty("topics") -private List topics = null; -@JsonIgnore -private Map additionalProperties = new HashMap(); - -@JsonProperty("dataContext") -public String getDataContext() { -return dataContext; -} - -@JsonProperty("dataContext") -public void setDataContext(String dataContext) { -this.dataContext = dataContext; -} - -@JsonProperty("topics") -public List getTopics() { -return topics; -} - -@JsonProperty("topics") -public void setTopics(List topics) { -this.topics = topics; -} - -@JsonAnyGetter -public Map getAdditionalProperties() { -return this.additionalProperties; -} - -@JsonAnySetter -public void setAdditionalProperty(String name, Object value) { -this.additionalProperties.put(name, value); -} - -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DigressionPoint.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DigressionPoint.java deleted file mode 100644 index e65fd4f7b75..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DigressionPoint.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.ingestpipeline.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "dataContext", "paths" }) -public class DigressionPoint { - - @JsonProperty("dataContext") - private String dataContext; - @JsonProperty("paths") - private List paths = null; - - public String getDataContext() { - return dataContext; - } - - public void setDataContext(String dataContext) { - this.dataContext = dataContext; - } - - public List getPaths() { - return paths; - } - - public void setPaths(List paths) { - this.paths = paths; - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DigressionPointConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DigressionPointConfig.java deleted file mode 100644 index 94a271e5565..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DigressionPointConfig.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ingestpipeline.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ -"digressionPoints" -}) -public class DigressionPointConfig { - -@JsonProperty("digressionPoints") -private List digressionPoints = null; -@JsonIgnore -private Map additionalProperties = new HashMap(); - -@JsonProperty("digressionPoints") -public List getDigressionPoints() { -return digressionPoints; -} - -@JsonProperty("digressionPoints") -public void setDigressionPoints(List digressionPoints) { -this.digressionPoints = digressionPoints; -} - -@JsonAnyGetter -public Map getAdditionalProperties() { -return this.additionalProperties; -} - -@JsonAnySetter -public void setAdditionalProperty(String name, Object value) { -this.additionalProperties.put(name, value); -} - -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DomainIndexConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DomainIndexConfig.java deleted file mode 100644 index 043db28caec..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/DomainIndexConfig.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.ingestpipeline.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.ArrayList; -import java.util.List; - -public class DomainIndexConfig { - - private String id; - private String domain; - private String indexName; - private String documentType; - private String query; - - private List sourceReferences = new ArrayList<>(); - private List targetReferences = new ArrayList<>(); - - @JsonProperty(value="sourceReferences") - public List getSourceReferences() { - return sourceReferences; - } - - public void setSourceReferences(List sourceReferences) { - this.sourceReferences = sourceReferences; - } - @JsonProperty(value="targetReferences") - public List getTargetReferences() { - return targetReferences; - } - - public void setTargetReferences(List targetReferences) { - this.targetReferences = targetReferences; - } - - @JsonProperty(value="id") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - @JsonProperty(value="domain") - public String getDomain() { - return domain; - } - - public void setDomain(String businessType) { - this.domain = businessType; - } - - @JsonProperty(value="indexName") - public String getIndexName() { - return indexName; - } - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - @JsonProperty(value="documentType") - public String getDocumentType() { - return documentType; - } - - public void setDocumentType(String documentType) { - this.documentType = documentType; - } - - @JsonProperty(value="query") - public String getQuery() { - return query; - } - - public void setQuery(String query) { - this.query = query; - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/ErrorWrapper.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/ErrorWrapper.java deleted file mode 100644 index a38b00c64ed..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/ErrorWrapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ingestpipeline.model; - -public class ErrorWrapper { - - private String errorCode; - private String errorMessage; - private Object incomingData; - - public String getErrorCode() { - return errorCode; - } - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - public String getErrorMessage() { - return errorMessage; - } - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - public Object getIncomingData() { - return incomingData; - } - public void setIncomingData(Object incomingData) { - this.incomingData = incomingData; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/IncomingData.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/IncomingData.java deleted file mode 100644 index ce02ff52fdf..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/IncomingData.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.ingestpipeline.model; - -public class IncomingData { - - private String dataContext; - private String dataContextVersion; - private Object dataObject; - - public String getDataContext() { - return dataContext; - } - public void setDataContext(String dataContext) { - this.dataContext = dataContext; - } - public String getDataContextVersion() { - return dataContextVersion; - } - public void setDataContextVersion(String dataContextVersion) { - this.dataContextVersion = dataContextVersion; - } - public Object getDataObject() { - return dataObject; - } - public void setDataObject(Object dataObject) { - this.dataObject = dataObject; - } - @Override - public String toString() { - return "IncomingData [dataContext=" + dataContext + ", dataContextVersion=" + dataContextVersion - + ", dataObject=" + dataObject + "]"; - } - - - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/IncomingDataConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/IncomingDataConfig.java deleted file mode 100644 index f9ac55dce40..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/IncomingDataConfig.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.ingestpipeline.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ -"consumables" -}) -public class IncomingDataConfig { - -@JsonProperty("consumables") -private List consumables = null; -@JsonIgnore -private Map additionalProperties = new HashMap(); - -@JsonProperty("consumables") -public List getConsumables() { -return consumables; -} - -@JsonProperty("consumables") -public void setConsumables(List consumables) { -this.consumables = consumables; -} - -@JsonAnyGetter -public Map getAdditionalProperties() { -return this.additionalProperties; -} - -@JsonAnySetter -public void setAdditionalProperty(String name, Object value) { -this.additionalProperties.put(name, value); -} - -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/KeyValuePair.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/KeyValuePair.java deleted file mode 100644 index 3556caf66b3..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/KeyValuePair.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.ingestpipeline.model; - -import java.util.HashMap; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ -"name", -"value", -"intent" -}) -public class KeyValuePair { - -@JsonProperty("intent") -private String intent; -@JsonProperty("name") -private String name; -@JsonProperty("value") -private String value; -@JsonIgnore -private Map additionalProperties = new HashMap(); - -@JsonProperty("name") -public String getName() { -return name; -} - -@JsonProperty("name") -public void setName(String name) { -this.name = name; -} - -@JsonProperty("intent") -public String getIntent() { -return intent; -} - -@JsonProperty("intent") -public void setIntent(String intent) { -this.intent = intent; -} - - - -@JsonProperty("value") -public String getValue() { -return value; -} - -@JsonProperty("value") -public void setValue(String value) { -this.value = value; -} - -@JsonAnyGetter -public Map getAdditionalProperties() { -return this.additionalProperties; -} - -@JsonAnySetter -public void setAdditionalProperty(String name, Object value) { -this.additionalProperties.put(name, value); -} - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Path.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Path.java deleted file mode 100644 index 38c35ed9494..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Path.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.ingestpipeline.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ "route", "paths" }) -public class Path { - - @JsonProperty("route") - private String route; - - @JsonProperty("paths") - private List paths; - - @JsonProperty("removeReplace") - private String removeReplace; - - public String getRemoveReplace() { - return removeReplace; - } - - public void setRemoveReplace(String removeReplace) { - this.removeReplace = removeReplace; - } - - public List getPaths() { - return paths; - } - - public void setPaths(List paths) { - this.paths = paths; - } - - @JsonIgnore - private Map additionalProperties = new HashMap(); - - @JsonProperty("route") - public String getRoute() { - return route; - } - - @JsonProperty("route") - public void setRoute(String route) { - this.route = route; - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - @JsonAnySetter - public void setAdditionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - } -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/References.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/References.java deleted file mode 100644 index 130eac810b0..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/References.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.ingestpipeline.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class References { - - - private String fieldName; - private String argument; - private String dataType; - private String value; - private String seperator; - private String expression; - - @JsonProperty(value="fieldName") - public String getFieldName() { - return fieldName; - } - - public void setFieldName(String fieldName) { - this.fieldName = fieldName; - } - - @JsonProperty(value="argument") - public String getArgument() { - return argument; - } - - public void setArgument(String argument) { - this.argument = argument; - } - - @JsonProperty(value="dataType") - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - @JsonProperty(value="value") - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - @JsonProperty(value="seperator") - public String getSeperator() { - return seperator; - } - - public void setSeperator(String seperator) { - this.seperator = seperator; - } - @JsonProperty(value="expression") - public String getExpression() { - return expression; - } - - public void setExpression(String expression) { - this.expression = expression; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Response.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Response.java deleted file mode 100644 index 84f69a2800e..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Response.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ingestpipeline.model; - -public class Response { - - private String message; - private String status; - - public Response(String status, String message){ - this.message = message; - this.status = status; - } - - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Snippet.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Snippet.java deleted file mode 100644 index 69d1e509c57..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/Snippet.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ingestpipeline.model; - -public class Snippet { - public static void main(String[] args) { - - } -} - diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/SourceReferences.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/SourceReferences.java deleted file mode 100644 index 7e7fd4ae062..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/SourceReferences.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.ingestpipeline.model; - -public class SourceReferences extends References{ - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TargetData.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TargetData.java deleted file mode 100644 index 168bc94cfec..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TargetData.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.ingestpipeline.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import java.io.Serializable; -import java.math.BigDecimal; - -@Entity -@Table(name = "TargetData") -@JsonIgnoreProperties -public class TargetData implements Serializable { - - @Id /*@GeneratedValue(strategy=GenerationType.AUTO) */ - @Column(name = "id", nullable = false) - private int id; - - @Column(name = "snoForMunicipalCorporation", nullable = false) - private String snoForMunicipalCorporation; - - @Column(name = "tenantIdForMunicipalCorporation", nullable = false) - private String tenantIdForMunicipalCorporation; - - @Column(name = "ulbName", nullable = false) - private String ulbName; - - @Column(name = "actualCollectionForMunicipalCorporation", nullable = false) - private BigDecimal actualCollectionForMunicipalCorporation; - - @Column(name = "budgetProposedForMunicipalCorporation", nullable = false) - private BigDecimal budgetProposedForMunicipalCorporation; - - @Column(name = "actualCollectionBudgetedForMunicipalCorporation", nullable = false) - private BigDecimal actualCollectionBudgetedForMunicipalCorporation; - - @Column(name = "financialYear", nullable = false) - private String financialYear; - - @Column(name = "Timestamp", nullable = false) - private String Timestamp; - - @Column(name = "businessService", nullable = false) - private String businessService; - - public TargetData() { - super(); - // TODO Auto-generated constructor stub - } - - @JsonProperty("id") - public int getId() { - return id; - } - @JsonProperty("id") - public void setId(int id) { - this.id = id; - } - @JsonProperty("snoForMunicipalCorporation") - public String getSnoForMunicipalCorporation() { - return snoForMunicipalCorporation; - } - - public void setSnoForMunicipalCorporation(String snoForMunicipalCorporation) { - this.snoForMunicipalCorporation = snoForMunicipalCorporation; - } - @JsonProperty("tenantIdForMunicipalCorporation") - public String getTenantIdForMunicipalCorporation() { - return tenantIdForMunicipalCorporation; - } - - public void setTenantIdForMunicipalCorporation(String tenantIdForMunicipalCorporation) { - this.tenantIdForMunicipalCorporation = tenantIdForMunicipalCorporation; - } - @JsonProperty("ulbName") - public String getUlbName() { - return ulbName; - } - @JsonProperty("ulbName") - public void setUlbName(String ulbName) { - this.ulbName = ulbName; - } - @JsonProperty("actualCollectionForMunicipalCorporation") - public BigDecimal getActualCollectionForMunicipalCorporation() { - return actualCollectionForMunicipalCorporation; - } - @JsonProperty("actualCollectionForMunicipalCorporation") - public void setActualCollectionForMunicipalCorporation(BigDecimal actualCollectionForMunicipalCorporation) { - this.actualCollectionForMunicipalCorporation = actualCollectionForMunicipalCorporation; - } - @JsonProperty("budgetProposedForMunicipalCorporation") - public BigDecimal getBudgetProposedForMunicipalCorporation() { - return budgetProposedForMunicipalCorporation; - } - @JsonProperty("budgetProposedForMunicipalCorporation") - public void setBudgetProposedForMunicipalCorporation(BigDecimal budgetProposedForMunicipalCorporation) { - this.budgetProposedForMunicipalCorporation = budgetProposedForMunicipalCorporation; - } - @JsonProperty("actualCollectionBudgetedForMunicipalCorporation") - public BigDecimal getActualCollectionBudgetedForMunicipalCorporation() { - return actualCollectionBudgetedForMunicipalCorporation; - } - @JsonProperty("actualCollectionBudgetedForMunicipalCorporation") - public void setActualCollectionBudgetedForMunicipalCorporation(BigDecimal actualCollectionBudgetedForMunicipalCorporation) { - this.actualCollectionBudgetedForMunicipalCorporation = actualCollectionBudgetedForMunicipalCorporation; - } - @JsonProperty("financialYear") - public String getFinancialYear() { - return financialYear; - } - @JsonProperty("financialYear") - public void setFinancialYear(String financialYear) { - this.financialYear = financialYear; - } - @JsonProperty("Timestamp") - public String getTimestamp() { - return Timestamp; - } - @JsonProperty("Timestamp") - public void setTimestamp(String timestamp) { - Timestamp = timestamp; - } - @JsonProperty("businessService") - public String getBusinessService() { - return businessService; - } - @JsonProperty("businessService") - public void setBusinessService(String businessService) { - this.businessService = businessService; - } - - @Override - public String toString() { - return "TargetData [id=" + id + ", snoForMunicipalCorporation=" + snoForMunicipalCorporation - + ", tenantIdForMunicipalCorporation=" + tenantIdForMunicipalCorporation + ", ulbName=" + ulbName - + ", actualCollectionForMunicipalCorporation=" + actualCollectionForMunicipalCorporation - + ", budgetProposedForMunicipalCorporation=" + budgetProposedForMunicipalCorporation - + ", actualCollectionBudgetedForMunicipalCorporation=" + actualCollectionBudgetedForMunicipalCorporation - + ", financialYear=" + financialYear + ", Timestamp=" + Timestamp + ", businessService=" - + businessService + "]"; - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TargetReferences.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TargetReferences.java deleted file mode 100644 index 8e498414680..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TargetReferences.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.ingestpipeline.model; - -public class TargetReferences extends References{ - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TopicContext.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TopicContext.java deleted file mode 100644 index f079c575381..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TopicContext.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ingestpipeline.model; - -public class TopicContext { - - private String topic; - private String dataContext; - private String dataContextVersion; - public String getTopic() { - return topic; - } - public void setTopic(String topic) { - this.topic = topic; - } - public String getDataContext() { - return dataContext; - } - public void setDataContext(String dataContext) { - this.dataContext = dataContext; - } - public String getDataContextVersion() { - return dataContextVersion; - } - public void setDataContextVersion(String dataContextVersion) { - this.dataContextVersion = dataContextVersion; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TopicContextConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TopicContextConfig.java deleted file mode 100644 index 5662f017a26..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/model/TopicContextConfig.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ingestpipeline.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import java.util.ArrayList; -import java.util.List; - -public class TopicContextConfig { - - private List topicContexts = new ArrayList<>(); - - @JsonProperty(value = "topicContextConfigurations") - public List getTopicContexts() { - return topicContexts; - } - public void setTopicContexts(List topicContexts) { - this.topicContexts = topicContexts; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/HashMapSerializer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/HashMapSerializer.java deleted file mode 100644 index b2840c3c35b..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/HashMapSerializer.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.ingestpipeline.producer; - -import java.util.Map; - -import org.apache.kafka.common.serialization.Serializer; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class HashMapSerializer implements Serializer { - @Override - public void close() { - // TODO Auto-generated method stub - } - - @Override - public void configure(Map arg0, boolean arg1) { - // TODO Auto-generated method stub - } - - @Override - public byte[] serialize(String topic, Map data) { - byte[] value = null; - ObjectMapper objectMapper = new ObjectMapper(); - try { - value = objectMapper.writeValueAsString(data).getBytes(); - } catch (JsonProcessingException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return value; - } -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/IngestProducer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/IngestProducer.java deleted file mode 100644 index 46038684f04..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/IngestProducer.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ingestpipeline.producer; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.kafka.core.KafkaTemplate; -import org.springframework.stereotype.Service; - -import com.google.gson.Gson; - -@Service -public class IngestProducer { - - public static final Logger LOGGER = LoggerFactory.getLogger(IngestProducer.class); - - @Autowired - private KafkaTemplate kafkaTemplate; - - public void pushToPipeline(Object object, String topic, String key) { - LOGGER.info("Kafka Topic : " + topic + " Kafka Key : " + key); - kafkaTemplate.send(topic, key, object); - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/IngestProducerConfig.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/IngestProducerConfig.java deleted file mode 100644 index a65fbbb3384..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/IngestProducerConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.ingestpipeline.producer; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.kafka.clients.producer.ProducerConfig; -import org.apache.kafka.common.serialization.StringSerializer; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.kafka.annotation.EnableKafka; -import org.springframework.kafka.core.DefaultKafkaProducerFactory; -import org.springframework.kafka.core.KafkaTemplate; -import org.springframework.kafka.core.ProducerFactory; -import org.springframework.kafka.support.serializer.JsonSerializer; - -@Configuration -@EnableKafka -public class IngestProducerConfig { - - @Value("${spring.kafka.bootstrap.servers}") - private String serverConfig; - - @Value("${kafka.producer.config.retries_config}") - private Integer retriesConfig; - - @Value("${kafka.producer.config.batch_size_config}") - private Integer batchSizeConfig; - - @Value("${kafka.producer.config.linger_ms_config}") - private Integer lingerMsConfig; - - @Value("${kafka.producer.config.buffer_memory_config}") - private Integer bufferMemoryConfig; - - @Bean - public ProducerFactory producerFactory() { - Map configProps = new HashMap<>(); - configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, serverConfig); - configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); - configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class); - return new DefaultKafkaProducerFactory<>(configProps); - } - - @Bean - public KafkaTemplate kafkaTemplate() { - return new KafkaTemplate<>(producerFactory()); - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/JavaSerializer.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/JavaSerializer.java deleted file mode 100644 index b99d213953a..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/producer/JavaSerializer.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.ingestpipeline.producer; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.util.Map; - -import org.apache.kafka.common.serialization.Serializer; - -public class JavaSerializer implements Serializer { - - @Override - public byte[] serialize(String topic, Object data) { - try { - ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); - ObjectOutputStream objectStream = new ObjectOutputStream(byteStream); - objectStream.writeObject(data); - objectStream.flush(); - objectStream.close(); - return byteStream.toByteArray(); - } - catch (IOException e) { - throw new IllegalStateException("Can't serialize object: " + data, e); - } - } - - @Override - public void configure(Map configs, boolean isKey) { - - } - - @Override - public void close() { - - } - -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/repository/ElasticSearchRepository.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/repository/ElasticSearchRepository.java deleted file mode 100644 index 27a9d4a2898..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/repository/ElasticSearchRepository.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.ingestpipeline.repository; - -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.HttpServerErrorException; -import org.springframework.web.client.RestTemplate; - -import com.ingestpipeline.util.Constants; - -/** - * This Repository Class is used to perform the transactions of storing the data into the Elastic Search Repository - * @author Darshan Nagesh - * - */ -@Service -public class ElasticSearchRepository { - - public static final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchRepository.class); - - private final RestTemplate restTemplate; - - public ElasticSearchRepository(RestTemplate restTemplate) { - this.restTemplate = restTemplate; - } - - /** - * Based on the Transaction Index Data Obtained and the URL with Headers, this method will put the Data obtained on the - * Elastic Search Database and returns the response in the form of Positive or Negative outcome (True Or False) - * @param transactionIndex - * @param url - * @param headers - * @return - */ - public Boolean saveMyDataObject(Object object, String url, HttpHeaders headers) { - ResponseEntity map = null; - try { - map = restTemplate.exchange(url, HttpMethod.PUT, - new HttpEntity<>(object, headers), Map.class); - } catch (final HttpClientErrorException httpClientErrorException) { - LOGGER.error("Error : " + httpClientErrorException); - } catch (HttpServerErrorException httpServerErrorException) { - LOGGER.error("Error : " + httpServerErrorException); - } catch (Exception e) { - LOGGER.error("Error : " + e); - } - if (map != null && map.getStatusCode() != null && (map.getStatusCode() == HttpStatus.OK) || (map.getStatusCode() == HttpStatus.CREATED)) { - return true; - } - return false; - } - - public ResponseEntity fetchMDMSResponse(Object mdmsRequestObject) { - - HttpHeaders headers = new HttpHeaders(); - headers.set(Constants.CONTENT_TYPE, Constants.JSON); - - HttpEntity httpEntity = new HttpEntity<>(mdmsRequestObject, headers); - ResponseEntity result = restTemplate.exchange(Constants.MDMS_URL, HttpMethod.POST, httpEntity, Map.class); - - return result; - } - } diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/repository/TargetDataDao.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/repository/TargetDataDao.java deleted file mode 100644 index 50fea5867df..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/repository/TargetDataDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ingestpipeline.repository; - -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonSubTypes.Type; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeInfo.As; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.ingestpipeline.model.TargetData; -import org.springframework.data.repository.CrudRepository; -import org.springframework.stereotype.Repository; - -@Repository -public interface TargetDataDao extends CrudRepository { - -/* public List findAll(); - - public void save(TargetData targetData);*/ -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/CollectionTransformationService.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/CollectionTransformationService.java deleted file mode 100644 index ba47ba7fb7c..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/CollectionTransformationService.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.ingestpipeline.service; - -import com.bazaarvoice.jolt.Chainr; -import com.bazaarvoice.jolt.JsonUtils; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.ingestpipeline.util.ConfigLoader; -import com.ingestpipeline.util.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -@Service(Constants.Qualifiers.TRANSFORM_COLLECTION_SERVICE) -public class CollectionTransformationService implements TransformService { - - public static final Logger LOGGER = LoggerFactory.getLogger(CollectionTransformationService.class); - - - private static final String SEPARATOR = "_"; - private static final String JSON_EXTENSION = ".json"; - private static final String OBJECTIVE = "transform"; - private static final String CONFIGROOT = "config/"; - private static final String JOLT_SPEC = "spec"; - - private static final String TRANSACTION_ID = "transactionId"; - private static final String ID = "id"; - - - - @Autowired - private ConfigLoader configLoader; - - private String previousKey= ""; - - @Override - public Boolean transformData(Map incomingData) { - - Map incomingDataCopy = new HashMap<>(); - incomingDataCopy.putAll(incomingData); - incomingData.clear(); - - String dataContext = incomingDataCopy.get(Constants.DATA_CONTEXT).toString(); - String dataContextVersion = incomingDataCopy.get(Constants.DATA_CONTEXT_VERSION).toString(); - ObjectMapper mapper = new ObjectMapper(); - List chainrSpecJSON = null ; - - try { - - JsonNode incomingNode = mapper.convertValue(incomingDataCopy, JsonNode.class); - //LOGGER.info("incoming data: "+incomingNode); - //JsonNode identifier = incomingNode.get(Constants.DATA_OBJECT).get(TRANSACTION_ID); - - - //To change: for loading the file from config root - String trsFile = OBJECTIVE.concat(SEPARATOR).concat(dataContext).concat(SEPARATOR).concat(dataContextVersion).concat(JSON_EXTENSION); - String strFile = configLoader.get(trsFile); - JsonNode specNode = mapper.readTree(strFile); - // LOGGER.info("specNode:## "+specNode); - - - /*LOGGER.info("sourceUrl## "+strFile); - - String sourceUrl = CONFIGROOT.concat(OBJECTIVE.concat(SEPARATOR).concat(dataContext).concat(SEPARATOR).concat(dataContextVersion).concat(JSON_EXTENSION)); - - LOGGER.info("sourceUrl## "+sourceUrl); - - JsonNode specNode = mapper.readTree(this.getClass().getClassLoader().getResourceAsStream(sourceUrl)); - - LOGGER.info("specNode:## "+specNode);*/ - - //String sourceUrl = (OBJECTIVE.concat(SEPARATOR).concat(dataContext).concat(SEPARATOR).concat(dataContextVersion).concat(JSON_EXTENSION)); - //JsonNode specNode = mapper.readTree(configLoader.get(sourceUrl)); - - String previousField = findParentKey(specNode.findPath(JOLT_SPEC), "$i", ""); - int parentNodeSize = incomingNode.findValues(previousField).get(0).size(); - - for(int i=0; (i> fields = node.fields(); - while (fields.hasNext()) { - Map.Entry entry = fields.next(); - - if (entry.getKey().equalsIgnoreCase(value)) { - previousKey = key; - break; - } else if (entry.getValue().isObject()) { - key = entry.getKey(); - findParentKey(entry.getValue(), value, key); - } - } - return previousKey; - - } - - - /*public void transformData() { - - Map incomingData = new HashMap(); -*//* Map incomingDataCopy = new HashMap(); - incomingDataCopy.putAll(incomingData);*//* - incomingData.clear(); - //String dataContext = incomingData.get(Constants.DATA_CONTEXT).toString(); - //String dataContextVersion = incomingData.get(Constants.DATA_CONTEXT_VERSION).toString(); - ObjectMapper mapper = new ObjectMapper(); - List chainrSpecJSON = null ; - List incomingDataList = new ArrayList<>(); - - try { - - JsonNode specNode = mapper.readTree(configLoader.get("anytransform_collection_v2.json")); - - JsonNode incoming = mapper.readTree(configLoader.get("anyinput.json"));//TODO: use incomming node object - Map incommingMap = new HashMap(); - incommingMap = mapper.convertValue(incoming, new TypeReference>(){}); - - String previousField = findKey(specNode.findPath(JOLT_SPEC), "$i", ""); - int parentNodeSize = incoming.findValues(previousField).get(0).size(); - - for(int i=0; (i productList = null; // getBiProducts(incomingData, digressionPoint); - /*if(productList != null && productList.size() > 0) { - for(JsonNode product : productList) { - Map subData = new HashMap<>(); - subData.put(Constants.DATA_CONTEXT, incomingData.getDataContext()); - subData.put(Constants.DATA_CONTEXT_VERSION, incomingData.getDataContextVersion()); - subData.put(Constants.DATA_OBJECT, product); - } - }*/ - return null; - } - - private Object ingestServiceReplace(Map incomingData) { - - return null; - } - - /*private List getBiProducts(IncomingData incomingData, DigressionPoint point) { - Object dataObject = incomingData.getDataObject(); - List dataObjectList = new ArrayList<>(); - List paths = point.getPaths(); - ObjectMapper mapper = new ObjectMapper(); - Gson gson = new Gson(); - JsonNode mainNode = null; - try { - mainNode = mapper.readTree(gson.toJson(dataObject)); - } catch (Exception ex) { - LOGGER.error("Encountered an error while converting the data to JSON Node : " + ex.getMessage()); - } - List list = generateBiProducts(point.getPaths(), mainNode); - return list; - } - - private List generateBiProducts(List paths, JsonNode mainNode) { - List jsonNodeList = new ArrayList<>(); - for(Path path : paths) { - jsonNodeList = getSplitObjects(path.getRoute(), mainNode, path.getRemoveReplace()); - for(JsonNode subNode : jsonNodeList) { - if(path.getPaths() != null && path.getPaths().size() > 0) { - generateBiProducts(path.getPaths(), subNode); - } - } - } - if(jsonNodeList.size() == 0) { - jsonNodeList.add(mainNode); - } - return jsonNodeList; - } - - private List getSplitObjects(String route, JsonNode mainNode, String removeReplace) { - List nodeList = new ArrayList<>(); - String[] routes = route.split("\\."); - List routesList = Arrays.asList(routes); - JsonNode node = mainNode; - for(String r : routes) { - node = node.path(r); - } - if(node.isArray()) { - ArrayNode arrayNode = (ArrayNode) node; - if(arrayNode.size() > 1) { - ObjectNode finalSubNode = null; - for(int i=0 ; i < arrayNode.size() ; i++) { - ObjectNode subNode = mainNode.deepCopy(); - JsonNode subJsonNode = mainNode.deepCopy(); - for(String r : routes) { - if(subNode.get(r).deepCopy().isArray()) { - ArrayNode arraySubNode = subNode.get(r).deepCopy(); - subNode = arraySubNode.get(i).deepCopy(); - } else { - JsonNode jsonSubNode = subNode.get(r).deepCopy(); - subNode = jsonSubNode.deepCopy(); - } - } - ObjectNode mainObjectNode = mainNode.deepCopy(); - for(String r : routes) { - if(!r.equals(removeReplace)) { - mainObjectNode = mainObjectNode.get(r).deepCopy(); - } else { - mainObjectNode.remove(removeReplace); - routesList.remove(removeReplace); - } - } - for(int j =0 ; j caughtFailedRequests = new HashMap<>(); - - - @Value("${es.index.type}") - public String DOC_PATH; - - @Value("${services.esindexer.host}") - private String indexServiceHost; - @Value("${egov.services.esindexer.host.search}") - private String indexServiceHostSearch; - - @Value("${es.host.schema}") - private String schema; - - @Value("${services.esindexer.host}") - private String indexerServiceHost; - @Value("${es.target.index.name}") - private String targetIndexName; - - @Value("${es.index.name}") - private String collectionIndexName; - - @Value("${es.index.searchQuery.collection}") - private String searchQueryCollection; - - @Value("${es.index.searchQuery.billing}") - private String searchQueryBilling; - - @Value("${es.index.searchQuery.payment}") - private String searchQueryPayment; - - @Autowired - private RestTemplate restTemplate; - - @Autowired - private RetryTemplate retryTemplate; - - @Autowired - private IngestService ingestService; - - private static final String SLASH_SEPERATOR = "/"; - - public static final Logger LOGGER = LoggerFactory.getLogger(ElasticService.class); - - public String getSearchQueryCollection() { - return searchQueryCollection; - } - - public void setSearchQueryCollection(String searchQueryCollection) { - this.searchQueryCollection = searchQueryCollection; - } - - public String getSearchQueryPayment() { - return searchQueryPayment; - } - - public void setSearchQueryPayment(String searchQueryPayment) { - this.searchQueryPayment = searchQueryPayment; - } - - public String getSearchQueryBilling() { - return searchQueryBilling; - } - - public void setSearchQueryBilling(String searchQueryBilling) { - this.searchQueryBilling = searchQueryBilling; - } - - - public ResponseEntity post(String index, String type, String id, String authToken, String requestNode) { - - StringBuilder uriBuilder = new StringBuilder(indexerServiceHost.concat(index).concat(SLASH_SEPERATOR).concat(type).concat(SLASH_SEPERATOR).concat(id)); - HttpHeaders headers = new HttpHeaders(); - if(authToken != null && !authToken.isEmpty()) - headers.add("Authorization", "Bearer "+ authToken ); - headers.setContentType(MediaType.APPLICATION_JSON); - - HttpEntity requestEntity = null; - if(requestNode != null ) requestEntity = new HttpEntity<>(requestNode, headers); - else requestEntity = new HttpEntity<>("{}", headers); - - ResponseEntity response = new ResponseEntity(HttpStatus.OK); - - try { - response = retryTemplate.postForEntity(uriBuilder.toString(), requestEntity); - //restTemplate.postForEntity(uri,requestEntity); - LOGGER.info("RestTemplate response status :: {}", response.getStatusCode()); - - } catch (HttpClientErrorException e) { - response = new ResponseEntity(e.getStatusCode()); - LOGGER.error("post client exception: " + e.getMessage()); - } - return response; - } - - @Override - public JsonNode search(String index, ObjectNode searchQuery) throws IOException { - SearchRequest searchRequest = buildSearchRequest(index, searchQuery); - SearchResponse searchResponse = getClient(index, indexServiceHost, 9200, schema).search(searchRequest, - RequestOptions.DEFAULT); - - ArrayNode resultArray = JsonNodeFactory.instance.arrayNode(); - for (SearchHit hit : searchResponse.getHits()) { - JsonNode node = new ObjectMapper().readValue(hit.getSourceAsString(), JsonNode.class); - resultArray.add(node); - } - return resultArray; - } - - @Override - public Map search(String index, String searchQuery) throws Exception { - - String url = indexServiceHost + index + indexServiceHostSearch; - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - - LOGGER.info("searching ES for query::" + searchQuery + "::on::" + index + "::ON URL::" + url); - - HttpEntity requestEntity = new HttpEntity<>(searchQuery, headers); - - try { - ResponseEntity response = retryTemplate.postForEntity(url,requestEntity); - - Map responseNode = new ObjectMapper().convertValue(response.getBody(), Map.class); - Map hits = (Map)responseNode.get("hits"); - if((Integer)hits.get("total") >=1) - return (Map)((ArrayList)hits.get("hits")).get(0); - - } catch (HttpClientErrorException e) { - e.printStackTrace(); - LOGGER.error("client error while searching ES : " + e.getMessage()); - - } - return null; - } - - @Override - public Boolean push(Map requestBody) throws Exception { - - Object id = requestBody.get(Constants.IDENTIFIER); - Object trxid = ((Map)requestBody.get(Constants.DATA_OBJECT)).get(Constants.TRANSACTION_ID); - LOGGER.info("request body on ### trxid " +trxid); - //Object dataObjectId = ((Map)requestBody.get(Constants.DATA_OBJECT)).get("id"); - - - - String docId = id!=null ? id.toString(): trxid.toString(); - StringBuilder url = new StringBuilder().append(indexerServiceHost).append(collectionIndexName).append(SLASH_SEPERATOR).append(DOC_PATH).append(SLASH_SEPERATOR).append(docId); - LOGGER.info("url ## " +url); - - - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - - LOGGER.info("Posting request to ES on ::" + collectionIndexName + " with doc id:: "+docId); - - JsonNode request = new ObjectMapper().convertValue(requestBody, JsonNode.class); - //LOGGER.info(" new request body json ### " +request); - - HttpEntity requestEntity = new HttpEntity<>(request.toString(), headers); - ArrayNode hitNodes = null; - - try { - ResponseEntity response = retryTemplate.postForEntity(url.toString(), requestEntity); - LOGGER.info("Status code on pushing to collection index : {}", response.getStatusCode()); - if (response.getStatusCode().value() == HttpStatus.CREATED.value()) - return Boolean.TRUE; - - } catch (HttpClientErrorException e) { - //e.printStackTrace(); - - //caughtFailedRequests.put(dataObjectId.toString(), request); - LOGGER.error("client error while pushing ES collection index : {}, {}" ,e.getMessage(), requestEntity.getBody()); - - } - return Boolean.FALSE; - } - - @Override - public Boolean push(TargetData requestBody) throws Exception { - - Long currentDateTime = new Date().getTime(); - String url = indexerServiceHost + targetIndexName + DOC_TYPE + requestBody.getId(); - - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - - LOGGER.info("Posting request to ES on ## " + targetIndexName); - LOGGER.info("request body on ### " +requestBody); - - JsonNode request = new ObjectMapper().convertValue(requestBody, JsonNode.class); - - HttpEntity requestEntity = new HttpEntity<>(request.toString(), headers); - ArrayNode hitNodes = null; - - try { - ResponseEntity response = retryTemplate.postForEntity(url, requestEntity); - - //ResponseEntity response = restTemplate.exchange(url, HttpMethod.PUT, requestEntity, Object.class); - LOGGER.info("Status code on pushing to target index : " + response.getStatusCode()); - if (response.getStatusCode().value() == 201) - return Boolean.TRUE; - - } catch (HttpClientErrorException e) { - e.printStackTrace(); - LOGGER.error("client error while pushing ES target index : " + e.getMessage()); - - } - return Boolean.FALSE; - } - - @Override - public Boolean searchIndex(String index, String searchQuery, String dataContextVersion) throws Exception { - LOGGER.info("searching ES for query: " + searchQuery + " on " + index); - - Map scrollSearchParams = getScrollIdForScrollSearch(index, dataContextVersion); - LOGGER.info("scrollSearchParams.get(Constants.DataContexts.CONTEXT):: "+scrollSearchParams.get(Constants.DataContexts.CONTEXT)); - - if(scrollSearchParams == null) { - return Boolean.FALSE; - } - new Thread(new Runnable() { - public void run(){ - Map> documentMap = new HashMap<>(); - int docFetchSize = 1; - int totalDocFetchedSize = 0; - int totalDocInIndex = 900000; - - while(docFetchSize > 0 && totalDocFetchedSize < totalDocInIndex) { - documentMap = performScrollSearch(scrollSearchParams); - List listOfDocs = documentMap.get("hits"); - docFetchSize = listOfDocs.size(); - totalDocFetchedSize = docFetchSize + totalDocFetchedSize; - for (Map.Entry> entry : documentMap.entrySet()) { - - for (int i = 0; i < entry.getValue().size(); i++) { - Map innerMap = (Map) entry.getValue().get(i); - Gson gson = new Gson(); - String json = gson.toJson(innerMap.get("_source")); - ObjectMapper mapper = new ObjectMapper(); - JsonNode dataNode = null; - try { - dataNode = mapper.readTree(json); - } catch (IOException e) { - LOGGER.error("Encountered an exception while reading the JSON Node on Thread : " + e.getMessage()); - } - JsonNode dataObjectNode = null; - if(dataNode != null && dataNode.get("Data") == null) { - dataObjectNode = dataNode; - } else { - dataObjectNode= dataNode.get("Data"); - } - Map dataMap = new Gson().fromJson(dataObjectNode.toString(), new TypeToken>() {}.getType() - ); - ingestService.ingestToPipeline( - setIncomingData(scrollSearchParams.get(Constants.DataContexts.CONTEXT), dataContextVersion, dataObjectNode)); - } - } - } - } - }).start(); - - - return Boolean.TRUE; - } - - @Override - public List searchMultiple(String index, String searchQuery) throws Exception { - - String url = indexServiceHost + index + indexServiceHostSearch; - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - - LOGGER.info("searching searchMultiple ES for query::" + searchQuery + "::on::" + index + "::ON URL::" + url); - - HttpEntity requestEntity = new HttpEntity<>(searchQuery, headers); - - try { - ResponseEntity response = retryTemplate.postForEntity(url,requestEntity); - - Map responseNode = new ObjectMapper().convertValue(response.getBody(), Map.class); - Map hits = (Map)responseNode.get("hits"); - if((Integer)hits.get("total") >=1) - return (List) ((ArrayList)hits.get("hits")); - - } catch (HttpClientErrorException e) { - e.printStackTrace(); - LOGGER.error("client error while searchMultiple searching ES : " + e.getMessage()); - - } - return null; - } - - private IncomingData setIncomingData(String index, String version, Object documentValue) { - IncomingData incomingData = new IncomingData(); - incomingData.setDataContext(index); - incomingData.setDataContextVersion(version); - incomingData.setDataObject(documentValue); - return incomingData; - } - - private Map performScrollSearch(Map scrollSearchParams) { - Map> hitsToMap = new LinkedHashMap(); - try { - Map hits = new LinkedHashMap(); - HttpEntity requestEntity = new HttpEntity<>(scrollSearchParams.get(Constants.ScrollSearch.QUERY), getHttpHeaders()); - ResponseEntity response = restTemplate.exchange(scrollSearchParams.get(Constants.ScrollSearch.SEARCH_PATH), HttpMethod.POST, requestEntity, - Object.class); - Map responseNode = new ObjectMapper().convertValue(response.getBody(), Map.class); - hits = (Map) responseNode.get("hits"); - if ((Integer) hits.get("total") >= 1) { - hitsToMap.put("hits", ((ArrayList) hits.get("hits"))); - return hitsToMap; - } - } catch (HttpClientErrorException e) { - LOGGER.error("client error while searching ES : " + e.getMessage()); - } - return hitsToMap; - } - - private Map getScrollIdForScrollSearch(String index, String dataContextVersion) { - Map scrollSearchParams = new HashMap<>(); - String queryString = null; - if (index.equals(Constants.ES_INDEX_COLLECTION)) { - queryString = getSearchQueryCollection(); - scrollSearchParams.put(Constants.DataContexts.CONTEXT, Constants.DataContexts.COLLECTION); - } else if (index.equals(Constants.ES_INDEX_BILLING)) { - queryString = getSearchQueryBilling(); - scrollSearchParams.put(Constants.DataContexts.CONTEXT, Constants.DataContexts.BILLING); - } else if (index.equals(Constants.ES_INDEX_PAYMENT)) { - queryString = getSearchQueryPayment(); - scrollSearchParams.put(Constants.DataContexts.CONTEXT, Constants.DataContexts.COLLECTION); - } else { - return null; - } - String scrollUrl = indexServiceHost + index + indexServiceHostSearch + "?scroll=1m"; - HttpEntity requestEntity = new HttpEntity<>(queryString, getHttpHeaders()); - String str = null; - try { - LOGGER.info("Request Body for Scroll Search : "+requestEntity); - ResponseEntity response = restTemplate.exchange(scrollUrl, HttpMethod.POST, requestEntity, - Object.class); - Map responseNode = new ObjectMapper().convertValue(response.getBody(), Map.class); - - Map> hitsToMap = new LinkedHashMap(); - Map hits = new LinkedHashMap(); - hits = (Map) responseNode.get("hits"); - if ((Integer) hits.get("total") >= 1) { - hitsToMap.put("hits", ((ArrayList) hits.get("hits"))); - } - - for (Entry> entry : hitsToMap.entrySet()) { - - for (int i = 0; i < entry.getValue().size(); i++) { - Map innerMap = (Map) entry.getValue().get(i); - Gson gson = new Gson(); - String json = gson.toJson(innerMap.get("_source")); - ObjectMapper mapper = new ObjectMapper(); - JsonNode dataNode = null; - try { - dataNode = mapper.readTree(json); - } catch (IOException e) { - LOGGER.error("Encountered an exception while reading the JSON Node on Thread : " + e.getMessage()); - } - JsonNode dataObjectNode = null; - if(dataNode != null && dataNode.get("Data") == null) { - dataObjectNode = dataNode; - } else { - dataObjectNode= dataNode.get("Data"); - } - Map dataMap = new Gson().fromJson(dataObjectNode.toString(), new TypeToken>() {}.getType() - ); - ingestService.ingestToPipeline( - setIncomingData(scrollSearchParams.get(Constants.DataContexts.CONTEXT), dataContextVersion, dataObjectNode)); - } - } - str = indexServiceHostSearch.replaceAll("[/]", ""); - scrollSearchParams.put(Constants.ScrollSearch.SCROLL_ID, (String) responseNode.get(Constants.ScrollSearch.SCROLL_ID_PARAMS)); - scrollSearchParams.put(Constants.ScrollSearch.SEARCH_PATH, indexServiceHost + str + "/" + "scroll"); - String queryForScrollId = Constants.ScrollSearch.SCROLL_SEARCH_DEFAULT_QUERY + "\"" + scrollSearchParams.get(Constants.ScrollSearch.SCROLL_ID) + "\"" + "}"; - scrollSearchParams.put(Constants.ScrollSearch.QUERY, queryForScrollId); - } catch (HttpClientErrorException e) { - LOGGER.error("client error while searching ES : " + e.getMessage()); - } - return scrollSearchParams; - } - - - - private HttpHeaders getHttpHeaders() { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - return headers; - } - - -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichTransform.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichTransform.java deleted file mode 100644 index cbcc4641ccd..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichTransform.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.ingestpipeline.service; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.bazaarvoice.jolt.Chainr; -import com.bazaarvoice.jolt.JsonUtils; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.ingestpipeline.util.ConfigLoader; - -@Service -public class EnrichTransform { - - public static final Logger LOGGER = LoggerFactory.getLogger(EnrichTransform.class); - - @Autowired - private TransformService transformService; - - @Autowired - private ConfigLoader configLoader; - - private static final String SEPARATOR = "_"; - private static final String JSON_EXTENSION = ".json"; - private static final String OBJECTIVE = "transform"; - private static final String CONFIGROOT = "config/"; - private static final String VERSION = "v1"; - private static final String ENHANCE = "enhance"; - - - - /** - * Tranforms domain raw response from elastic search - * This transformation is specific to domain objects - * - * @param rawResponseNode - * @param businessService - * @return - */ - public Object transform (Map rawResponseNode, String businessService) throws IOException { - - ObjectMapper mapper = new ObjectMapper(); - List chainrSpecJSON = null ; - Object transNode = null; - try { - chainrSpecJSON = mapper.readValue(configLoader.get(OBJECTIVE.concat(SEPARATOR).concat(businessService.toLowerCase()).concat(SEPARATOR).concat(VERSION).concat(JSON_EXTENSION)), List.class); - LOGGER.info("ChainrSpecJSON::" + chainrSpecJSON); - Chainr chainr = Chainr.fromSpec( chainrSpecJSON ); - - Object indexData = rawResponseNode.keySet().contains("_source") ? ((Map)rawResponseNode.get("_source")).get("Data") : null; - transNode = indexData!= null ? chainr.transform(indexData) : null; - - } catch (Exception e) { - LOGGER.error("Encountered an error : businessService {} ", e.getMessage()); - } - - return transNode; - - } - - - /** - * Tranforms domain raw response from elastic search - * This transformation is specific to domain objects - * - * @param rawResponseNode - * @param businessService - * @return - */ - public Object transformEnhanceData (List rawResponseList, String businessService) throws IOException { - - ObjectMapper mapper = new ObjectMapper(); - List chainrSpecJSON = null ; - Object transNode = null; - List response = new ArrayList(); - - try { - chainrSpecJSON = mapper.readValue(configLoader.get(OBJECTIVE.concat(SEPARATOR).concat(businessService.toLowerCase()).concat(SEPARATOR).concat(ENHANCE).concat(SEPARATOR).concat(VERSION).concat(JSON_EXTENSION)), List.class); - LOGGER.info("ChainrSpecJSON::" + chainrSpecJSON); - Chainr chainr = Chainr.fromSpec( chainrSpecJSON ); - - for (Object object : rawResponseList) { - if(object instanceof Map) { - Map rawResponseNode = (Map) object; - Object indexData = rawResponseNode.keySet().contains("_source") ? ((Map)rawResponseNode.get("_source")).get("Data") : null; - transNode = indexData!= null ? chainr.transform(indexData) : null; - response.add(transNode); - } - - } - - } catch (Exception e) { - LOGGER.error("Encountered in transformEnhanceData with an error : businessService {} ", e.getMessage()); - } - - return response; - - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichmentService.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichmentService.java deleted file mode 100644 index 6f14ff224a7..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichmentService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ingestpipeline.service; - -import org.springframework.stereotype.Service; - -import com.ingestpipeline.model.IncomingData; - -import java.util.Map; - -@Service -public interface EnrichmentService { - - Map enrichData(Map incomingData); - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichmentServiceImpl.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichmentServiceImpl.java deleted file mode 100644 index 9f42ce8a1b4..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/EnrichmentServiceImpl.java +++ /dev/null @@ -1,323 +0,0 @@ -package com.ingestpipeline.service; - -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.ingestpipeline.model.SourceReferences; -import com.ingestpipeline.model.TargetReferences; -import org.apache.tomcat.util.codec.binary.Base64; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.common.hash.Hashing; -import com.ingestpipeline.config.DomainConfig; -import com.ingestpipeline.config.DomainConfigFactory; -import com.ingestpipeline.configfactory.CollectionDomainConfig; -import com.ingestpipeline.configfactory.EnhanceDomainConfig; -import com.ingestpipeline.model.DomainIndexConfig; -import com.ingestpipeline.model.TargetData; -import com.ingestpipeline.repository.ElasticSearchRepository; -import com.ingestpipeline.repository.TargetDataDao; -import com.ingestpipeline.util.Constants; -import com.ingestpipeline.util.JSONUtil; - -/** - * This is a Service Implementation for all the actions which are with respect - * to Elastic Search - * - * @author Darshan Nagesh - * - */ -@Service(Constants.Qualifiers.ENRICHMENT_SERVICE) -public class EnrichmentServiceImpl implements EnrichmentService { - - public static final Logger LOGGER = LoggerFactory.getLogger(EnrichmentServiceImpl.class); - private static final String SEPARATOR = "_"; - private static final String JSON_EXTENSION = ".json"; - private static final String OBJECTIVE = "enrichment"; - private final String indexServiceHost; - private final String userName; - private final String password; - private final String elasticSearchIndexName; - private final String elasticSearchDocumentType; - - private static final String AUTHORIZATION = "Authorization"; - private static final String US_ASCII = "US-ASCII"; - private static final String BASIC_AUTH = "Basic %s"; - - private static final String BUSINESS_SERVICE = "businessService"; - private static final String DATA_OBJECT = "dataObject"; - private static final String DATA_CONTEXT = "dataContext"; - private static final String DATA_ENHANCEMENT = "dataEnhancement"; - private static final String TENANTID = "tenantId"; - private static final String MCOLLECT = "MCOLLECT"; - - @Autowired - private ElasticSearchRepository elasticRepository; - - @Autowired - private CollectionDomainConfig collectionDomainConfig; - - @Autowired - private DomainConfigFactory domainConfigFactory; - - @Autowired - private IESService elasticService; - - @Autowired - private TargetDataDao targetDataDao; - - @Autowired - private EnrichTransform enrichTransform; - - @Autowired - private JSONUtil util; - - public EnrichmentServiceImpl(@Value("${services.esindexer.host}") String indexServiceHost, - @Value("${services.esindexer.username}") String userName, - @Value("${services.esindexer.password}") String password, - @Value("${es.index.name}") String elasticSearchIndexName, - @Value("${es.document.type}") String elasticSearchDocumentType, JSONUtil util) { - this.indexServiceHost = indexServiceHost; - this.userName = userName; - this.password = password; - this.elasticSearchIndexName = elasticSearchIndexName; - this.elasticSearchDocumentType = elasticSearchDocumentType; - this.util=util; - } - - @Override - public Map enrichData(Map incomingData) { - - Map dataObject = new ObjectMapper().convertValue(incomingData.get(DATA_OBJECT), Map.class); - String tenantId = dataObject.get(TENANTID).toString(); - - List mCollectCategories = util.fetchMCollectCategories(tenantId); - - DomainConfig domainConfig = domainConfigFactory.getConfiguration(incomingData.get(DATA_CONTEXT).toString()); - LOGGER.info("domainConfig ## "+domainConfig); - - if(domainConfig instanceof CollectionDomainConfig) { - // prepare the query required based on incoming data businessType - ObjectNode incomingNode = new ObjectMapper().convertValue(incomingData.get(DATA_OBJECT), ObjectNode.class); - ObjectNode copyNode = incomingNode.deepCopy(); - String businessTypeVal = copyNode.findValue(BUSINESS_SERVICE).asText(); - - for(String category : mCollectCategories) { - if(category.equalsIgnoreCase(businessTypeVal)) { - businessTypeVal = MCOLLECT; - break; - } - } - - DomainIndexConfig indexConfig = domainConfig.getIndexConfig(businessTypeVal.toString()); - LOGGER.info("indexConfig ## "+indexConfig); - if(indexConfig != null){ - String indexName = indexConfig.getIndexName(); - - String query = indexConfig.getQuery(); - - try { - ObjectNode queryNode = new ObjectMapper().readValue(query, ObjectNode.class); - - Map expValMap = new HashMap<>(); - // Source references to be prepare a map of fieldName & value - for (SourceReferences ref : indexConfig.getSourceReferences()){ - String arg = ref.getFieldName(); - String argVal = copyNode.findValue(arg).asText(); - String[] values = argVal.split(ref.getSeperator()); - - String[] exps = ref.getExpression().split(ref.getSeperator()); - - for(int i=0; i { - TargetData targetData = new ObjectMapper().convertValue(val, TargetData.class); - String hashId = targetData.getFinancialYear() + "-" + targetData.getBusinessService()+"-"+targetData.getUlbName(); - hashId = hashId.replaceAll("(\\s)+", ""); - String sha256hex = Hashing.sha256().hashString(hashId, StandardCharsets.UTF_8).toString(); - targetData.setId(sha256hex.hashCode()); - //targetData.setId(hashId); - try{ - elasticService.push(targetData); - }catch (Exception e ){ - LOGGER.error("Exception occurred while pushing data to ES: " + e.getMessage()); - } - - }); - } - - return incomingData; - } - - private Boolean pushToElasticSearchIndex(Object object) { - Long currentDateTime = new Date().getTime(); - String url = String.format("%s%s/%s/%s", this.indexServiceHost, elasticSearchIndexName, - elasticSearchDocumentType, currentDateTime); - HttpHeaders headers = getHttpHeaders(); - LOGGER.info("Data Object to be added to ES : " + object); - LOGGER.info("URL to invoke : " + url); - elasticRepository.saveMyDataObject(object, url, headers); - return Boolean.TRUE; - } - - /** - * A helper method to create the headers for Rest Connection with UserName and - * Password - * - * @return HttpHeaders - */ - private HttpHeaders getHttpHeaders() { - HttpHeaders headers = new HttpHeaders(); - headers.add(AUTHORIZATION, getBase64Value(userName, password)); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.setContentType(MediaType.APPLICATION_JSON); - return headers; - } - - /** - * Helper Method to create the Base64Value for headers - * - * @param userName - * @param password - * @return - */ - private String getBase64Value(String userName, String password) { - String authString = String.format("%s:%s", userName, password); - byte[] encodedAuthString = Base64.encodeBase64(authString.getBytes(Charset.forName(US_ASCII))); - return String.format(BASIC_AUTH, new String(encodedAuthString)); - } - - /** - * This method used to add the external index data into the es index - * - * @param incomingData - * @return - */ - private Map enhanceData(Map incomingData) { - DomainConfig domainConfig = domainConfigFactory.getConfiguration(DATA_ENHANCEMENT); - LOGGER.info("enhanceDomainConfig ## "+domainConfig); - - if(domainConfig instanceof EnhanceDomainConfig ) { - // prepare the query required based on incoming data businessType - ObjectNode incomingNode = new ObjectMapper().convertValue(incomingData.get(DATA_OBJECT), ObjectNode.class); - ObjectNode copyNode = incomingNode.deepCopy(); - String businessTypeVal = copyNode.findValue(BUSINESS_SERVICE).asText(); - - DomainIndexConfig indexConfig = domainConfig.getIndexConfig(businessTypeVal.toString()); - LOGGER.info("indexConfig ## "+indexConfig); - if(indexConfig != null){ - String indexName = indexConfig.getIndexName(); - String query = indexConfig.getQuery(); - - - try { - ObjectNode queryNode = new ObjectMapper().readValue(query, ObjectNode.class); - LOGGER.info("queryNode 114 ## "+queryNode.toString()); - - Map expValMap = new HashMap<>(); - // Source references to be prepare a map of fieldName & value - for (SourceReferences ref : indexConfig.getSourceReferences()){ - String arg = ref.getFieldName(); - LOGGER.info("arg350## " + arg); - String argVal = copyNode.findValue(arg).asText(); - String[] values = argVal.split(ref.getSeperator()); - String[] exps = ref.getExpression().split(ref.getSeperator()); - - for(int i=0; i post(String index, String type, String id, String authToken, String requestNode); - - /** - * Holds client for each indices. - */ - static Map esClient = new HashMap(); - static final String INVALID_QUERY_ERROR ="invalid query: must be boolean, match_phrase "; - - /** searches documents from ES based on query using RestHighLevelClient - * @param index - ElasticSearch Index - * @param searchQuery - which contains details for search - * @return - */ - JsonNode search(String index, ObjectNode searchQuery) throws IOException; - - Boolean push(TargetData requestBody) throws Exception; - - /** - * searches documents from ES based on query using restTemplate - * @param index - * @param query - * @return - * @throws Exception - */ - Map search(String index, String query) throws Exception; - - List searchMultiple(String index, String query) throws Exception; - Boolean push(Map requestBody) throws Exception; - - - /** - * Translates a string query to SearchRequest - * valid query string has bool type query - * @param queryNode - * @return - */ - default SearchRequest buildSearchRequest(String index, ObjectNode queryNode) throws IOException{ - final BoolQueryBuilder query = QueryBuilders.boolQuery(); - - ArrayNode mustNodeArr = (ArrayNode) queryNode.get("query").get("bool").get("must"); - if(null == mustNodeArr) - throw new IllegalArgumentException(INVALID_QUERY_ERROR); - - mustNodeArr.elements().forEachRemaining(mustNode -> { - mustNode.fields().forEachRemaining(entry -> { - if(entry.getKey().equalsIgnoreCase("match_phrase") && entry.getValue().isObject()){ - JsonNode node = entry.getValue(); - Map.Entry dataNode = node.fields().next(); - query.must(QueryBuilders.matchPhraseQuery(dataNode.getKey(), dataNode.getValue().textValue())); - } - }); - - }); - return new SearchRequest(index).source(new SearchSourceBuilder().query(query)); - } - - /** - * - * @param indexName - * @param hostName - * @param port - * @param schema - * @return - */ - default RestHighLevelClient getClient(String indexName, String hostName, Integer port, String schema){ - RestHighLevelClient client = esClient.get(indexName); - if(null == client){ - client = new RestHighLevelClient(RestClient.builder(new HttpHost(hostName, port, schema))); - esClient.put(indexName, client); - } - return client; - } - - /*default boolean isIndexExists(String indexName) { - Response response; - try { - response = getClient(indexName).getLowLevelClient().performRequest(new Request("HEAD", "/" + indexName)); - return (200 == response.getStatusLine().getStatusCode()); - } catch (IOException e) { - return false; - } - - }*/ - - default boolean createIndex(String indexName){ - //TODO - return Boolean.TRUE; - } - - Boolean searchIndex(String index, String query, String dataContextVersion) throws Exception; -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/IngestService.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/IngestService.java deleted file mode 100644 index 1dc0a4355f8..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/IngestService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ingestpipeline.service; - -import org.springframework.stereotype.Service; - -import com.ingestpipeline.model.IncomingData; - -@Service -public interface IngestService { - - static final String TOPIC_CONTEXT_CONFIG = "TopicContextConfiguration.json"; - Boolean ingestToPipeline(Object incomingData); - IncomingData getContextForIncomingTopic(String topicName) ; - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/IngestServiceImpl.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/IngestServiceImpl.java deleted file mode 100644 index 43c5627253d..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/IngestServiceImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.ingestpipeline.service; - -import com.ingestpipeline.model.TopicContextConfig; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.ingestpipeline.model.ErrorWrapper; -import com.ingestpipeline.model.IncomingData; -import com.ingestpipeline.model.TopicContext; -import com.ingestpipeline.producer.IngestProducer; -import com.ingestpipeline.util.ApplicationProperties; -import com.ingestpipeline.util.ConfigLoader; -import com.ingestpipeline.util.Constants; - -import java.util.HashMap; -import java.util.Map; - -/** - * This is a Service Implementation for all the actions which are with respect to Elastic Search - * @author Darshan Nagesh - * - */ -@Service(Constants.Qualifiers.INGEST_SERVICE) -public class IngestServiceImpl implements IngestService { - - public static final Logger LOGGER = LoggerFactory.getLogger(IngestServiceImpl.class); - public static final String INTENT = "INGEST"; - - @Autowired - private IngestProducer ingestProducer; - - @Autowired - private ApplicationProperties applicationProperties; - - @Autowired - private ConfigLoader configLoader; - - @Autowired - private DigressService digressService; - - @Autowired - private ObjectMapper mapper; - - private Map topicContextMap = new HashMap<>(); - public void loadTopicsConfig(){ - TopicContextConfig topicContextConf = null; - try { - topicContextConf = mapper.readValue(configLoader.get(TOPIC_CONTEXT_CONFIG), TopicContextConfig.class); - for (TopicContext topicCxt : topicContextConf.getTopicContexts()){ - - topicContextMap.put(topicCxt.getTopic(), topicCxt); - } - LOGGER.info("topicContexts ## "+topicContextMap); - - } catch (Exception e) { - LOGGER.error("Encountered an error while reading Topic to Context Configuration" + e.getMessage()); - } - } - - @Override - public Boolean ingestToPipeline(Object incomingData) { - LOGGER.info("Fetching the Incoming Data Config for the data received"); - String topic = ""; - String key = ""; - try { - if (applicationProperties.getPipelineRules().get(Constants.PipelineRules.VALIDATE_DATA)) { - topic = applicationProperties.getTransactionIngestTopic(); - key = applicationProperties.getTransactionIngestKey(); - } else if (applicationProperties.getPipelineRules().get(Constants.PipelineRules.TRANSFORM_DATA)) { - topic = applicationProperties.getTransactionValidationTopic(); - key = applicationProperties.getTransactionValidationKey(); - } else if (applicationProperties.getPipelineRules().get(Constants.PipelineRules.ENRICH_DATA)) { - topic = applicationProperties.getTransactionTransformationTopic(); - key = applicationProperties.getTransactionTransformationKey(); - } - } catch (Exception e) { - LOGGER.error("Encountered an Exception while Pushing the Data to pipeline on Ingest Service " + e.getMessage()); - ErrorWrapper errorWrapper = errorHandover(incomingData); - ingestProducer.pushToPipeline(errorWrapper, Constants.KafkaTopics.ERROR_INTENT, null); - } - ingestProducer.pushToPipeline(incomingData, topic, null); - return true; - } - - private ErrorWrapper errorHandover(Object incomingData) { - ErrorWrapper errorWrapper = new ErrorWrapper(); - errorWrapper.setErrorCode(INTENT); - errorWrapper.setErrorMessage(Constants.ErrorMessages.errorCodeMessageMap.get(INTENT)); - errorWrapper.setIncomingData(incomingData); - return errorWrapper; - } - - @Override - public IncomingData getContextForIncomingTopic(String topicName) { - ObjectMapper mapper = new ObjectMapper(); - TopicContext topicContext = null; - IncomingData incomingData = null; -/* try { - topicContext = mapper.readValue(configLoader.get(TOPIC_CONTEXT_CONFIG), TopicContext.class); - } catch (Exception e) { - LOGGER.error("Encountered an error while reading Topic to Context Configuration" + e.getMessage()); - }*/ - if(topicContextMap.size()>0 ) { - incomingData = new IncomingData(); - TopicContext topicCxt = topicContextMap.get(topicName); - incomingData.setDataContext(topicCxt.getDataContext()); - incomingData.setDataContextVersion(topicCxt.getDataContextVersion()); - LOGGER.info("###Context Set##"); - } - return incomingData; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/RetryTemplate.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/RetryTemplate.java deleted file mode 100644 index e42d532e289..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/RetryTemplate.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ingestpipeline.service; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import org.springframework.retry.annotation.Backoff; -import org.springframework.retry.annotation.Retryable; -import org.springframework.stereotype.Component; -import org.springframework.web.client.ResourceAccessException; -import org.springframework.web.client.RestTemplate; - -import javax.naming.ServiceUnavailableException; - -/** - * Wraps rest template with retry - */ -@Component -public class RetryTemplate { - - @Autowired - private RestTemplate restTemplate; - - @Retryable(value = {RuntimeException.class, ResourceAccessException.class, ServiceUnavailableException.class}, - maxAttemptsExpression = "#{${service.retry.maxAttempts}}", - backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) - public ResponseEntity postForEntity(String url, Object request) { - return restTemplate.postForEntity(url, request, Object.class); - } - - @Retryable(value = {RuntimeException.class, ResourceAccessException.class, ServiceUnavailableException.class}, - maxAttemptsExpression = "#{${service.retry.maxAttempts}}", - backoff = @Backoff(delayExpression = "#{${service.retry.backoff.delay}}")) - public ResponseEntity getForEntity(String url, HttpEntity headerEntity) { - return restTemplate.exchange(url, HttpMethod.GET, headerEntity, Object.class); - } - -} - diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/TransformService.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/TransformService.java deleted file mode 100644 index 84781d8066f..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/TransformService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ingestpipeline.service; - -import org.springframework.stereotype.Service; - -import com.ingestpipeline.model.IncomingData; - -import java.util.Map; - -@Service -public interface TransformService { - - Boolean transformData(Map incomingData); - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/TransformServiceImpl.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/TransformServiceImpl.java deleted file mode 100644 index ba9dc34fb29..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/TransformServiceImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.ingestpipeline.service; - -import java.io.InputStream; -import java.util.List; -import java.util.Map; - -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.bazaarvoice.jolt.Chainr; -import com.bazaarvoice.jolt.JsonUtils; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.gson.Gson; -import com.ingestpipeline.model.DigressionPoint; -import com.ingestpipeline.util.ConfigLoader; -import com.ingestpipeline.util.Constants; - -/** - * This is a Service Implementation for all the actions which are with respect to Elastic Search - * @author Darshan Nagesh - * - */ -@Service(Constants.Qualifiers.TRANSFORM_SERVICE) -public class TransformServiceImpl implements TransformService { - - public static final Logger LOGGER = LoggerFactory.getLogger(TransformServiceImpl.class); - private static final String SEPARATOR = "_"; - private static final String JSON_EXTENSION = ".json"; - private static final String OBJECTIVE = "transform"; - private static final String CONFIGROOT = "config/"; - - @Autowired - private ConfigLoader configLoader; - - @Override - public Boolean transformData(Map incomingData) { - String dataContext = incomingData.get(Constants.DATA_CONTEXT).toString(); - String dataContextVersion = incomingData.get(Constants.DATA_CONTEXT_VERSION).toString(); - ObjectMapper mapper = new ObjectMapper(); - List chainrSpecJSON = null ; - InputStream inputStream = null; - try { - String sourceUrl = CONFIGROOT.concat(OBJECTIVE.concat(SEPARATOR).concat(dataContext).concat(SEPARATOR).concat(dataContextVersion).concat(JSON_EXTENSION)); - inputStream = this.getClass().getClassLoader().getResourceAsStream(sourceUrl); - chainrSpecJSON = JsonUtils.jsonToList(inputStream); - - } catch (Exception e) { - LOGGER.error("Encountered an error : " + e.getMessage()); - } - finally { - IOUtils.closeQuietly(inputStream); - } - - - /*Map deepRouteSpecSize = new HashMap<>(); - - Object dataObject = incomingData.get(Constants.DATA_OBJECT); - String digressConfig = configLoader.get(Constants.ConfigurationFileNames.DIGRESSION_POINTS); - Gson gson = new Gson(); - JsonNode mainNode = null; - try { - mainNode = mapper.readTree(gson.toJson(dataObject)); - } catch (Exception ex) { - LOGGER.error("Encountered an error while converting the data to JSON Node : " + ex.getMessage()); - } - ObjectNode objectNode = mainNode.deepCopy(); - DigressionPointConfig config = gson.fromJson(digressConfig, DigressionPointConfig.class); - if (config != null && config.getDigressionPoints() != null && config.getDigressionPoints().size() > 0) { - for (DigressionPoint point : config.getDigressionPoints()) { - if (incomingData.get(Constants.DATA_CONTEXT).equals(point.getDataContext())) { - List paths = point.getPaths(); - for(String path : paths) { - if(objectNode.findValue(path).isArray()) { - ArrayNode objectAtPathArray = (ArrayNode) objectNode.findValue(path); - int size = objectAtPathArray.size(); - deepRouteSpecSize.put(path, size); - } - } - - } - } - } - - - for(int i=0; i< chainrSpecJSON.size() ; i++) { - LinkedHashMap chainSpec = (LinkedHashMap) chainrSpecJSON.get(i); - for(Map.Entry entry : deepRouteSpecSize.entrySet()) { - String key = entry.getKey(); - int iterationsForKey = entry.getValue(); - for() - } - chainSpec.toString(); - }*/ - - - Chainr chainr = Chainr.fromSpec( chainrSpecJSON ); - Object inputJSON = incomingData.get(Constants.DATA_OBJECT); - try { - Object transformedOutput = chainr.transform( inputJSON ); - incomingData.put(Constants.DATA_OBJECT , transformedOutput); - return Boolean.TRUE; - } catch (Exception e) { - LOGGER.error("Encountered an error while tranforming the JSON : " + e.getMessage()); - return Boolean.FALSE; - } - } - - public Boolean digressData(Object dataObject, DigressionPoint digressionPoint) { - ObjectMapper mapper = new ObjectMapper(); - Gson gson = new Gson(); - JsonNode mainNode = null; - try { - mainNode = mapper.readTree(gson.toJson(dataObject)); - } catch (Exception ex) { - LOGGER.error("Encountered an error while converting the data to JSON Node : " + ex.getMessage()); - } - return null; - } -} - \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/ValidationService.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/ValidationService.java deleted file mode 100644 index d06e5cde22a..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/ValidationService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.ingestpipeline.service; - -import org.springframework.stereotype.Service; - -import com.ingestpipeline.model.IncomingData; - -import java.util.Map; - -@Service -public interface ValidationService { - - Boolean validateData(Map incomingData); - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/ValidationServiceImpl.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/ValidationServiceImpl.java deleted file mode 100644 index e211230ea75..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/service/ValidationServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.ingestpipeline.service; - -import java.util.HashMap; -import java.util.Map; - -import org.everit.json.schema.Schema; -import org.everit.json.schema.ValidationException; -import org.everit.json.schema.loader.SchemaLoader; -import org.json.JSONObject; -import org.json.JSONTokener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.google.gson.GsonBuilder; -import com.ingestpipeline.util.Constants; - -/** - * This is a Service Implementation for all the actions which are with respect to Elastic Search - * @author Darshan Nagesh - * - */ -@Service(Constants.Qualifiers.VALIDATOR_SERVICE) -public class ValidationServiceImpl implements ValidationService { - - public static final Logger LOGGER = LoggerFactory.getLogger(ValidationServiceImpl.class); - private static final String OBJECTIVE = "validator"; - private static final String SEPARATOR = "_"; - private static final String JSON_EXTENSION = ".json"; - private static final String CONFIGROOT = "config/"; - private static Map schemaCache = new HashMap<>(); - - @Override - public Boolean validateData(Map incomingData) { - - //JSONObject jsonSubject = new JSONObject(new GsonBuilder().create().toJson(incomingData.getDataObject())); - JSONObject jsonSubject = new JSONObject(new GsonBuilder().create().toJson(incomingData.get("dataObject"))); - - try { - //getSchema(OBJECTIVE.concat(SEPARATOR).concat(incomingData.getDataContext()).concat(SEPARATOR).concat(incomingData.getDataContextVersion()) - getSchema(OBJECTIVE.concat(SEPARATOR).concat(incomingData.get("dataContext").toString()).concat(SEPARATOR).concat(incomingData.get("dataContextVersion").toString()) - .concat(JSON_EXTENSION)).validate(jsonSubject); - } catch (ValidationException ve) { - LOGGER.info("Validation Exception : " + ve.getMessage()); - return Boolean.FALSE; - } catch (Exception e) { - LOGGER.info("Validation Exception : " + e); - return Boolean.FALSE; - } - return Boolean.TRUE; - } - - private Schema getSchema(String location) { - Schema schema = schemaCache.get(location); - if (schema == null) { - try { - schema = loadSchema(location); - schemaCache.put(location, schema); - } catch(Exception e) { - LOGGER.error("Encountered an Exception while loading Schema : " + e.getMessage()); - } - } - return schema; - } - - private Schema loadSchema(String location) { - JSONObject jsonSchema = new JSONObject( - new JSONTokener(ClassLoader.getSystemClassLoader().getResourceAsStream(CONFIGROOT + location))); - return SchemaLoader.load(jsonSchema); - } - -} - \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ApplicationProperties.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ApplicationProperties.java deleted file mode 100644 index bb0b96defb8..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ApplicationProperties.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.ingestpipeline.util; - -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.annotation.Order; -import org.springframework.core.env.Environment; - -@Configuration -@PropertySource(value = { "classpath:config/config.properties" }, ignoreResourceNotFound = true) -@Order(0) -public class ApplicationProperties { - - @Value("${kafka.transaction.ingest.topic}") - private String transactionIngestTopic; - - @Value("${kafka.transaction.ingest.key}") - private String transactionIngestKey; - - @Value("${kafka.transaction.validation.topic}") - private String transactionValidationTopic; - - @Value("${kafka.transaction.validation.key}") - private String transactionValidationKey; - - @Value("${kafka.transaction.transformation.topic}") - private String transactionTransformationTopic; - - @Value("${kafka.transaction.transformation.key}") - private String transactionTransformationKey; - - @Value("${kafka.transaction.enrichment.topic}") - private String transactionEnrichmentTopic; - - @Value("${kafka.transaction.enrichment.key}") - private String transactionEnrichmentKey; - - @Value("${schema.transaction.validation}") - private String transactionValidationSchema; - - @Value("${schema.transaction.transformation}") - private String transactionTransformSchema; - - @Value("${schema.transaction.enrichment}") - private String transactionEnrichmentSchema; - - @Value("${transformation.config.location}") - private static String transformationConfigLocations; - - @Value("#{${pipelinerules}}") - private Map pipelineRules; - - @Autowired - private Environment environment; - - public static String getTransformationConfigLocations() { - return transformationConfigLocations; - } - - public static void setTransformationConfigLocations(String transformationConfigLocations) { - ApplicationProperties.transformationConfigLocations = transformationConfigLocations; - } - - public String getTransactionValidationSchema() { - return transactionValidationSchema; - } - - public void setTransactionValidationSchema(String transactionValidationSchema) { - this.transactionValidationSchema = transactionValidationSchema; - } - - public String getTransactionTransformSchema() { - return transactionTransformSchema; - } - - public void setTransactionTransformSchema(String transactionTransformSchema) { - this.transactionTransformSchema = transactionTransformSchema; - } - - public String getTransactionEnrichmentSchema() { - return transactionEnrichmentSchema; - } - - public void setTransactionEnrichmentSchema(String transactionEnrichmentSchema) { - this.transactionEnrichmentSchema = transactionEnrichmentSchema; - } - - public Map getPipelineRules() { - return pipelineRules; - } - - public void setPipelineRules(Map pipelineRules) { - this.pipelineRules = pipelineRules; - } - - public String getTransactionIngestTopic() { - return transactionIngestTopic; - } - - public void setTransactionIngestTopic(String transactionIngestTopic) { - this.transactionIngestTopic = transactionIngestTopic; - } - - public String getTransactionIngestKey() { - return transactionIngestKey; - } - - public void setTransactionIngestKey(String transactionIngestKey) { - this.transactionIngestKey = transactionIngestKey; - } - - public String getTransactionValidationTopic() { - return transactionValidationTopic; - } - - public void setTransactionValidationTopic(String transactionValidationTopic) { - this.transactionValidationTopic = transactionValidationTopic; - } - - public String getTransactionValidationKey() { - return transactionValidationKey; - } - - public void setTransactionValidationKey(String transactionValidationKey) { - this.transactionValidationKey = transactionValidationKey; - } - - public String getTransactionTransformationTopic() { - return transactionTransformationTopic; - } - - public void setTransactionTransformationTopic(String transactionTransformationTopic) { - this.transactionTransformationTopic = transactionTransformationTopic; - } - - public String getTransactionTransformationKey() { - return transactionTransformationKey; - } - - public void setTransactionTransformationKey(String transactionTransformationKey) { - this.transactionTransformationKey = transactionTransformationKey; - } - - public String getTransactionEnrichmentTopic() { - return transactionEnrichmentTopic; - } - - public void setTransactionEnrichmentTopic(String transactionEnrichmentTopic) { - this.transactionEnrichmentTopic = transactionEnrichmentTopic; - } - - public String getTransactionEnrichmentKey() { - return transactionEnrichmentKey; - } - - public void setTransactionEnrichmentKey(String transactionEnrichmentKey) { - this.transactionEnrichmentKey = transactionEnrichmentKey; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ConfigLoader.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ConfigLoader.java deleted file mode 100644 index d308f6af0f8..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ConfigLoader.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.ingestpipeline.util; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; -import java.util.HashMap; -import java.util.Map; - -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.Resource; -import org.springframework.core.io.ResourceLoader; -import org.springframework.core.io.support.ResourcePatternUtils; -import org.springframework.stereotype.Component; - -@Component("configLoader") -public class ConfigLoader { - - private static Logger logger = LoggerFactory.getLogger(ConfigLoader.class); - private Map nameContentMap = new HashMap<>(); - @Autowired - private ResourceLoader resourceLoader; - - @Value("${config.schema.paths}") - private String RESOURCE_LOCATION; - - /** - * Loads config resources - * @throws Exception - */ - public void loadResources() throws Exception { - logger.info("RESOURCE_LOCATION:: "+RESOURCE_LOCATION); - Resource[] resources = getResources(RESOURCE_LOCATION); - - for (Resource resource : resources) { - String jsonContent = getContent(resource); - nameContentMap.put(resource.getFilename(), jsonContent); - } - logger.info("Number of resources loaded " + nameContentMap.size()); - - } - - /** - * To fetch a particular string content for a give resource/file name - * @param name - * @return - */ - public String get(String name) { - return nameContentMap.get(name); - } - - /** - * Loads all the resources/files with a given pattern *.json - * @param pattern path with *json - * @return - * @throws IOException - */ - private Resource[] getResources(String pattern) throws IOException { - Resource[] resources = ResourcePatternUtils.getResourcePatternResolver(resourceLoader).getResources(pattern); - return resources; - } - - /** - * Returns a content of resource - * - * @param resource - * @return - */ - private String getContent(Resource resource) { - String content = null; - InputStream is = null; - try { - is = resource.getInputStream(); - byte[] encoded = IOUtils.toByteArray(is); - content = new String(encoded, Charset.forName("UTF-8")); - - } catch (IOException e) { - logger.error("Cannot load resource " + resource.getFilename()); - - } finally{ - try { - is.close(); - } catch (IOException e) { - logger.error("Error while closing input stream. "); - } - } - return content; - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/Constants.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/Constants.java deleted file mode 100644 index e9bc4d085a0..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/Constants.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.ingestpipeline.util; - -import java.util.HashMap; -import java.util.Map; - -/** - * Constants which are with respect to the Ingest App - * - * @author Darshan Nagesh - * - */ - -public interface Constants { - public interface Paths { - final String ELASTIC_PUSH_CONTROLLER_PATH = "/ingest"; - final String SAVE = "/save"; - final String UPLOAD = "/upload"; - final String Targets = "/targets"; - final String Collections = "/getCollections"; - final String ES_INDEX = "/migrate/{indexName}/{version}"; - } - - public interface Qualifiers { - final String INGEST_SERVICE = "ingestService"; - final String VALIDATOR_SERVICE = "validatorService"; - final String TRANSFORM_SERVICE = "transformService"; - final String ENRICHMENT_SERVICE = "enrichmentService"; - final String TRANSFORM_COLLECTION_SERVICE = "transformCollectionService"; - final String DIGRESS_SERVICE = "digressService"; - } - - public static String SUCCESS = "success"; - public static int UNAUTHORIZED_ID = 401; - public static int SUCCESS_ID = 200; - public static int FAILURE_ID = 320; - public static String UNAUTHORIZED = "Invalid credentials. Please try again."; - public static String PROCESS_FAIL = "Process failed, Please try again."; - public static String DATE_FORMAT = "yyyy.MM.dd G 'at' HH:mm:ss z"; - public static String INDIAN_TIMEZONE = "IST"; - - public static String ALLOWED_METHODS_GET = "GET"; - public static String ALLOWED_METHODS_POST = "POST"; - public static String MDMS_MCOLLECT_SEARCH = "{\"MdmsCriteria\":{\"tenantId\":\"TENANTID_PLACEHOLDER\",\"moduleDetails\":[{\"moduleName\":\"BillingService\",\"masterDetails\":[{\"name\":\"BusinessService\",\"filter\":\"[?(@.type=='Adhoc')]\"}]}]},\"RequestInfo\":{}}"; - public static String TENANTID_PLACEHOLDER = "TENANTID_PLACEHOLDER"; - public static String CONTENT_TYPE = "content-type"; - public static String JSON = "application/json;charset=UTF-8"; - public static String MDMS_URL = "http://egov-mdms-service.egov:8080/egov-mdms-service/v1/_search"; - public static String MDMS_RES = "MdmsRes"; - public static String BUSINESS_SERVICE="BusinessService"; - public static String BILLING_SERVICE = "BillingService"; - public static String CATEGORY_CODE= "code"; - - public interface KafkaTopics { - public static final String INGEST_DATA = "ingestData"; - public static final String VALID_DATA = "validData"; - public static final String TRANSFORMED_DATA = "transformedData"; - public static final String ERROR_INTENT = "DataError"; - public static final String TOPIC_ONE = "topicOne"; - public static final String TOPIC_TWO = "topicTwo"; - public static final String TOPIC_THREE = "topicThree"; - public static final String TOPIC_FOUR = "topicFour"; - } - - public interface BeanContainerFactory { - public static final String INCOMING_KAFKA_LISTENER = "incomingKafkaListenerContainerFactory"; - } - - public interface DomainConfigurations { - public static final String COLLECTION_DOMAIN_CONFIG = "DomainConfig"; - public static final String ENHANCE_DOMAIN_CONFIG = "EnhanceDomainConfig"; - } - - public interface PipelineRules { - public static final String VALIDATE_DATA = "VALIDATE"; - public static final String TRANSFORM_DATA = "TRANSFORM"; - public static final String ENRICH_DATA = "ENRICH"; - } - - public interface ScrollSearch { - public static final String SCROLL_ID = "scrollId"; - public static final String SEARCH_PATH = "searchPath"; - public static final String QUERY = "query"; - public static final String SCROLL_ID_PARAMS = "_scroll_id"; - public static final String SCROLL_SEARCH_DEFAULT_QUERY = "{\"scroll\":\"1m\",\"scroll_id\":"; - } - - public interface DataContexts { - public static final String CONTEXT = "context"; - public static final String COLLECTION = "collection"; - public static final String BILLING = "billing" ; - public static final String PAYMENT = "payment" ; - } - - public static String DATA_CONTEXT = "dataContext"; - public static String DATA_CONTEXT_VERSION = "dataContextVersion"; - public static String DATA_OBJECT = "dataObject"; - - public static String ERROR_IN_PIPEINE = "errorPipeline"; - - public static int HEADER_ROW = 1; - public static String MUNICIPAL_CORPORATIONS = "Municipal Corporations"; - public static String ES_INDEX_COLLECTION = "collectionsindex-v1"; - public static String ES_INDEX_BILLING = "billingservice"; - public static String ES_INDEX_PAYMENT = "paymentsindex-v1"; - - public interface ErrorMessages { - Map errorCodeMessageMap = new HashMap() {{ - put("INGEST","Error finding Context for the Topic"); - put("VALIDATE","Error while validating the Document"); - put("TRANSFORM","Error while transforming the Document"); - put("ENRICH","Error while enriching the Document"); - }}; - } - - public static interface ConfigurationFileNames { - public static final String DIGRESSION_POINTS = "DigressionPoints.json"; - } - public static interface TransformationType { - public static final String COLLECTION = "collection"; - - } - public static final String IDENTIFIER = "identifier"; - public static final String TRANSACTION_ID = "transactionId"; - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/CustomErrorType.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/CustomErrorType.java deleted file mode 100644 index 687121237bb..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/CustomErrorType.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ingestpipeline.util; - - -public class CustomErrorType { - - private String errorMessage; - - public CustomErrorType(String errorMessage){ - this.errorMessage = errorMessage; - } - - public String getErrorMessage() { - return errorMessage; - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JSONUtil.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JSONUtil.java deleted file mode 100644 index 55b120f208d..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JSONUtil.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.ingestpipeline.util; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.gson.Gson; -import com.ingestpipeline.repository.ElasticSearchRepository; - -import org.json.JSONArray; -import org.json.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -@Service -public class JSONUtil { - @Autowired - public ObjectMapper mapper; - @Autowired - public Gson gson; - @Autowired - private ElasticSearchRepository elasticRepository; - - /** - * Field value to replace by new text. Replace node by given text to Parent's - * hierarchy. Field will not be added if not found existing already - * - * @param parent - * @param fieldName - * @param newValue - */ - public static void replaceFieldValue(ObjectNode parent, String fieldName, String newValue) { - if (parent.has(fieldName)) { - parent.put(fieldName, newValue); - } - parent.fields().forEachRemaining(entry -> { - JsonNode entryValue = entry.getValue(); - if (entryValue.isArray()) { - for (int i = 0; i < entryValue.size(); i++) { - if (entry.getValue().get(i).isObject()) - replaceFieldValue((ObjectNode) entry.getValue().get(i), fieldName, newValue); - } - } else if (entryValue.isObject()) { - replaceFieldValue((ObjectNode) entry.getValue(), fieldName, newValue); - } - }); - } - - /** - * Finds the value for a given key from the tree - * @param parent the tree - * @param key the field name - * @param value the value for the given field - */ - public static void findValue(ObjectNode parent, String key, StringBuffer value) { - parent.fields().forEachRemaining(entry -> { - if(entry.getKey().equalsIgnoreCase(key)){ - value.append(entry.getValue().asText()); - } else { - JsonNode entryValue = entry.getValue(); - if(entryValue.isArray()){ - for (int i=0; i < entryValue.size(); i++){ - if (entry.getValue().get(i).isObject()) - findValue((ObjectNode) entry.getValue().get(i), key, value); - } - } else if (entryValue.isObject()){ - findValue((ObjectNode) entry.getValue(), key, value); - } - } - }); - } - - - /** - * @return - */ - public static String getJsonString(ObjectMapper objectMapper,Object object) throws JsonProcessingException { - if(objectMapper != null){ - return objectMapper.writeValueAsString(object); - } - return null; - } - - public ObjectMapper getMapper() { - return mapper; - } - - public void setObjectMapper(ObjectMapper objectMapper){ - mapper=objectMapper; - } - - public Gson getGson() { - return gson; - } - - public void setGson(Gson gsonn) - { - gson = gsonn; - } - - public List fetchMCollectCategories (String tenantId) { - - String mdmsRequestString = Constants.MDMS_MCOLLECT_SEARCH.replace(Constants.TENANTID_PLACEHOLDER, tenantId); - Object mdmsRequestObject = mdmsRequestString; - - ResponseEntity result = elasticRepository.fetchMDMSResponse(mdmsRequestObject); - - Map body = result.getBody(); - JSONObject jsonObj = new JSONObject(body); - JSONArray jsonArray = jsonObj.getJSONObject(Constants.MDMS_RES).getJSONObject(Constants.BILLING_SERVICE).getJSONArray(Constants.BUSINESS_SERVICE); - List categoriesList = new ArrayList(); - - for(int i = 0 ; i < jsonArray.length() ; i++){ - categoriesList.add(jsonArray.getJSONObject(i).getString(Constants.CATEGORY_CODE)); - } - - return categoriesList; - - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JSONUtils.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JSONUtils.java deleted file mode 100644 index b317e8be03b..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JSONUtils.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ingestpipeline.util; - -import org.json.JSONObject; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonPropertyOrder({ "dataContext", "dataContextVersion", "dataObject"}) -public class JSONUtils { - public JSONObject JSONWrapper(JSONObject json) { - JSONObject obj = new JSONObject(); - obj.put("dataContext", "target"); - obj.put("dataContextVersion", "v1"); - obj.put("dataObject", json); - return obj; - } - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JsonKey.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JsonKey.java deleted file mode 100644 index 27dcd8a3294..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/JsonKey.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * - */ -package com.ingestpipeline.util; - -/** - * @author Abhishek - * - */ -public class JsonKey { - - public static final String STATUS_CODE = "statusCode"; - public static final String STATUS = "statusInfo"; - public static final String STATUS_MESSAGE = "statusMessage"; - public static final String ERROR_MESSAGE = "errorMessage"; - - public static final String RESPONSE_DATA = "responseData"; - - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/MockMultipartFile.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/MockMultipartFile.java deleted file mode 100644 index f678698ef46..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/MockMultipartFile.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.ingestpipeline.util; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - -import org.springframework.web.multipart.MultipartFile; - -public class MockMultipartFile implements MultipartFile { - - private String name; - private String originalFileName; - private String contentType; - private byte[] content; - - public MockMultipartFile(String name, String originalFileName, String contentType, byte[] content) { - super(); - this.name = name; - this.originalFileName = originalFileName; - this.contentType = contentType; - this.content = content; - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getOriginalFilename() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getContentType() { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean isEmpty() { - // TODO Auto-generated method stub - return false; - } - - @Override - public long getSize() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public byte[] getBytes() throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - public InputStream getInputStream() throws IOException { - // TODO Auto-generated method stub - return null; - } - - @Override - public void transferTo(File dest) throws IOException, IllegalStateException { - // TODO Auto-generated method stub - - } - - - - - - -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ReadUtil.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ReadUtil.java deleted file mode 100644 index 5f7290ff58d..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ReadUtil.java +++ /dev/null @@ -1,390 +0,0 @@ -package com.ingestpipeline.util; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.NavigableMap; -import java.util.Scanner; -import java.util.TreeMap; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.commons.fileupload.disk.DiskFileItem; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang3.RandomStringUtils; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.DataFormatter; -import org.apache.poi.ss.usermodel.DateUtil; -import org.apache.poi.ss.usermodel.RichTextString; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.ss.usermodel.WorkbookFactory; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.elasticsearch.search.aggregations.support.ValuesSource.Numeric; -import org.json.JSONArray; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.commons.CommonsMultipartFile; - -import com.ingestpipeline.controller.RestApiController; -import com.ingestpipeline.service.IngestService; - -@Component("readUtil") -public class ReadUtil { - - - @Value("${filename.length}") - private Integer filenameLengthValue; - - - @Value("${filename.useletters}") - private Boolean useLettersValue; - - @Value("${filename.usenumbers}") - private Boolean useNumbersValue; - - - private static Integer filenameLength; - - private static Boolean useLetters; - - private static Boolean useNumbers; - - @Value("${filename.length}") - public void setFilenameLength(Integer filenameLengthValue) { - ReadUtil.filenameLength = filenameLengthValue; - } - - @Value("${filename.useletters}") - public void setUseLetters(Boolean useLettersValue) { - ReadUtil.useLetters = useLettersValue; - } - - @Value("${filename.usenumbers}") - public void setUseNumbers(Boolean useNumbersValue) { - ReadUtil.useNumbers = useNumbersValue; - } - - public static final Logger LOGGER = LoggerFactory.getLogger(ReadUtil.class); - private static String UPLOADED_FOLDER = ""; - public static Path path; - public static File uploadFile = new File( - System.getProperty("user.dir") + System.getProperty("file.separator") + "uploads"); - - public static JSONArray getFiletoDirectory(MultipartFile file) throws Exception { - byte[] bytes = file.getBytes(); - if (!uploadFile.exists()) { - uploadFile.mkdir(); - } - UPLOADED_FOLDER = uploadFile.toString(); - - - String orignalFileName = file.getOriginalFilename(); - String randomString = RandomStringUtils.random(filenameLength, useLetters, useNumbers); - String fileName = System.currentTimeMillis() + randomString; - String extension = FilenameUtils.getExtension(orignalFileName); - - path = Paths.get(UPLOADED_FOLDER + System.getProperty("file.separator") + fileName + '.' + extension); - Files.write(path, bytes); - JSONArray fileIntoJsonArray = readFilefromDirectory(); - String jsonArrayFileName = fileName + ".json"; - writeJsonArrayToFile(fileIntoJsonArray, jsonArrayFileName); - return fileIntoJsonArray; - } - - private static JSONArray readFilefromDirectory() throws Exception { - String workbookSheetName = null; - int workbookSheetIndex = -1; - String getFileExtension = FilenameUtils.getExtension(path.toString()); - Workbook workbook = null; - if (getFileExtension.endsWith("xlsx")) { - workbook = new XSSFWorkbook(); - workbook = WorkbookFactory.create(new File(path.toString())); - } else { - throw new Exception("invalid file, should be xlsx"); - } - - JSONArray workbookToJsonArray = new JSONArray(); - for (int i = 0; i < workbook.getNumberOfSheets(); i++) { - Sheet sheet = workbook.getSheetAt(i); - workbookSheetName = sheet.getSheetName(); - workbookSheetIndex = workbook.getSheetIndex(workbookSheetName); - if (workbookSheetName != null && workbookSheetName.length() > 0) { - workbookToJsonArray = workbookToJsonArray.put(getSheetToJsonObject(workbook, sheet)); - } - } - - JSONArray bookInJsonArray = new JSONArray(); - for (int i = 0; i < workbookToJsonArray.length(); i++) { - JSONArray sheetInJsonArray = new JSONArray(); - sheetInJsonArray = (JSONArray) workbookToJsonArray.get(i); - Iterator itr = sheetInJsonArray.iterator(); - while (itr.hasNext()) { - JSONObject obj = (JSONObject) itr.next(); - bookInJsonArray.put(obj); - } - } - return bookInJsonArray; - } - - private static JSONArray getSheetToJsonObject(Workbook workbook, Sheet sheet) { - String workbookSheetName = sheet.getSheetName(); - int workbookSheetIndex = workbook.getSheetIndex(workbookSheetName); - Object financialYear = null; - int firstRowNum = sheet.getFirstRowNum(), lastRowNum = sheet.getLastRowNum(), - ulbFirstRowNumber = Constants.HEADER_ROW + 2, ulbDestRowNumber = -1; - Row row = null; - int rowFirstCellNum = -1, rowLastCellNum = -1; - List> rowRecordList = new LinkedList>(); - Map> rowRecordMap = new LinkedHashMap>(); - Map> municipalCity = new LinkedHashMap>(); - - if (lastRowNum > 0) { - for (int i = firstRowNum; i <= lastRowNum; i++) { - row = sheet.getRow(i); - if (row != null) { - rowFirstCellNum = row.getFirstCellNum(); - rowLastCellNum = sheet.getRow(i).getLastCellNum(); - List rowRecord = new LinkedList(); - Map> singleRowDataMap = new LinkedHashMap>(); - for (int j = rowFirstCellNum; j < rowLastCellNum; j++) { - Cell cell = row.getCell(j); - if (isMergedRegion(workbook, sheet, i, j)) { - sheet = getSheetMergerCellRegion(workbook, sheet, i, j); - } - singleRowDataMap.put(i, getRowRecord(cell, rowRecord)); - } - - if (!rowRecord.isEmpty()) { - rowRecordList.add(rowRecord); - // rowRecordMap.put(i, rowRecord); - rowRecordMap.putAll(singleRowDataMap); - - } - - if (rowRecordList.size() == 1) { - financialYear = rowRecordList.get(Constants.HEADER_ROW - 1).get(3).toString().trim(); - } - } - } - } - - List sheetHeaderList = new LinkedList(); - List customHeaderList = new LinkedList(); - Map customHeaderMap = new LinkedHashMap(); - JSONArray getMunicipalCityToJsonArray = new JSONArray(); - Map> lastRowRecord = new LinkedHashMap>(); - customHeaderList.add("Sheet Name"); - customHeaderList.add("Financial Year"); - customHeaderList.add("Timestamp"); - // customHeaderList.add("Municipal Corporations"); - customHeaderMap.put(customHeaderList.get(0), workbookSheetName); - customHeaderMap.put(customHeaderList.get(1), financialYear); - DateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm:S"); - Date dateobj = new Date(); - customHeaderMap.put(customHeaderList.get(2), df.format(dateobj)); - JSONObject customHeaderJsonObject = new JSONObject(); - JSONArray municipalCitiesIntoJsonArray = new JSONArray(); - for (Map.Entry> itrRowRecordMap : rowRecordMap.entrySet()) { - if (itrRowRecordMap.getKey() == Constants.HEADER_ROW) { - sheetHeaderList.addAll(itrRowRecordMap.getValue()); - } - if (itrRowRecordMap.getKey() >= ulbFirstRowNumber) { - JSONObject municipalCitiesIntoJsonObject = new JSONObject(); - Map mc = new LinkedHashMap(); - municipalCity.put(itrRowRecordMap.getKey(), itrRowRecordMap.getValue()); - for (Map.Entry itrCustomHeaderMap : customHeaderMap.entrySet()) { - municipalCitiesIntoJsonObject.accumulate(itrCustomHeaderMap.getKey().toString(), - itrCustomHeaderMap.getValue()); - } - - for (int i = 0; i < sheetHeaderList.size(); i++) { - if ((!sheetHeaderList.get(i).toString().contentEquals("-")) - && (!itrRowRecordMap.getValue().get(i).toString().contentEquals("-"))) { - - municipalCitiesIntoJsonObject.put(sheetHeaderList.get(i).toString(), - itrRowRecordMap.getValue().get(i)); - } - } - - municipalCitiesIntoJsonArray.put(municipalCitiesIntoJsonObject); - } - } - return municipalCitiesIntoJsonArray; - } - - private static List getRowRecord(Cell cell, List rowRecord) { - switch (cell.getCellType()) { - case STRING: - String str = cell.getRichStringCellValue().getString(); - str = str.replaceAll("(\\n\\s)+|(\\r\\n\\s)+|(\\r\\s)+|(\\r)+|(\\n)+|(\\s)+", " "); - rowRecord.add(str); - break; - case NUMERIC: - if (DateUtil.isCellDateFormatted(cell)) { - rowRecord.add(cell.getDateCellValue()); - break; - } else { - Double d = cell.getNumericCellValue(); - DecimalFormat numberFormat = new DecimalFormat("#.00"); - rowRecord.add(Double.parseDouble(numberFormat.format(d))); - } - break; - case BOOLEAN: - rowRecord.add(cell.getBooleanCellValue()); - break; - case FORMULA: - if (cell.getCachedFormulaResultType().equals(CellType.NUMERIC)) { - Double d = cell.getNumericCellValue() * 100; - DecimalFormat numberFormat = new DecimalFormat("#.00"); - rowRecord.add(Double.parseDouble(numberFormat.format(d))); - break; - } else if (cell.getCachedFormulaResultType().equals(CellType.STRING)) { - rowRecord.add(cell.getNumericCellValue()); - break; - } - break; - case BLANK: - rowRecord.add("-"); - break; - default: - rowRecord.add("no type match"); - break; - } - return rowRecord; - } - - private static boolean isMergedRegion(Workbook workbook, Sheet sheet, int cellRow, int cellColumn) { - int retVal = 0; - int sheetMergerCount = sheet.getNumMergedRegions(); - for (int i = 0; i < sheetMergerCount; i++) { - CellRangeAddress region = sheet.getMergedRegion(i); - int firstRow = region.getFirstRow(), firstCol = region.getFirstColumn(), lastRow = region.getLastRow(), - lastCol = region.getLastColumn(); - if (cellRow >= firstRow && cellRow <= lastRow) { - if (cellColumn >= firstCol && cellColumn <= lastCol) { - retVal = lastCol - firstCol + 1; - if (retVal > 0) { - return true; - } - break; - } - } - } - return false; - } - - private static Sheet getSheetMergerCellRegion(Workbook workbook, Sheet sheet, int cellRow, int cellColumn) { - int retVal = 0; - int sheetMergerCount = sheet.getNumMergedRegions(); - for (int i = 0; i < sheetMergerCount; i++) { - CellRangeAddress region = sheet.getMergedRegion(i); - int firstRow = region.getFirstRow(); - int firstCol = region.getFirstColumn(); - int lastRow = region.getLastRow(); - int lastCol = region.getLastColumn(); - if (cellRow >= firstRow && cellRow <= lastRow) { - if (cellColumn >= firstCol && cellColumn <= lastCol) { - retVal = lastCol - firstCol + 1; - Row row = sheet.getRow(i); - if (retVal > 0) { - for (int j = firstRow; j <= lastRow; j++) { - for (int k = firstCol; k <= lastCol; k++) { - Cell cell = sheet.getRow(region.getFirstRow()).getCell(region.getFirstColumn()); - String stringValue1 = null; - Double doubleValue1 = -1.00; - Date dateValue1 = new Date(); - Boolean booleanValue1 = false; - RichTextString formulaValue1 = null; - switch (cell.getCellType()) { - case STRING: - stringValue1 = sheet.getRow(region.getFirstRow()).getCell(region.getFirstColumn()) - .getRichStringCellValue().getString(); - sheet.getRow(j).getCell(k).setCellValue(stringValue1); - break; - case NUMERIC: - if (DateUtil.isCellDateFormatted( - sheet.getRow(region.getFirstRow()).getCell(region.getFirstColumn()))) { - dateValue1 = sheet.getRow(region.getFirstRow()).getCell(region.getFirstColumn()) - .getDateCellValue(); - sheet.getRow(j).getCell(k).setCellValue(dateValue1); - } else { - doubleValue1 = sheet.getRow(region.getFirstRow()) - .getCell(region.getFirstColumn()).getNumericCellValue(); - sheet.getRow(j).getCell(k).setCellValue(doubleValue1); - } - break; - case BOOLEAN: - booleanValue1 = sheet.getRow(region.getFirstRow()).getCell(region.getFirstColumn()) - .getBooleanCellValue(); - sheet.getRow(j).getCell(k).setCellValue(booleanValue1); - break; - case FORMULA: - if (cell.getCachedFormulaResultType().equals(CellType.NUMERIC)) { - doubleValue1 = cell.getNumericCellValue() * 100; - sheet.getRow(j).getCell(k).setCellValue(doubleValue1); - break; - } else if (cell.getCachedFormulaResultType().equals(CellType.STRING)) { - formulaValue1 = cell.getRichStringCellValue(); - sheet.getRow(j).getCell(k).setCellValue(formulaValue1); - break; - } - break; - case BLANK: - break; - default: - } - } - } - } - } - } - } - return sheet; - } - - private static void writeJsonArrayToFile(JSONArray data, String fileName) throws IOException { - String currentWorkingFolder = System.getProperty("user.dir"), - filePathSeperator = System.getProperty("file.separator"), - filePath = currentWorkingFolder + filePathSeperator + fileName; - BufferedWriter bufferedWriter = null; - try { - bufferedWriter = new BufferedWriter(new FileWriter(new File(filePath))); - bufferedWriter.write(data.toString()); - }catch (Exception e){ - LOGGER.error("Error while writing to file. "); - }finally { - bufferedWriter.flush(); - bufferedWriter.close(); - } - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseCode.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseCode.java deleted file mode 100644 index fe20fbf7f9a..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseCode.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.ingestpipeline.util; - -/** - * - * @author Abhishek - * - */ -public enum ResponseCode { - UnAuthorised(Constants.UNAUTHORIZED_ID, Constants.UNAUTHORIZED), Success( - Constants.SUCCESS_ID, Constants.SUCCESS),FAILURE( - Constants.FAILURE_ID, Constants.PROCESS_FAIL); - /** - * error code contains int value - */ - private int errorCode; - /** - * errorMessage contains proper error message. - */ - private String errorMessage; - - - - /** - * @param errorCode - * @param errorMessage - */ - private ResponseCode(int errorCode, String errorMessage) { - this.errorCode = errorCode; - this.errorMessage = errorMessage; - } - - /** - * - * @param errorCode - * @return - */ - public String getMessage(int errorCode) { - return ""; - } - - /** - * @return - */ - public int getErrorCode() { - return errorCode; - } - - /** - * @param errorCode - */ - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - } - - /** - * @return - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * @param errorMessage - */ - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - /** - * This method will provide status message based on code - * - * @param code - * @return String - */ - public static String getResponseMessage(int code) { - String value = ""; - ResponseCode responseCodes[] = ResponseCode.values(); - for (ResponseCode actionState : responseCodes) { - if (actionState.getErrorCode() == code) { - value = actionState.getErrorMessage(); - } - } - return value; - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseGenerator.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseGenerator.java deleted file mode 100644 index 46b73508c0c..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseGenerator.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.ingestpipeline.util; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; - -public class ResponseGenerator { - - - private static ObjectMapper objectMapper = new ObjectMapper(); - - public static String failureResponse() throws JsonProcessingException{ - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.FAILURE.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, - ResponseCode.FAILURE.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE, - ResponseCode.FAILURE.getErrorMessage()); - return JSONUtil.getJsonString(objectMapper,response); - } - - - public static String failureResponse(String message) throws JsonProcessingException{ - ObjectNode actualResponse = objectMapper.createObjectNode(); - - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.FAILURE.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, - ResponseCode.FAILURE.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE,message); - actualResponse.putPOJO(JsonKey.STATUS,response); - - return JSONUtil.getJsonString(objectMapper,actualResponse); - } - - public static String feedbackFailureResponse(String message) throws JsonProcessingException{ - ObjectNode actualResponse = objectMapper.createObjectNode(); - - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.FAILURE.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, - ResponseCode.FAILURE.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE,message); - actualResponse.putPOJO(JsonKey.STATUS,response); - - return JSONUtil.getJsonString(objectMapper,actualResponse); - } - - public static String successResponse(Object obj) throws JsonProcessingException { - ObjectNode actualResponse = objectMapper.createObjectNode(); - - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.Success.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, ResponseCode.Success.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE, ""); - actualResponse.putPOJO(JsonKey.STATUS,response); - if (obj != null) { - actualResponse.putPOJO(JsonKey.RESPONSE_DATA, obj); - } - - return JSONUtil.getJsonString(objectMapper,actualResponse); - } - - public static String feedbackSuccessResponse(Object obj) throws JsonProcessingException { - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.Success.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, ResponseCode.Success.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE, ""); - return JSONUtil.getJsonString(objectMapper,response); - } - - public static String feedbackSuccessResponse(String message) throws JsonProcessingException { - ObjectNode response = objectMapper.createObjectNode(); - response.put(JsonKey.STATUS_CODE, ResponseCode.Success.getErrorCode()); - response.put(JsonKey.STATUS_MESSAGE, ResponseCode.Success.getErrorMessage()); - response.put(JsonKey.ERROR_MESSAGE, ""); - return JSONUtil.getJsonString(objectMapper, response); - } -} diff --git a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseMessages.java b/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseMessages.java deleted file mode 100644 index 5f75d4415b3..00000000000 --- a/business-services/dashboard-ingest/src/main/java/com/ingestpipeline/util/ResponseMessages.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ingestpipeline.util; - -public interface ResponseMessages { - - public interface ErrorMessages { - } - - public interface SuccessMessages { - } - -} diff --git a/business-services/dashboard-ingest/src/main/resources/application.properties b/business-services/dashboard-ingest/src/main/resources/application.properties deleted file mode 100644 index 9d73584fd0c..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/application.properties +++ /dev/null @@ -1,78 +0,0 @@ -#--------------------------- PATH & PORT CONFIGURATIONS ---------------------------# - -# SET CONTEXT PATH -server.port=8080 -server.context-path=/dashboard-ingest -server.servlet.context-path=/dashboard-ingest - -# KAFKA SERVER CONFIGURATIONS -spring.kafka.bootstrap.servers=localhost:9092 - -spring.kafka.consumer.value-deserializer=com.ingestpipeline.consumer.HashMapDeserializer -spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.group-id=pipeline-group -spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer -spring.kafka.listener.missing-topics-fatal=false - -# KAFKA CONSUMER CONFIGURATIONS -kafka.consumer.config.auto_commit=true -kafka.consumer.config.auto_commit_interval=100 -kafka.consumer.config.session_timeout=15000 -kafka.consumer.config.group_id=pipeline-group -kafka.consumer.config.auto_offset_reset=earliest - -# KAFKA PRODUCER CONFIGURATIONS -kafka.producer.config.retries_config=0 -kafka.producer.config.batch_size_config=100000 -kafka.producer.config.linger_ms_config=100 -kafka.producer.config.buffer_memory_config=66554432 - -#----------------------------- ELASTIC SEARCH CONFIGURATIONS ------------------------------# -services.esindexer.host=http://104.211.240.72:9200/ -services.esindexer.host.name=104.211.240.72 -services.esindexer.host.port=9200 -services.esindexer.username=deploy -services.esindexer.password=Deploy123 -kafka.topics.incoming.data=tarento-dss-collection -kafka.topics.incoming.collection=dss-collection-update - -kafka.topics.enriched.data=egov-dss-ingest-enriched -kafka.topics.enriched.key=enrData -kafka.topics.bypass.update.data=egov-dss-update-receive -kafka.topics.bypass.update.post=egov-dss-update-post -kafka.topics.bypass.update.key=updateTopicKey -es.target.index.name = dss-target_v1 -es.index.name=dss-payment_v2 -es.index.type=general -es.document.type=pipeline_data -es.host.schema=https -es.push.direct=true -es.bypass.push.direct = true -es.index.searchQuery.collection = {\"size\": \"10\",\"query\":{\"bool\":{\"must\":[{\"wildcard\": {\"Data.tenantId.keyword\":\"pb.*\"}}]}}} -es.index.searchQuery.billing = {\"size\": \"10\",\"query\":{\"bool\":{\"must\":[{\"wildcard\": {\"tenantid.keyword\":\"pb.*\"}}]}}} -es.index.searchQuery.payment = {\"size\": \"10\"} -egov.services.esindexer.host.search=/_search - -spring.data.elasticsearch.cluster.name=elasticsearch-v1 -spring.data.elasticsearch.cluster.nodes=elasticsearch-v1 - -service.retry.maxAttempts=3 -service.retry.backoff.delay=1000 -management.endpoints.web.base-path=/ - -#----------------------------- Pipeline Schema Config Locations ------------------------------# -transformation.config.location=config/transform_transaction_v1.json - -schema.transaction.validation=config/validator_transaction_v1.json -schema.transaction.transformation=config/transform_transaction_v1.json -schema.transaction.enrichment=config/enrichment_transaction_v1.json - -config.schema.paths=classpath*:config/*.json - -#Paramters for naming file for internal storage -filename.length=10 -filename.useletters=true -filename.usenumbers=false - -id.timezone=IST \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/resources/config/CollectionDomainConfig.json b/business-services/dashboard-ingest/src/main/resources/config/CollectionDomainConfig.json deleted file mode 100644 index 5265a5350b4..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/CollectionDomainConfig.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "domainConfig": [ - { - "id": "1", - "businessType": "PT", - "indexName": "ptindex-v1", - "documentType": "", - "query": "{\"query\":{\"bool\":{\"must\":[{\"match_phrase\":{\"Data.propertyDetails.assessmentNumber\":\"value\"}},{\"match_phrase\":{\"Data.propertyId\":\"value\"}}]}}}", - "references": [ - { - "fieldName": "consumerCode", - "argument": "Data.propertyId", - "dataType": "String" - }, - { - "fieldName": "consumerCode", - "argument": "Data.propertyDetails.assessmentNumber", - "dataType": "String" - } - ] - }, - { - "id": "2", - "businessType": "TL", - "indexName": "tlindex-v1", - "documentType": "", - "query": "{\"query\":{\"bool\":{\"must\":[{\"match_phrase\":{\"Data.tradelicense.applicationnumber\":\"value\"}}]}}}", - "references": [ - { - "fieldName": "consumerCode", - "argument": "Data.tradelicense.applicationnumber", - "dataType": "String" - } - ] - }, - { - "id": "3", - "businessType": "PGR", - "indexName": "pgrindex-v1", - "documentType": "", - "query": "{}", - "references": [ - { - "fieldName": "consumerCode", - "argument": "complainNumber", - "dataType": "String" - } - ] - } - ] -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/resources/config/DigressionPoints.json b/business-services/dashboard-ingest/src/main/resources/config/DigressionPoints.json deleted file mode 100644 index 2ebf20de3f3..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/DigressionPoints.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "digressionPoints": [ - { - "dataContext": "collection", - "paths": [ "Bill", "billDetails" ] - } - ] -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/resources/config/DomainConfig.json b/business-services/dashboard-ingest/src/main/resources/config/DomainConfig.json deleted file mode 100644 index 17079e97fdb..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/DomainConfig.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "domainConfig": [ - { - "id": "1", - "domain": "PT", - "indexName": "ptindex-v1", - "documentType": "", - "query": "{\"query\":{\"bool\":{\"must\":[{\"match_phrase\":{\"Data.propertyDetails.assessmentNumber\":\"value\"}},{\"match_phrase\":{\"Data.propertyId\":\"value\"}}]}}}", - "targetReferences": [ - { - "fieldName": "propertyId", - "argument": "Data.propertyId", - "dataType": "String", - "value": "$value", - "seperator": " ", - "expression": "propertyId" - }, - { - "fieldName": "assessmentNumber", - "argument": "Data.propertyDetails.assessmentNumber", - "dataType": "String", - "value": "$value", - "seperator": " ", - "expression": "assessmentNumber" - } - ], - "sourceReferences": [ - { - "fieldName": "consumerCode", - "argument": "Bill.billDetails.consumerCode", - "dataType": "String", - "value": "$value", - "seperator": ":", - "expression": "propertyId:assessmentNumber" - } - ] - }, - { - "id": "2", - "domain": "TL", - "indexName": "tlindex-v1", - "documentType": "", - "query": "{\"query\":{\"bool\":{\"must\":[{\"match_phrase\":{\"Data.tradelicense.applicationnumber\":\"value\"}}]}}}", - "targetReferences": [ - { - "fieldName": "applicationnumber", - "argument": "Data.tradelicense.applicationnumber", - "dataType": "String", - "value": "$value", - "seperator": " ", - "expression": "applicationnumber" - } - ], - "sourceReferences": [ - { - "fieldName": "consumerCode", - "argument": "Data.tradelicense.applicationnumber", - "dataType": "String", - "value": "$value", - "seperator": " ", - "expression": "applicationnumber" - } - ] - }, - { - "id": "3", - "domain": "PGR", - "indexName": "pgrindex-v1", - "documentType": "", - "query": "{}", - "targetReferences": [ - { - "fieldName": "complainNumber", - "argument": "Data.complainNumber", - "dataType": "String", - "value": "$value", - "seperator": " ", - "expression": "complainNumber" - } - ], - "sourceReferences": [ - { - "fieldName": "consumerCode", - "argument": "Data.complainNumber", - "value": "$value", - "seperator": " ", - "expression": "complainNumber" - } - ] - } - ] -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/resources/config/EnhanceDomainConfig.json b/business-services/dashboard-ingest/src/main/resources/config/EnhanceDomainConfig.json deleted file mode 100644 index d157119fb3c..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/EnhanceDomainConfig.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "domainConfig": [ - { - "id": "1", - "domain": "PT", - "indexName": "property-assessments", - "documentType": "", - "query": "{\"query\":{\"bool\":{\"must\":[{\"match_phrase\":{\"Data.propertyId\":\"value\"}}]}}}", - "targetReferences": [ - { - "fieldName": "propertyId", - "argument": "Data.propertyId", - "dataType": "String", - "value": "$value", - "seperator": " ", - "expression": "propertyId" - } - ], - "sourceReferences": [ - { - "fieldName": "consumerCode", - "argument": "paymentDetails.bill.consumerCode", - "dataType": "String", - "value": "$value", - "seperator": ":", - "expression": "propertyId" - } - ] - } - ] -} diff --git a/business-services/dashboard-ingest/src/main/resources/config/TopicContextConfiguration.json b/business-services/dashboard-ingest/src/main/resources/config/TopicContextConfiguration.json deleted file mode 100644 index beb133611a7..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/TopicContextConfiguration.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "topicContextConfigurations": [ - { - "topic": "dss-collection-update", - "dataContext": "collection", - "dataContextVersion": "v1" - }, - { - "topic": "topicTwo", - "dataContext": "billing", - "dataContextVersion": "v1" - } - ] -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/resources/config/config.properties b/business-services/dashboard-ingest/src/main/resources/config/config.properties deleted file mode 100644 index df830f5b174..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/config.properties +++ /dev/null @@ -1,18 +0,0 @@ -#--------------------------- Kafka Topics & Configurations ---------------------------# -dataContext=transaction - -kafka.transaction.ingest.topic=ingestData -kafka.transaction.ingest.key=ingestKey - -kafka.transaction.validation.topic=validData -kafka.transaction.validation.key=validKey - -kafka.transaction.transformation.topic=transformedData -kafka.transaction.transformation.key=transformedKey - -kafka.transaction.enrichment.topic=egov-dss-ingest-enriched -kafka.transaction.enrichment.key=enrichedKey - -pipelinerules={'VALIDATE':false,'TRANSFORM':true,'ENRICH':true} - -transformation.config.location=config/transform_transaction_v1.json diff --git a/business-services/dashboard-ingest/src/main/resources/config/enrichment_transaction_v1.json b/business-services/dashboard-ingest/src/main/resources/config/enrichment_transaction_v1.json deleted file mode 100644 index 038c1be330c..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/enrichment_transaction_v1.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "dataCollectorName": "UserInformation", - "collectionSource": "UserService", - "basePath": "http://rain.idc.tarento.com/user/", - "collectionPoints": [ - { - "name": "UserMetaInfo", - "extensionPath": "/getUserMetaInfo", - "paramsPassed": [ - { - "sourceParam": "Transaction.KioskOperator.Id", - "pathLabel": "id", - "dataType": "Long", - "defaultValue": "0" - }, - { - "sourceParam": null, - "pathLabel": "isActive", - "dataType": "Boolean", - "defaultValue": "TRUE" - } - ], - "responseStructure": "{}", - "responseMapping": [ - { - - } - ] - }, - { - "name": "UserRoleInfo", - "extensionPath": "/getUserRole", - "paramsPassed": [ - { - "sourceParam": "Transaction.KioskOperator.Id", - "pathLabel": "userId", - "dataType": "Long", - "defaultValue": "0" - }, - { - "sourceParam": null, - "pathLabel": "isActive", - "dataType": "Boolean", - "defaultValue": "TRUE" - } - ] - } - ] -} diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_collection_v1.json b/business-services/dashboard-ingest/src/main/resources/config/transform_collection_v1.json deleted file mode 100644 index 3bed7dd5941..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_collection_v1.json +++ /dev/null @@ -1,98 +0,0 @@ -[ - { - "operation": "shift", - "spec": { - "tenantId": "tenantId", - "transactionId": "transactionId", - "@timestamp": "@timestamp", - "Bill": { - "$i": { - "billDetails": { - "$j": { - "voucherHeader": "Bill.billDetails.voucherHeader", - "boundary": "Bill.billDetails.boundary", - "collectedAmount": "Bill.billDetails.collectedAmount", - "channel": "Bill.billDetails.channel", - "manualReceiptDate": "Bill.billDetails.manualReceiptDate", - "expiryDate": "Bill.billDetails.expiryDate", - "demandId": "Bill.billDetails.demandId", - "amountPaid": "Bill.billDetails.amountPaid", - "consumerCode": "Bill.billDetails.consumerCode", - "id": "Bill.billDetails.id", - "department": "Bill.billDetails.department", - "receiptNumber": "Bill.billDetails.receiptNumber", - "businessService": "Bill.billDetails.businessService", - "receiptType": "Bill.billDetails.receiptType", - "fromPeriod": "Bill.billDetails.fromPeriod", - "stateId": "Bill.billDetails.stateId", - "receiptDate": "Bill.billDetails.receiptDate", - "bill": "Bill.billDetails.bill", - "billDate": "Bill.billDetails.billDate", - "consumerType": "Bill.billDetails.consumerType", - "totalAmount": "Bill.billDetails.totalAmount", - "collectionType": "Bill.billDetails.collectionType", - "fund": "Bill.billDetails.fund", - "manualReceiptNumber": "Bill.billDetails.manualReceiptNumber", - "tenantId": "Bill.billDetails.tenantId", - "toPeriod": "Bill.billDetails.toPeriod", - "partPaymentAllowed": "Bill.billDetails.partPaymentAllowed", - "billNumber": "Bill.billDetails.billNumber", - "status": "Bill.billDetails.status", - "billAccountDetails": { - "*": { - "taxHeadCode": "Bill.billDetails.billAccountDetails.[&1].taxHeadCode", - "glcode": "Bill.billDetails.billAccountDetails.[&1].glcode", - "amount": "Bill.billDetails.billAccountDetails.[&1].amount", - "billDetail": "Bill.billDetails.billAccountDetails.[&1].billDetail", - "purpose": "Bill.billDetails.billAccountDetails.[&1].purpose", - "adjustedAmount": "Bill.billDetails.billAccountDetails.[&1].adjustedAmount", - "tenantId": "Bill.billDetails.billAccountDetails.[&1].tenantId", - "id": "Bill.billDetails.billAccountDetails.[&1].id", - "demandDetailId": "Bill.billDetails.billAccountDetails.[&1].demandDetailId" - } - } - } - }, - "isCancelled": "Bill.isCancelled", - "paidBy": "Bill.paidBy", - "mobileNumber": "Bill.mobileNumber", - "payerId": "Bill.payerId", - "isActive": "Bill.isActive", - "additionalDetails": "Bill.additionalDetails", - "payerAddress": "Bill.payerAddress", - "taxAndPayments": "Bill.taxAndPayments", - "auditDetails": "Bill.auditDetails", - "tenantId": "Bill.tenantId", - "payerName": "Bill.payerName", - "id": "Bill.id", - "payerEmail": "Bill.payerEmail" - } - }, - "instrument": { - "bankAccount": "instrument.bankAccount", - "transactionDateInput": "instrument.transactionDateInput", - "amount": "instrument.amount", - "instrumentType": { - "instrumentTypeProperties": "instrument.typeProperties", - "name": "instrument.typeName", - "id": "instrument.typeId" - }, - "instrumentNumber": "instrument.number" - }, - "tenantData": { - "code": "tenantData.code", - "name": "tenantData.name", - "type": "tenantData.type", - "city": { - "name": "tenantData.cityName", - "localName": "tenantData.cityLocalName", - "districtCode": "tenantData.cityDistrictCode", - "districtName": "tenantData.cityDistrictName", - "regionName": "tenantData.cityRegionName", - "ulbGrade": "tenantData.cityUlbGrade", - "code": "tenantData.cityCode" - } - } - } - } -] diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_collection_v2.json b/business-services/dashboard-ingest/src/main/resources/config/transform_collection_v2.json deleted file mode 100644 index cfd516bf9d8..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_collection_v2.json +++ /dev/null @@ -1,100 +0,0 @@ -[ - { - "operation": "shift", - "spec": { - "tenantId": "tenantId", - "id": "id", - "paymentMode": "paymentMode", - "paymentStatus": "paymentStatus", - "transactionId": "transactionNumber", - "paidBy": "paidBy", - "payer": "payer", - "paymentDetails": { - "$i": { - "businessService": "paymentDetails.businessService", - "receiptType": "paymentDetails.receiptType", - "totalDue": "paymentDetails.totalDue", - "receiptDate": "paymentDetails.receiptDate", - "bill": { - "billDetails": { - "$j": { - "boundary": "paymentDetails.bill.billDetails.boundary", - "amount": "paymentDetails.bill.billDetails.amount", - "fromPeriod": "paymentDetails.bill.billDetails.fromPeriod", - "voucherHeader": "paymentDetails.bill.billDetails.voucherHeader", - "channel": "paymentDetails.bill.billDetails.channel", - "additionalDetails": "paymentDetails.bill.billDetails.additionalDetails", - "cancellationRemarks": "paymentDetails.bill.billDetails.cancellationRemarks", - "manualReceiptDate": "paymentDetails.bill.billDetails.manualReceiptDate", - "expiryDate": "paymentDetails.bill.billDetails.expiryDate", - "collectionType": "paymentDetails.bill.billDetails.collectionType", - "displayMessage": "paymentDetails.bill.billDetails.displayMessage", - "demandId": "paymentDetails.bill.billDetails.demandId", - "amountPaid": "paymentDetails.bill.billDetails.amountPaid", - "manualReceiptNumber": "paymentDetails.bill.billDetails.manualReceiptNumber", - "billId": "paymentDetails.bill.billDetails.billId", - "auditDetails": "paymentDetails.bill.billDetails.auditDetails", - "tenantId": "paymentDetails.bill.billDetails.tenantId", - "toPeriod": "paymentDetails.bill.billDetails.toPeriod", - "billDescription": "paymentDetails.bill.billDetails.billDescription", - "id": "paymentDetails.bill.billDetails.id", - "callBackForApportioning": "paymentDetails.bill.billDetails.callBackForApportioning", - "billAccountDetails": { - "*": { - "amount": "paymentDetails.bill.billDetails.billAccountDetails.[&1].amount", - "taxHeadCode": "paymentDetails.bill.billDetails.billAccountDetails.[&1].taxHeadCode", - "purpose": "paymentDetails.bill.billDetails.billAccountDetails.[&1].purpose", - "adjustedAmount": "paymentDetails.bill.billDetails.billAccountDetails.[&1].adjustedAmount", - "auditDetails": "paymentDetails.bill.billDetails.billAccountDetails.[&1].auditDetails", - "tenantId": "paymentDetails.bill.billDetails.billAccountDetails.[&1].tenantId", - "id": "paymentDetails.bill.billDetails.billAccountDetails.[&1].id", - "billDetailId": "paymentDetails.bill.billDetails.billAccountDetails.[&1].billDetailId", - "additionalDetails": "paymentDetails.bill.billDetails.billAccountDetails.[&1].additionalDetails", - "demandDetailId": "paymentDetails.bill.billDetails.billAccountDetails.[&1].demandDetailId", - "order": "paymentDetails.bill.billDetails.billAccountDetails.[&1].order", - "isActualDemand": "paymentDetails.bill.billDetails.billAccountDetails.[&1].isActualDemand" - } - } - } - }, - "isAdvanceAllowed": "paymentDetails.bill.isAdvanceAllowed", - "businessService": "paymentDetails.bill.businessService", - "isCancelled": "paymentDetails.bill.isCancelled", - "collectionModesNotAllowed": "paymentDetails.bill.collectionModesNotAllowed", - "paidBy": "paymentDetails.bill.paidBy", - "mobileNumber": "paymentDetails.bill.mobileNumber", - "payerId": "paymentDetails.bill.payerId", - "reasonForCancellation": "paymentDetails.bill.reasonForCancellation", - "minimumAmountToBePaid": "paymentDetails.bill.minimumAmountToBePaid", - "billDate": "paymentDetails.bill.billDate", - "additionalDetails": "paymentDetails.bill.additionalDetails", - "totalAmount": "paymentDetails.bill.totalAmount", - "payerAddress": "paymentDetails.bill.payerAddress", - "auditDetails": "paymentDetails.bill.auditDetails", - "tenantId": "paymentDetails.bill.tenantId", - "payerName": "paymentDetails.bill.payerName", - "partPaymentAllowed": "paymentDetails.bill.partPaymentAllowed", - "consumerCode": "paymentDetails.bill.consumerCode", - "id": "paymentDetails.bill.id", - "billNumber": "paymentDetails.bill.billNumber", - "payerEmail": "paymentDetails.bill.payerEmail", - "status": "paymentDetails.bill.status" - }, - "totalAmountPaid": "paymentDetails.totalAmountPaid", - "additionalDetails": "paymentDetails.additionalDetails", - "manualReceiptDate": "paymentDetails.manualReceiptDate", - "manualReceiptNumber": "paymentDetails.manualReceiptNumber", - "billId": "paymentDetails.billId", - "auditDetails": "paymentDetails.auditDetails", - "tenantId": "paymentDetails.tenantId", - "id": "paymentDetails.id", - "receiptNumber": "paymentDetails.receiptNumber" - } - }, - "auditDetails": "auditDetails", - "additionalDetails": "additionalDetails", - "tenantData": "tenantData", - "@timestamp": "@timestamp" - } - } -] diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_pgr_v1.json b/business-services/dashboard-ingest/src/main/resources/config/transform_pgr_v1.json deleted file mode 100644 index e1d93fe4ca5..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_pgr_v1.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "operation": "shift", - "spec": { - "tenantId": "tenantId", - "serviceRequestId": "serviceRequestId", - "complainCategory": "complainCategory", - "dateOfComplaint": "dateOfComplaint" - - } - } -] diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_pt_enhance_v1.json b/business-services/dashboard-ingest/src/main/resources/config/transform_pt_enhance_v1.json deleted file mode 100644 index 722d01a3a06..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_pt_enhance_v1.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "operation": "shift", - "spec": { - "assessmentNumber": "assessmentNumber", - "assessmentDate": "assessmentDate", - "financialYear": "financialYear", - "status" : "status", - "propertyId": "propertyId" - } - } -] diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_pt_v1.json b/business-services/dashboard-ingest/src/main/resources/config/transform_pt_v1.json deleted file mode 100644 index 1bc6766b79a..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_pt_v1.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "operation": "shift", - "spec": { - "tenantId": "tenantId", - "propertyId": "propertyId", - "propertyDetails": "propertyDetails", - "ward" : "ward" - } - } -] diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_target_v1.json b/business-services/dashboard-ingest/src/main/resources/config/transform_target_v1.json deleted file mode 100644 index da01e1ffeae..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_target_v1.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "operation": "shift", - "spec": { - "*": { - "S. No.": "[&1].snoForMunicipalCorporation", - "Tenant Id": "[&1].tenantIdForMunicipalCorporation", - "ULB Name": "[&1].ulbName", - "Actual Collection (in Lakhs)": "[&1].actualCollectionForMunicipalCorporation", - "Budget Proposed (in Lakhs)": "[&1].budgetProposedForMunicipalCorporation", - "% Actual Collection over Budgeted": "[&1].actualCollectionBudgetedForMunicipalCorporation", - "Financial Year": "[&1].financialYear", - "Timestamp": "[&1].Timestamp", - "Sheet Name": "[&1].businessService" - } - } - } -] - - diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_tl_v1.json b/business-services/dashboard-ingest/src/main/resources/config/transform_tl_v1.json deleted file mode 100644 index 4f6ae47e902..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_tl_v1.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "operation": "shift", - "spec": { - "tradelicense": { - "tenantid": "tenantId", - "calculation": "tradeLicense.calculation", - "licensenumber": "tradeLicense.licenseNumber", - "commencementdate": "tradeLicense.commencementDate", - "licensetype": "tradeLicense.licenseType", - "financialyear": "tradeLicense.finYear", - "tradename": "tradeLicense.tradeName", - "applicationnumber": "tradeLicense.applicationNumber", - "accountid": "tradeLicense.accountId", - "applicationdate": "tradeLicense.applicationDate", - "oldpropertyid": "tradeLicense.oldPropertyId", - "action": "tradeLicense.action" - }, - "ward": "ward" - } - } -] - - - - - - diff --git a/business-services/dashboard-ingest/src/main/resources/config/transform_transaction_v1.json b/business-services/dashboard-ingest/src/main/resources/config/transform_transaction_v1.json deleted file mode 100644 index 0fd6b03efde..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/transform_transaction_v1.json +++ /dev/null @@ -1,29 +0,0 @@ - [ - { - "operation": "shift", - "spec": { - "rating": { - "primary": { - "value": "Rating", - "max": "RatingRange" - }, - "*": { - "max": "SecondaryRatings.&1.Range", - "value": "SecondaryRatings.&1.Value", - "$": "SecondaryRatings.&1.Id" - } - } - } - }, - { - "operation": "default", - "spec": { - "Range": 5, - "SecondaryRatings": { - "*": { - "Range": 5 - } - } - } - } - ] diff --git a/business-services/dashboard-ingest/src/main/resources/config/validator_transaction_v1.json b/business-services/dashboard-ingest/src/main/resources/config/validator_transaction_v1.json deleted file mode 100644 index e451ebda542..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/config/validator_transaction_v1.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "transaction", - "description": "Each Transaction has to go through this validation conditions", - "type": "object", - "items": { - "type": "object", - "properties": { - "rating": { - "type": "object", - "items": { - "type": "object", - "properties": { - "primary": { - "type": "object", - "properties": { - "value": { - "type": "integer", - "minimum": 1, - "maximum": 5 - } - } - } - } - } - } - } - }, - "required": [ - "rating" - ] -} \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/main/resources/data.sql b/business-services/dashboard-ingest/src/main/resources/data.sql deleted file mode 100644 index e8d22e21f82..00000000000 --- a/business-services/dashboard-ingest/src/main/resources/data.sql +++ /dev/null @@ -1,13 +0,0 @@ -/*DROP TABLE IF EXISTS targetcollection; - -CREATE TABLE targetcollection ( - Serial Number INT PRIMARY KEY, - City Name VARCHAR(250) NOT NULL, - Code VARCHAR(250) NOT NULL, - Budget Proposed(in Lakhs) VARCHAR(250) NOT NULL, - Actual Collection(in Lakhs) VARCHAR(250) NOT NULL - % Actual Collection over Budgeted VARCHAR(250) NOT NULL -); - -INSERT INTO targetcollection (Serial Number, City Name, Code, Budget Proposed(in Lakhs), Actual Collection(in Lakhs),% Actual Collection over Budgeted) VALUES - (?,?,?,?,?,?)*/ \ No newline at end of file diff --git a/business-services/dashboard-ingest/src/test/java/com/ingestpipeline/testcases/IngestTestClient.java b/business-services/dashboard-ingest/src/test/java/com/ingestpipeline/testcases/IngestTestClient.java deleted file mode 100644 index ea23eb13bad..00000000000 --- a/business-services/dashboard-ingest/src/test/java/com/ingestpipeline/testcases/IngestTestClient.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.ingestpipeline.testcases; - -import java.util.LinkedHashMap; -import java.util.List; - -import org.springframework.web.client.RestTemplate; - - -public class IngestTestClient { - - public static final String REST_SERVICE_URI = "http://localhost:8081/ingest/api"; - - /* GET */ - @SuppressWarnings("unchecked") - private static void listAllUsers(){ - System.out.println("Testing listAllUsers API-----------"); - - RestTemplate restTemplate = new RestTemplate(); - List> usersMap = restTemplate.getForObject(REST_SERVICE_URI+"/user/", List.class); - - if(usersMap!=null){ - for(LinkedHashMap map : usersMap){ - System.out.println("User : id="+map.get("id")+", Name="+map.get("name")+", Age="+map.get("age")+", Salary="+map.get("salary"));; - } - }else{ - System.out.println("No user exist----------"); - } - } - - /* DELETE */ - private static void deleteUser() { - System.out.println("Testing delete User API----------"); - RestTemplate restTemplate = new RestTemplate(); - restTemplate.delete(REST_SERVICE_URI+"/user/3"); - } - - - /* DELETE */ - private static void deleteAllUsers() { - System.out.println("Testing all delete Users API----------"); - RestTemplate restTemplate = new RestTemplate(); - restTemplate.delete(REST_SERVICE_URI+"/user/"); - } - - public static void main(String args[]){ - listAllUsers(); - listAllUsers(); - listAllUsers(); - //deleteUser(); - listAllUsers(); - //deleteAllUsers(); - listAllUsers(); - } -} \ No newline at end of file diff --git a/business-services/egf-instrument/.gitignore b/business-services/egf-instrument/.gitignore deleted file mode 100644 index 2af7cefb0a3..00000000000 --- a/business-services/egf-instrument/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -target/ -!.mvn/wrapper/maven-wrapper.jar - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -nbproject/private/ -build/ -nbbuild/ -dist/ -nbdist/ -.nb-gradle/ \ No newline at end of file diff --git a/business-services/egf-instrument/CHANGELOG.md b/business-services/egf-instrument/CHANGELOG.md deleted file mode 100644 index e65dff858e3..00000000000 --- a/business-services/egf-instrument/CHANGELOG.md +++ /dev/null @@ -1,22 +0,0 @@ -# Changelog -All notable changes to this module will be documented in this file. -## 1.1.4 - 2023-02-02 - -- Transition from 1.1.4-beta version to 1.1.4 version - -## 1.1.4-beta - 2022-01-13 -- Updated to log4j2 version 2.17.1 - -## 1.1.2 - 2021-02-26 -- Updated domain name in application.properties - -## 1.1.1 - 2020-10-09 -- Ignore and start server even Kafka topic is missing - -## 1.1.0 - 2020-06-22 -- Upgraded to `tracer:2.0.0-SNAPSHOT` -- Upgraded to `Spring boot 2.2.6` - -## 1.0.0 - -- Base version diff --git a/business-services/egf-instrument/LOCALSETUP.md b/business-services/egf-instrument/LOCALSETUP.md deleted file mode 100644 index 7b3b45f5d46..00000000000 --- a/business-services/egf-instrument/LOCALSETUP.md +++ /dev/null @@ -1,30 +0,0 @@ -# Local Setup - -To setup the egf-instrument service in your local system, clone the [Business services repository](https://github.com/egovernments/business-services). - -## Dependencies - - -### Infra Dependency - -- [X] Postgres DB -- [ ] Redis -- [ ] Elasticsearch -- [X] Kafka - - [X] Consumer - - [X] Producer - -## Running Locally - -To run the egf-instrument service locally, you need to port forward below services. - -```bash -function kgpt(){kubectl get pods -n egov --selector=app=$1 --no-headers=true | head -n1 | awk '{print $1}'} -kubectl port-forward -n egov $(kgpt egf-master) 8081:8080 -``` - -Update below listed properties in `application.properties` before running the project: - -```ini -egov.services.egfmaster.hostname = http://127.0.0.1:8081 -``` diff --git a/business-services/egf-instrument/README.md b/business-services/egf-instrument/README.md deleted file mode 100644 index dce2bee2e12..00000000000 --- a/business-services/egf-instrument/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# egf-instrument service - -egf-instrument service used to create, search, update and delete instruments. - -### DB UML Diagram - -NA - -### Service Dependencies - -- egf-master - -### Swagger API Contract - -NA - -## Service Details - -egf-instrument service used to create, search, update and delete instruments. - -### API Details - -`/instruments/_create` : API to create instrument -`/instruments/_update` : API to update instrument -`/instruments/_delete` : API to delete instrument -`/instruments/_search` : API to search instrument - -### Kafka Consumers - -kafka.topics.egf.instrument.validated.topic : egov.egf.instrument.validated.topic - Kafka Consumer listens to this topic and create/update/delete instrument and publish and event to kafka - -### Kafka Producers - -kafka.topics.egf.instrument.completed.topic=egov.egf.instrument.completed - Kafka Producer publishes an event to this topic with the instrument information diff --git a/business-services/egf-instrument/mvnw b/business-services/egf-instrument/mvnw deleted file mode 100644 index 5bf251c0774..00000000000 --- a/business-services/egf-instrument/mvnw +++ /dev/null @@ -1,225 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -echo $MAVEN_PROJECTBASEDIR -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/business-services/egf-instrument/mvnw.cmd b/business-services/egf-instrument/mvnw.cmd deleted file mode 100644 index 019bd74d766..00000000000 --- a/business-services/egf-instrument/mvnw.cmd +++ /dev/null @@ -1,143 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" - -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/business-services/egf-instrument/pom.xml b/business-services/egf-instrument/pom.xml deleted file mode 100644 index c8a3944596f..00000000000 --- a/business-services/egf-instrument/pom.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.2.6.RELEASE - - org.egov - egf-instrument - 1.1.4-SNAPSHOT - egf-instrument - egf instrument service for egov services - - 2.17.1 - UTF-8 - 1.8 - UTF-8 - 1.18.8 - - - - org.flywaydb - flyway-core - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework.kafka - spring-kafka - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework - spring-beans - 5.2.20.RELEASE - - - org.postgresql - postgresql - runtime - - - org.projectlombok - lombok - true - - - org.elasticsearch.client - transport - - - - org.elasticsearch - elasticsearch - - - - org.apache.logging.log4j - log4j-to-slf4j - 2.8.2 - - - org.apache.commons - commons-lang3 - 3.0 - - - commons-io - commons-io - 2.5 - - - org.egov.services - tracer - 2.0.0-SNAPSHOT - - - org.egov.services - services-common - 0.11.1 - - - org.egov - egf-master - 0.0.1 - common - - - org.egov - egf-master - 0.0.1 - client - - - org.springframework.boot - spring-boot-starter-test - test - - - - - repo.egovernments.org - eGov ERP Releases Repository - https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.projectlombok - lombok - - - org.springframework.boot - spring-boot-devtools - - - - - - - org.jacoco - jacoco-maven-plugin - 0.7.9 - - - default-prepare-agent - - prepare-agent - - - - default-report - prepare-package - - report - - - - default-check - - check - - - - - CLASS - - org.egov.EgfInstrumentApplication - org.egov.egf.instrument.persistence.queue.* - org.egov.egf.instrument.web.advice.CustomControllerAdvice - org.egov.egf.instrument.web.contract.* - org.egov.egf.instrument.persistence.entity.* - org.egov.egf.instrument.domain.model.* - org.egov.egf.instrument.web.requests.* - org.egov.egf.instrument.domain.repository.InstrumentTypeESRepository - org.egov.egf.instrument.domain.repository.InstrumentAccountCodeESRepository - org.egov.egf.instrument.domain.repository.InstrumentESRepository - org.egov.egf.instrument.domain.repository.SurrenderReasonESRepository - org.egov.egf.instrument.domain.repository.ElasticSearchQueryFactory - org.egov.egf.instrument.domain.repository.ElasticSearchUtils - org.egov.egf.instrument.persistence.repository.InstrumentJdbcRepository - org.egov.egf.instrument.web.mapper.InstrumentTypeMapper: - - - - LINE - COVEREDRATIO - 0.05 - - - - - BUNDLE - - - COMPLEXITY - COVEREDRATIO - 0.05 - - - - - - - - - - - diff --git a/business-services/egf-instrument/src/main/java/org/egov/EgfInstrumentApplication.java b/business-services/egf-instrument/src/main/java/org/egov/EgfInstrumentApplication.java deleted file mode 100644 index e5260fd0ccf..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/EgfInstrumentApplication.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.egov; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.egov.tracer.config.TracerConfiguration; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.transport.client.PreBuiltTransportClient; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import javax.annotation.PostConstruct; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.text.SimpleDateFormat; -import java.util.TimeZone; - -@Import({ TracerConfiguration.class }) -@SpringBootApplication -public class EgfInstrumentApplication { - - public static void main(String[] args) { - SpringApplication.run(EgfInstrumentApplication.class, args); - } - - private static final String CLUSTER_NAME = "cluster.name"; - - @Value("${app.timezone}") - private String timeZone; - - @Value("${es.host}") - private String elasticSearchHost; - - @Value("${es.transport.port}") - private Integer elasticSearchTransportPort; - - @Value("${es.cluster.name}") - private String elasticSearchClusterName; - - private TransportClient client; - - @PostConstruct - public void init() throws UnknownHostException { - TimeZone.setDefault(TimeZone.getTimeZone(timeZone)); - Settings settings = Settings.builder().put(CLUSTER_NAME, elasticSearchClusterName).build(); - final InetAddress esAddress = InetAddress.getByName(elasticSearchHost); - final TransportAddress transportAddress = new TransportAddress(esAddress, elasticSearchTransportPort); - client = new PreBuiltTransportClient(settings).addTransportAddress(transportAddress); - } - - @Bean - public MappingJackson2HttpMessageConverter jacksonConverter() { - MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - // mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, - // false); - mapper.setDateFormat(new SimpleDateFormat("dd-MM-yyyy")); - mapper.setTimeZone(TimeZone.getTimeZone(timeZone)); - converter.setObjectMapper(mapper); - return converter; - } - - @Bean - public WebMvcConfigurerAdapter webMvcConfigurerAdapter() { - return new WebMvcConfigurerAdapter() { - - @Override - public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { - configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8); - } - - }; - } - - @Bean - public TransportClient getTransportClient() { - return client; - } - - @Bean - public RestTemplate restTemplate() { - return new RestTemplate(); - } - - @Bean - public FlywayMigrationStrategy cleanMigrateStrategy() { - return flyway -> { - flyway.repair(); - flyway.migrate(); - }; - } -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/DishonorReason.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/DishonorReason.java deleted file mode 100644 index c96ccf4fb83..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/DishonorReason.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.NotBlank; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class DishonorReason extends Auditable { - /** - * id is the unique Identifier of the reason - */ - private String id; - /** - * name is the reason of instrument surrender. Example "Damaged cheque", "Cheque to be scrapped" etc - */ - @NotBlank - @Size(max = 50, min = 5) - private String reason; - /** - * description is detailed description of the surrender of a instrument - */ - @NotBlank - @Size(max = 250) - private String remarks; - private String instrument; - private String reversalVoucherId; - private Long dishonorDate; - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/DishonorReasonSearch.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/DishonorReasonSearch.java deleted file mode 100644 index 95d750351d1..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/DishonorReasonSearch.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class DishonorReasonSearch extends DishonorReason { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/ECSType.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/ECSType.java deleted file mode 100644 index 7d51f5509d8..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/ECSType.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.instrument.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class ECSType { - - /* - * id is the unique reference to ECS type entered in the system. - */ - private String id; - - /* - * type will give you name of the ECSType of ECS receipt made. Ex - ICICI, ONLINE, etc,. - */ - private String type; - - /* - * active specifies whether the type is active for transacting. - */ - - private String active; - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/Instrument.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/Instrument.java deleted file mode 100644 index d6fb95429bc..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/Instrument.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.domain.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.hibernate.validator.constraints.NotBlank; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class Instrument extends Auditable { - - /* - * id is the unique reference to Instrument Header entered in the system. - */ - private String id; - - /* - * transactionNumber unique number of the instrument. For cheque type this is cheque date. For DD type it is DD number - */ - @NotBlank - @Size(max = 50) - private String transactionNumber; - - /* - * transactionDate is the date of instrument . For cheque type it is cheque date. for DD it is DD date - */ - @NotNull - private Date transactionDate; - - /* - * amount is the instrument amount. For cheque type it is cheque amount. - */ - @NotNull - @Min(value = 1) - @Max(value = 999999999) - private BigDecimal amount; - - /* - * instrumentType specifies the type of the instrument - The folowing are the different types Cash,Cheque,DD,POC - */ - @NotNull - private InstrumentType instrumentType; - - /* - * bank references to the bank from which the payment/Receipt is made. - */ - private BankContract bank; - - /* - * branchName is the branch name entered in the collection Receipt. - */ - - @Size(max = 50) - private String branchName; - - /* - * bankAccount is the reference of the Bank account from which the payment instrument is assigned - */ - private BankAccountContract bankAccount; - - /* - * instrumentStatus gives the current status of the instrument. - */ - private FinancialStatusContract financialStatus; - - private String remittanceVoucherId; - - /* - * transactionType are of two kinds -Debit and Credit. When its a receipt instrument it is Debit and in case of payment - * instrument its credit. - */ - @NotNull - private TransactionType transactionType; - - /* - * payee is the entity who is making the payment via instrument - */ - @Size(max = 50) - private String payee; - - /* - * drawer is the entity to which the payment is made. - */ - @Size(max = 100) - private String drawer; - - /* - * surrendarReason is the reason from the defined list seleted while surrendering a payment cheque. Depending on the reason, - * the cheque can be re-used or not is decided. - */ - private SurrenderReason surrenderReason; - - private DishonorReason dishonorReason; - /* - * serialNo is the series of the cheque numbers from which the instrument is assigned from. The cheque numbers in an account - * is defined based on Year, Bank account and tagged to a department. - */ - // @NotBlank - @Size(max = 50, min = 2) - private String serialNo; - - @Size(max = 256) - private String payinSlipId; - - @Min(value = 1) - @Max(value = 999999999) - private BigDecimal reconciledAmount; - - private Date reconciledOn; - - /* - * instrumentVouchers is the reference to the payment vouchers for which the instrument is attached. - */ - // @DrillDownTable - private List instrumentVouchers = new ArrayList<>(); - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentAccountCode.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentAccountCode.java deleted file mode 100644 index 1020289fbca..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentAccountCode.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.domain.model; - -import org.egov.common.domain.model.Auditable; -import org.egov.egf.master.web.contract.ChartOfAccountContract; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "instrumentType" }, callSuper = false) -public class InstrumentAccountCode extends Auditable { - - /* - * id is the unique reference to Instrument AccountCodes entered in the system. - */ - private String id; - - /* - * instrumentType specifies the mode/type of transaction that can be made - i.e Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS - */ - private InstrumentType instrumentType; - - /* - * accountCode is the COA that is tagged to a instrument type used in ledger posting. - */ - private ChartOfAccountContract accountCode; - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentAccountCodeSearch.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentAccountCodeSearch.java deleted file mode 100644 index 9cfce0325cc..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentAccountCodeSearch.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentAccountCodeSearch extends InstrumentAccountCode { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentSearch.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentSearch.java deleted file mode 100644 index 8e0b611b99b..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentSearch.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentSearch extends Instrument { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String instrumentTypes; - private String financialStatuses; - private Date transactionFromDate; - private Date transactionToDate; - private String receiptIds; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentType.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentType.java deleted file mode 100644 index cbd805def54..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentType.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.domain.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.NotBlank; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class InstrumentType extends Auditable { - - /* - * id is the unique reference to instrument type entered in the system. - */ - private String id; - - /* - * type specifies the mode/type of transaction that can be made - i.e Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS - */ - @NotNull - @NotBlank - @Size(max = 50, min = 2) - private String name; - - /* - * description specifies details of the instrument type . For example type DD description may be Demand Draft - */ - - @Size(max = 100) - private String description; - - /* - * active specifies whether the type is active for transacting. - */ - @NotNull - private Boolean active; - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentTypeProperty.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentTypeProperty.java deleted file mode 100644 index ea68c221552..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentTypeProperty.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.egov.egf.master.web.contract.FinancialStatusContract; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class InstrumentTypeProperty extends Auditable { - - private String id; - @NotNull - private TransactionType transactionType; - @NotNull - private Boolean reconciledOncreate; - @NotNull - private FinancialStatusContract statusOnCreate; - @NotNull - private FinancialStatusContract statusOnUpdate; - @NotNull - private FinancialStatusContract statusOnReconcile; - @NotNull - private InstrumentType instrumentType; - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentTypeSearch.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentTypeSearch.java deleted file mode 100644 index 83f27e118ee..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentTypeSearch.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class InstrumentTypeSearch extends InstrumentType { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentVoucher.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentVoucher.java deleted file mode 100644 index e9beec9fc70..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentVoucher.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.domain.model; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class InstrumentVoucher extends Auditable { - - /* - * instrumentHeaderId is the reference of the instrument attached to a voucher - */ - private Instrument instrument; - - /* - * voucherHeaderId is the reference of the voucher attached to a instrument. - */ - private String voucherHeaderId; - - /* - * receiptHeaderId is the reference of the receipt attached to a instrument. - */ - private String receiptHeaderId; - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentVoucherSearch.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentVoucherSearch.java deleted file mode 100644 index 80bae2bd0b4..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/InstrumentVoucherSearch.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentVoucherSearch extends InstrumentVoucher { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String instruments; - private String receiptIds; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/SurrenderReason.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/SurrenderReason.java deleted file mode 100644 index 27a53c7ae04..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/SurrenderReason.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.NotBlank; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class SurrenderReason extends Auditable { - /** - * id is the unique Identifier of the reason - */ - private String id; - /** - * name is the reason of instrument surrender. Example "Damaged cheque", "Cheque to be scrapped" etc - */ - @NotBlank - @Size(max = 50, min = 5) - private String name; - /** - * description is detailed description of the surrender of a instrument - */ - @NotBlank - @Size(max = 250) - private String description; - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/SurrenderReasonSearch.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/SurrenderReasonSearch.java deleted file mode 100644 index dd50c41f510..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/SurrenderReasonSearch.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SurrenderReasonSearch extends SurrenderReason { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/TransactionType.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/TransactionType.java deleted file mode 100644 index c4624899348..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/model/TransactionType.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.egov.egf.instrument.domain.model; - -public enum TransactionType { - Debit, Credit - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/DishonorReasonRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/DishonorReasonRepository.java deleted file mode 100644 index 7814a70b94f..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/DishonorReasonRepository.java +++ /dev/null @@ -1,223 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.DishonorReason; -import org.egov.egf.instrument.domain.model.DishonorReasonSearch; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.persistence.entity.DishonorReasonEntity; -import org.egov.egf.instrument.persistence.entity.SurrenderReasonEntity; -import org.egov.egf.instrument.persistence.queue.repository.SurrenderReasonQueueRepository; -import org.egov.egf.instrument.persistence.repository.DishonorReasonJdbcRepository; -import org.egov.egf.instrument.persistence.repository.SurrenderReasonJdbcRepository; -import org.egov.egf.instrument.web.contract.DishonorReasonSearchContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonSearchContract; -import org.egov.egf.instrument.web.mapper.DishonorReasonMapper; -import org.egov.egf.instrument.web.mapper.SurrenderReasonMapper; -import org.egov.egf.instrument.web.requests.DishonorReasonRequest; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class DishonorReasonRepository { - - private DishonorReasonJdbcRepository dishonorReasonJdbcRepository; - -// private SurrenderReasonQueueRepository surrenderReasonQueueRepository; - - private String persistThroughKafka; - - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - private SurrenderReasonESRepository surrenderReasonESRepository; - - @Autowired - public DishonorReasonRepository(DishonorReasonJdbcRepository dishonorReasonJdbcRepository, - @Value("${persist.through.kafka}") String persistThroughKafka, - FinancialConfigurationContractRepository financialConfigurationContractRepository, - SurrenderReasonESRepository surrenderReasonESRepository) { - this.dishonorReasonJdbcRepository = dishonorReasonJdbcRepository; -// this.surrenderReasonQueueRepository = surrenderReasonQueueRepository; - this.persistThroughKafka = persistThroughKafka; - this.financialConfigurationContractRepository = financialConfigurationContractRepository; - this.surrenderReasonESRepository = surrenderReasonESRepository; - - } - - public DishonorReason findById(DishonorReason dishonorReason) { - DishonorReasonEntity entity = dishonorReasonJdbcRepository - .findById(new DishonorReasonEntity().toEntity(dishonorReason)); - if (entity != null) - return entity.toDomain(); - - return null; - - } - - @Transactional - public List save(List dishonorReasons, RequestInfo requestInfo) { - - DishonorReasonMapper mapper = new DishonorReasonMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - DishonorReasonRequest request = new DishonorReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (DishonorReason iac : dishonorReasons) - request.getSurrenderReasons().add(mapper.toContract(iac)); - -// surrenderReasonQueueRepository.addToQue(request); - - return dishonorReasons; - } else { - - List resultList = new ArrayList(); - - for (DishonorReason iac : dishonorReasons) - resultList.add(save(iac)); - - DishonorReasonRequest request = new DishonorReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - -// for (SurrenderReason iac : resultList) -// request.getSurrenderReasons().add(mapper.toContract(iac)); -// -// dishonorReasonQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List update(List dishonorReasons, RequestInfo requestInfo) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); -// request.setdishonorReasons(new ArrayList<>()); - - for (SurrenderReason iac : dishonorReasons) - request.getSurrenderReasons().add(mapper.toContract(iac)); - -// dishonorReasonQueueRepository.addToQue(request); - - return dishonorReasons; - } else { - - List resultList = new ArrayList(); - -// for (SurrenderReason iac : dishonorReasons) -// resultList.add(update(iac)); - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : resultList) - request.getSurrenderReasons().add(mapper.toContract(iac)); - -// surrenderReasonQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List delete(List surrenderReasons, RequestInfo requestInfo) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : surrenderReasons) - request.getSurrenderReasons().add(mapper.toContract(iac)); - -// surrenderReasonQueueRepository.addToQue(request); - - return surrenderReasons; - } else { - - List resultList = new ArrayList(); - -// for (SurrenderReason iac : surrenderReasons) -// resultList.add(delete(iac)); - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : resultList) - request.getSurrenderReasons().add(mapper.toContract(iac)); - -// surrenderReasonQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public DishonorReason save(DishonorReason dishonorReason) { - DishonorReasonEntity entity = dishonorReasonJdbcRepository - .create(new DishonorReasonEntity().toEntity(dishonorReason)); - return entity.toDomain(); - } - - @Transactional - public DishonorReason update(DishonorReason dishonorReason) { - DishonorReasonEntity entity = dishonorReasonJdbcRepository - .update(new DishonorReasonEntity().toEntity(dishonorReason)); - return entity.toDomain(); - } - - @Transactional - public DishonorReason delete(DishonorReason surrenderReason) { - DishonorReasonEntity entity = dishonorReasonJdbcRepository - .delete(new DishonorReasonEntity().toEntity(surrenderReason)); - return entity.toDomain(); - } - - public Pagination search(DishonorReasonSearch domain) { - -// if (financialConfigurationContractRepository.fetchDataFrom() != null -// && financialConfigurationContractRepository.fetchDataFrom().equalsIgnoreCase("es")) { -// -// DishonorReasonMapper mapper = new DishonorReasonMapper(); -// DishonorReasonSearchContract dishonorReasonSearchContract = new DishonorReasonSearchContract(); -// dishonorReasonSearchContract = mapper.toSearchContract(domain); -// -// return surrenderReasonESRepository.search(dishonorReasonSearchContract); -// -// } else - return dishonorReasonJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, DishonorReason dishonorReason) { - return dishonorReasonJdbcRepository.uniqueCheck(fieldName, new DishonorReasonEntity().toEntity(dishonorReason)); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/ElasticSearchQueryFactory.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/ElasticSearchQueryFactory.java deleted file mode 100644 index a63a6104b20..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/ElasticSearchQueryFactory.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import static org.elasticsearch.index.query.QueryBuilders.boolQuery; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.egov.common.util.ElasticSearchUtils; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeSearchContract; -import org.egov.egf.instrument.web.contract.InstrumentSearchContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeSearchContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonSearchContract; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ElasticSearchQueryFactory { - - @Autowired - private ElasticSearchUtils elasticSearchUtils; - - public BoolQueryBuilder searchInstrument(InstrumentSearchContract instrumentSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (instrumentSearchContract.getIds() != null && !instrumentSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(instrumentSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getTransactionNumber(), "transactionNumber", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getTransactionDate(), "transactionDate", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getAmount(), "amount", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getInstrumentType(), "instrumentType", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getBank(), "bank", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getBranchName(), "branchName", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getBankAccount(), "bankAccount", boolQueryBuilder); - - elasticSearchUtils.add(instrumentSearchContract.getFinancialStatus(), "financialStatus", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getTransactionType(), "transactionType", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getPayee(), "payee", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getDrawer(), "drawer", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getSurrenderReason(), "surrenderReason", boolQueryBuilder); - elasticSearchUtils.add(instrumentSearchContract.getSerialNo(), "serialNo", boolQueryBuilder); - if (!instrumentSearchContract.getInstrumentVouchers().isEmpty()) - elasticSearchUtils.add(instrumentSearchContract.getInstrumentVouchers(), "instrumentVouchers", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchInstrumentType(InstrumentTypeSearchContract instrumentTypeSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (instrumentTypeSearchContract.getIds() != null && !instrumentTypeSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(instrumentTypeSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(instrumentTypeSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(instrumentTypeSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(instrumentTypeSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(instrumentTypeSearchContract.getActive(), "active", boolQueryBuilder); - // elasticSearchUtils.add(instrumentTypeSearchContract.getInstrumentTypeProperties(), "instrumentTypeProperties", - // boolQueryBuilder); - return boolQueryBuilder; - } - - public BoolQueryBuilder searchInstrumentAccountCode(InstrumentAccountCodeSearchContract instrumentAccountCodeSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (instrumentAccountCodeSearchContract.getIds() != null && !instrumentAccountCodeSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(instrumentAccountCodeSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(instrumentAccountCodeSearchContract.getInstrumentType(), "instrumentType", boolQueryBuilder); - elasticSearchUtils.add(instrumentAccountCodeSearchContract.getAccountCode(), "accountCode", boolQueryBuilder); - return boolQueryBuilder; - } - - public BoolQueryBuilder searchSurrenderReason(SurrenderReasonSearchContract surrenderReasonSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (surrenderReasonSearchContract.getIds() != null && !surrenderReasonSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(surrenderReasonSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(surrenderReasonSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(surrenderReasonSearchContract.getDescription(), "description", boolQueryBuilder); - return boolQueryBuilder; - } - - public List prepareOrderBys(String sortBy) { - List orderByList = new ArrayList(); - List sortByList = new ArrayList(); - if (sortBy.contains(",")) - sortByList = Arrays.asList(sortBy.split(",")); - else - sortByList = Arrays.asList(sortBy); - for (String s : sortByList) - if (s.contains(" ") && (s.toLowerCase().trim().endsWith("asc") || s.toLowerCase().trim().endsWith("desc"))) - orderByList.add(s.trim()); - else - orderByList.add(s.trim() + " asc"); - - return orderByList; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeESRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeESRepository.java deleted file mode 100644 index ac7f614a4ce..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeESRepository.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.persistence.entity.InstrumentAccountCodeEntity; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class InstrumentAccountCodeESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger logger = LoggerFactory.getLogger(InstrumentAccountCodeESRepository.class); - - public InstrumentAccountCodeESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(InstrumentAccountCodeSearchContract instrumentAccountCodeSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(instrumentAccountCodeSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToInstrumentAccountCodeList(searchResponse); - } - - @SuppressWarnings("deprecation") - private Pagination mapToInstrumentAccountCodeList(SearchResponse searchResponse) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) - return page; - List instrumentAccountCodes = new ArrayList(); - InstrumentAccountCode instrumentAccountCode = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - instrumentAccountCode = mapper.readValue(hit.getSourceAsString(), InstrumentAccountCode.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - logger.error("Error occurred while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - logger.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - logger.error("IO exception occured: " + e1.getMessage()); - } - - instrumentAccountCodes.add(instrumentAccountCode); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(instrumentAccountCodes); - - return page; - } - - private SearchRequestBuilder getSearchRequest(InstrumentAccountCodeSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), InstrumentAccountCodeEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchInstrumentAccountCode(criteria); - SearchRequestBuilder searchRequestBuilder = esClient - .prepareSearch(InstrumentAccountCode.class.getSimpleName().toLowerCase()) - .setTypes(InstrumentAccountCode.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) - for (String orderBy : orderByList) - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeRepository.java deleted file mode 100644 index f90ebbc6957..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeRepository.java +++ /dev/null @@ -1,221 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentAccountCodeEntity; -import org.egov.egf.instrument.persistence.queue.repository.InstrumentAccountCodeQueueRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentAccountCodeJdbcRepository; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeSearchContract; -import org.egov.egf.instrument.web.mapper.InstrumentAccountCodeMapper; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class InstrumentAccountCodeRepository { - - private InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository; - - private InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository; - - private String persistThroughKafka; - - private InstrumentAccountCodeESRepository instrumentAccountCodeESRepository; - - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - @Autowired - public InstrumentAccountCodeRepository(InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository, - InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository, - @Value("${persist.through.kafka}") String persistThroughKafka, - InstrumentAccountCodeESRepository instrumentAccountCodeESRepository, - FinancialConfigurationContractRepository financialConfigurationContractRepository) { - this.instrumentAccountCodeJdbcRepository = instrumentAccountCodeJdbcRepository; - this.instrumentAccountCodeQueueRepository = instrumentAccountCodeQueueRepository; - this.persistThroughKafka = persistThroughKafka; - this.financialConfigurationContractRepository = financialConfigurationContractRepository; - this.instrumentAccountCodeESRepository = instrumentAccountCodeESRepository; - - } - - public InstrumentAccountCode findById(InstrumentAccountCode instrumentAccountCode) { - InstrumentAccountCodeEntity entity = instrumentAccountCodeJdbcRepository - .findById(new InstrumentAccountCodeEntity().toEntity(instrumentAccountCode)); - if (entity != null) - return entity.toDomain(); - - return null; - - } - - @Transactional - public List save(List instrumentAccountCodes, - RequestInfo requestInfo) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentAccountCodes(new ArrayList<>()); - - for (InstrumentAccountCode iac : instrumentAccountCodes) - request.getInstrumentAccountCodes().add(mapper.toContract(iac)); - - instrumentAccountCodeQueueRepository.addToQue(request); - - return instrumentAccountCodes; - } else { - - List resultList = new ArrayList(); - - for (InstrumentAccountCode iac : instrumentAccountCodes) - resultList.add(save(iac)); - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentAccountCodes(new ArrayList<>()); - - for (InstrumentAccountCode iac : resultList) - request.getInstrumentAccountCodes().add(mapper.toContract(iac)); - - instrumentAccountCodeQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List update(List instrumentAccountCodes, - RequestInfo requestInfo) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentAccountCodes(new ArrayList<>()); - - for (InstrumentAccountCode iac : instrumentAccountCodes) - request.getInstrumentAccountCodes().add(mapper.toContract(iac)); - - instrumentAccountCodeQueueRepository.addToQue(request); - - return instrumentAccountCodes; - } else { - - List resultList = new ArrayList(); - - for (InstrumentAccountCode iac : instrumentAccountCodes) - resultList.add(update(iac)); - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentAccountCodes(new ArrayList<>()); - - for (InstrumentAccountCode iac : resultList) - request.getInstrumentAccountCodes().add(mapper.toContract(iac)); - - instrumentAccountCodeQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List delete(List instrumentAccountCodes, - RequestInfo requestInfo) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentAccountCodes(new ArrayList<>()); - - for (InstrumentAccountCode iac : instrumentAccountCodes) - request.getInstrumentAccountCodes().add(mapper.toContract(iac)); - - instrumentAccountCodeQueueRepository.addToQue(request); - - return instrumentAccountCodes; - } else { - - List resultList = new ArrayList(); - - for (InstrumentAccountCode iac : instrumentAccountCodes) - resultList.add(delete(iac)); - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentAccountCodes(new ArrayList<>()); - - for (InstrumentAccountCode iac : resultList) - request.getInstrumentAccountCodes().add(mapper.toContract(iac)); - - instrumentAccountCodeQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public InstrumentAccountCode save(InstrumentAccountCode instrumentAccountCode) { - InstrumentAccountCodeEntity entity = instrumentAccountCodeJdbcRepository - .create(new InstrumentAccountCodeEntity().toEntity(instrumentAccountCode)); - return entity.toDomain(); - } - - @Transactional - public InstrumentAccountCode update(InstrumentAccountCode instrumentAccountCode) { - InstrumentAccountCodeEntity entity = instrumentAccountCodeJdbcRepository - .update(new InstrumentAccountCodeEntity().toEntity(instrumentAccountCode)); - return entity.toDomain(); - } - - @Transactional - public InstrumentAccountCode delete(InstrumentAccountCode instrumentAccountCode) { - InstrumentAccountCodeEntity entity = instrumentAccountCodeJdbcRepository - .delete(new InstrumentAccountCodeEntity().toEntity(instrumentAccountCode)); - return entity.toDomain(); - } - - public Pagination search(InstrumentAccountCodeSearch domain) { - - if (financialConfigurationContractRepository.fetchDataFrom() != null - && financialConfigurationContractRepository.fetchDataFrom().equalsIgnoreCase("es")) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - InstrumentAccountCodeSearchContract instrumentAccountCodeSearchContract = new InstrumentAccountCodeSearchContract(); - instrumentAccountCodeSearchContract = mapper.toSearchContract(domain); - - return instrumentAccountCodeESRepository.search(instrumentAccountCodeSearchContract); - - } else - return instrumentAccountCodeJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, InstrumentAccountCode instrumentAccountCode) { - return instrumentAccountCodeJdbcRepository.uniqueCheck(fieldName, - new InstrumentAccountCodeEntity().toEntity(instrumentAccountCode)); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentESRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentESRepository.java deleted file mode 100644 index 1776f4b0af6..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentESRepository.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.persistence.entity.InstrumentEntity; -import org.egov.egf.instrument.web.contract.InstrumentSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class InstrumentESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger logger = LoggerFactory.getLogger(InstrumentESRepository.class); - - public InstrumentESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(InstrumentSearchContract instrumentSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(instrumentSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToInstrumentList(searchResponse); - } - - @SuppressWarnings("deprecation") - protected Pagination mapToInstrumentList(SearchResponse searchResponse) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) - return page; - List instruments = new ArrayList(); - Instrument instrument = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - instrument = mapper.readValue(hit.getSourceAsString(), Instrument.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - logger.error("Error occurred while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - logger.error("JSON Mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - logger.error("IO Exception occurred: " + e1.getMessage()); - } - - instruments.add(instrument); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(instruments); - - return page; - } - - protected SearchRequestBuilder getSearchRequest(InstrumentSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), InstrumentEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchInstrument(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Instrument.class.getSimpleName().toLowerCase()) - .setTypes(Instrument.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) - for (String orderBy : orderByList) - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentRepository.java deleted file mode 100644 index 979d4d257ab..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentRepository.java +++ /dev/null @@ -1,239 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.persistence.entity.DishonorReasonEntity; -import org.egov.egf.instrument.persistence.entity.InstrumentEntity; -import org.egov.egf.instrument.persistence.entity.InstrumentVoucherEntity; -import org.egov.egf.instrument.persistence.queue.repository.InstrumentQueueRepository; -import org.egov.egf.instrument.persistence.repository.DishonorReasonJdbcRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentJdbcRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentVoucherJdbcRepository; -import org.egov.egf.instrument.web.contract.InstrumentSearchContract; -import org.egov.egf.instrument.web.mapper.InstrumentMapper; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class InstrumentRepository { - - private InstrumentJdbcRepository instrumentJdbcRepository; - - private InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository; - - private InstrumentQueueRepository instrumentQueueRepository; - - private String persistThroughKafka; - - private InstrumentESRepository instrumentESRepository; - - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - private DishonorReasonJdbcRepository dishonorReasonJdbcRepository; - - @Autowired - public InstrumentRepository(InstrumentJdbcRepository instrumentJdbcRepository, - InstrumentQueueRepository instrumentQueueRepository, - @Value("${persist.through.kafka}") String persistThroughKafka, - InstrumentESRepository instrumentESRepository, - FinancialConfigurationContractRepository financialConfigurationContractRepository, - InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository, - DishonorReasonJdbcRepository dishonorReasonJdbcRepository) { - this.instrumentJdbcRepository = instrumentJdbcRepository; - this.instrumentQueueRepository = instrumentQueueRepository; - this.persistThroughKafka = persistThroughKafka; - this.instrumentESRepository = instrumentESRepository; - this.financialConfigurationContractRepository = financialConfigurationContractRepository; - this.instrumentVoucherJdbcRepository = instrumentVoucherJdbcRepository; - this.dishonorReasonJdbcRepository = dishonorReasonJdbcRepository; - - } - - public Instrument findById(Instrument instrument) { - InstrumentEntity entity = instrumentJdbcRepository.findById(new InstrumentEntity().toEntity(instrument)); - if (entity != null) - return entity.toDomain(); - - return null; - - } - - @Transactional - public List save(List instruments, RequestInfo requestInfo) { - - InstrumentMapper mapper = new InstrumentMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentRequest request = new InstrumentRequest(); - request.setRequestInfo(requestInfo); - request.setInstruments(new ArrayList<>()); - - for (Instrument iac : instruments) - request.getInstruments().add(mapper.toContract(iac)); - - instrumentQueueRepository.addToQue(request); - - return instruments; - } else { - - List resultList = new ArrayList(); - - for (Instrument iac : instruments) - resultList.add(save(iac)); - - InstrumentRequest request = new InstrumentRequest(); - request.setRequestInfo(requestInfo); - request.setInstruments(new ArrayList<>()); - - for (Instrument iac : resultList) - request.getInstruments().add(mapper.toContract(iac)); - - instrumentQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List update(List instruments, RequestInfo requestInfo) { - - InstrumentMapper mapper = new InstrumentMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentRequest request = new InstrumentRequest(); - request.setRequestInfo(requestInfo); - request.setInstruments(new ArrayList<>()); - - for (Instrument iac : instruments) - request.getInstruments().add(mapper.toContract(iac)); - - instrumentQueueRepository.addToQue(request); - - return instruments; - } else { - - List resultList = new ArrayList(); - - for (Instrument iac : instruments) - resultList.add(update(iac)); - - InstrumentRequest request = new InstrumentRequest(); - request.setRequestInfo(requestInfo); - request.setInstruments(new ArrayList<>()); - - for (Instrument iac : resultList) - request.getInstruments().add(mapper.toContract(iac)); - - instrumentQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List delete(List instruments, RequestInfo requestInfo) { - - InstrumentMapper mapper = new InstrumentMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentRequest request = new InstrumentRequest(); - request.setRequestInfo(requestInfo); - request.setInstruments(new ArrayList<>()); - - for (Instrument iac : instruments) - request.getInstruments().add(mapper.toContract(iac)); - - instrumentQueueRepository.addToQue(request); - - return instruments; - } else { - - List resultList = new ArrayList(); - - for (Instrument iac : instruments) - resultList.add(delete(iac)); - - InstrumentRequest request = new InstrumentRequest(); - request.setRequestInfo(requestInfo); - request.setInstruments(new ArrayList<>()); - - for (Instrument iac : resultList) - request.getInstruments().add(mapper.toContract(iac)); - - instrumentQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public Instrument save(Instrument instrument) { - InstrumentEntity entity = instrumentJdbcRepository.create(new InstrumentEntity().toEntity(instrument)); - if (instrument.getInstrumentVouchers() != null) - for (InstrumentVoucher iv : instrument.getInstrumentVouchers()) - instrumentVoucherJdbcRepository.create(new InstrumentVoucherEntity().toEntity(iv)); - if (instrument.getDishonorReason() != null) - dishonorReasonJdbcRepository.create(new DishonorReasonEntity().toEntity(instrument.getDishonorReason())); - return entity.toDomain(); - } - - @Transactional - public Instrument update(Instrument instrument) { - InstrumentEntity entity = instrumentJdbcRepository.update(new InstrumentEntity().toEntity(instrument)); - instrumentVoucherJdbcRepository.delete(instrument.getTenantId(), instrument.getId()); - dishonorReasonJdbcRepository.delete(instrument.getTenantId(), instrument.getId()); - if (instrument.getInstrumentVouchers() != null) - for (InstrumentVoucher iv : instrument.getInstrumentVouchers()) - instrumentVoucherJdbcRepository.create(new InstrumentVoucherEntity().toEntity(iv)); - if (instrument.getDishonorReason() != null) - dishonorReasonJdbcRepository.create(new DishonorReasonEntity().toEntity(instrument.getDishonorReason())); - return entity.toDomain(); - } - - @Transactional - public Instrument delete(Instrument instrument) { - InstrumentEntity entity = instrumentJdbcRepository.delete(new InstrumentEntity().toEntity(instrument)); - return entity.toDomain(); - } - - public Pagination search(InstrumentSearch domain) { - - if (financialConfigurationContractRepository.fetchDataFrom() != null - && financialConfigurationContractRepository.fetchDataFrom().equalsIgnoreCase("es")) { - - InstrumentMapper mapper = new InstrumentMapper(); - InstrumentSearchContract instrumentSearchContract = new InstrumentSearchContract(); - instrumentSearchContract = mapper.toSearchContract(domain); - Pagination instruments = instrumentESRepository.search(instrumentSearchContract); - - return instruments; - - } else - return instrumentJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, Instrument instrument) { - return instrumentJdbcRepository.uniqueCheck(fieldName, new InstrumentEntity().toEntity(instrument)); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypeESRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypeESRepository.java deleted file mode 100644 index 4a6b539dd2e..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypeESRepository.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.persistence.entity.InstrumentTypeEntity; -import org.egov.egf.instrument.web.contract.InstrumentTypeSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class InstrumentTypeESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger logger = LoggerFactory.getLogger(InstrumentTypeESRepository.class); - - public InstrumentTypeESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(InstrumentTypeSearchContract instrumentTypeSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(instrumentTypeSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToInstrumentTypeList(searchResponse); - } - - @SuppressWarnings("deprecation") - private Pagination mapToInstrumentTypeList(SearchResponse searchResponse) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) - return page; - List instrumentTypes = new ArrayList(); - InstrumentType instrumentType = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - instrumentType = mapper.readValue(hit.getSourceAsString(), InstrumentType.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - logger.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - logger.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - logger.error("IO Exception occurred: " + e1.getMessage()); - } - - instrumentTypes.add(instrumentType); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(instrumentTypes); - - return page; - } - - private SearchRequestBuilder getSearchRequest(InstrumentTypeSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), InstrumentTypeEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchInstrumentType(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(InstrumentType.class.getSimpleName().toLowerCase()) - .setTypes(InstrumentType.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) - for (String orderBy : orderByList) - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypePropertyRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypePropertyRepository.java deleted file mode 100644 index 15bf2d322fb..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypePropertyRepository.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import org.egov.egf.instrument.domain.model.InstrumentTypeProperty; -import org.egov.egf.instrument.persistence.entity.InstrumentTypePropertyEntity; -import org.egov.egf.instrument.persistence.repository.InstrumentTypePropertyJdbcRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class InstrumentTypePropertyRepository { - - @Autowired - private InstrumentTypePropertyJdbcRepository instrumentTypePropertyJdbcRepository; - - public InstrumentTypeProperty findById(InstrumentTypeProperty instrumentTypeProperty) { - InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository - .findById(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); - if (entity != null) - return entity.toDomain(); - - return null; - - } - - @Transactional - public InstrumentTypeProperty save(InstrumentTypeProperty instrumentTypeProperty) { - InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository - .create(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); - return entity.toDomain(); - } - - @Transactional - public InstrumentTypeProperty update(InstrumentTypeProperty instrumentTypeProperty) { - InstrumentTypePropertyEntity entity = instrumentTypePropertyJdbcRepository - .update(new InstrumentTypePropertyEntity().toEntity(instrumentTypeProperty)); - return entity.toDomain(); - } - - /* - * public Pagination search(InstrumentTypePropertySearch domain) { return - * instrumentTypePropertyJdbcRepository.search(domain); } - */ - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypeRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypeRepository.java deleted file mode 100644 index 038f7a680fd..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentTypeRepository.java +++ /dev/null @@ -1,218 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentTypeEntity; -import org.egov.egf.instrument.persistence.queue.repository.InstrumentTypeQueueRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentTypeJdbcRepository; -import org.egov.egf.instrument.web.contract.InstrumentTypeSearchContract; -import org.egov.egf.instrument.web.mapper.InstrumentTypeMapper; -import org.egov.egf.instrument.web.requests.InstrumentTypeRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class InstrumentTypeRepository { - - private InstrumentTypeJdbcRepository instrumentTypeJdbcRepository; - - private InstrumentTypeQueueRepository instrumentTypeQueueRepository; - - private String persistThroughKafka; - - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - private InstrumentTypeESRepository instrumentTypeESRepository; - - @Autowired - public InstrumentTypeRepository(InstrumentTypeJdbcRepository instrumentTypeJdbcRepository, - InstrumentTypeQueueRepository instrumentTypeQueueRepository, - @Value("${persist.through.kafka}") String persistThroughKafka, - FinancialConfigurationContractRepository financialConfigurationContractRepository, - InstrumentTypeESRepository instrumentTypeESRepository) { - this.instrumentTypeJdbcRepository = instrumentTypeJdbcRepository; - this.instrumentTypeQueueRepository = instrumentTypeQueueRepository; - this.persistThroughKafka = persistThroughKafka; - this.financialConfigurationContractRepository = financialConfigurationContractRepository; - this.instrumentTypeESRepository = instrumentTypeESRepository; - - } - - public InstrumentType findById(InstrumentType instrumentType) { - InstrumentTypeEntity entity = instrumentTypeJdbcRepository - .findById(new InstrumentTypeEntity().toEntity(instrumentType)); - if (entity != null) - return entity.toDomain(); - - return null; - - } - - @Transactional - public List save(List instrumentTypes, RequestInfo requestInfo) { - - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentTypes(new ArrayList<>()); - - for (InstrumentType iac : instrumentTypes) - request.getInstrumentTypes().add(mapper.toContract(iac)); - - instrumentTypeQueueRepository.addToQue(request); - - return instrumentTypes; - } else { - - List resultList = new ArrayList(); - - for (InstrumentType iac : instrumentTypes) - resultList.add(save(iac)); - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentTypes(new ArrayList<>()); - - for (InstrumentType iac : resultList) - request.getInstrumentTypes().add(mapper.toContract(iac)); - - instrumentTypeQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List update(List instrumentTypes, RequestInfo requestInfo) { - - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentTypes(new ArrayList<>()); - - for (InstrumentType iac : instrumentTypes) - request.getInstrumentTypes().add(mapper.toContract(iac)); - - instrumentTypeQueueRepository.addToQue(request); - - return instrumentTypes; - } else { - - List resultList = new ArrayList(); - - for (InstrumentType iac : instrumentTypes) - resultList.add(update(iac)); - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentTypes(new ArrayList<>()); - - for (InstrumentType iac : resultList) - request.getInstrumentTypes().add(mapper.toContract(iac)); - - instrumentTypeQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List delete(List instrumentTypes, RequestInfo requestInfo) { - - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentTypes(new ArrayList<>()); - - for (InstrumentType iac : instrumentTypes) - request.getInstrumentTypes().add(mapper.toContract(iac)); - - instrumentTypeQueueRepository.addToQue(request); - - return instrumentTypes; - } else { - - List resultList = new ArrayList(); - - for (InstrumentType iac : instrumentTypes) - resultList.add(delete(iac)); - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - request.setRequestInfo(requestInfo); - request.setInstrumentTypes(new ArrayList<>()); - - for (InstrumentType iac : resultList) - request.getInstrumentTypes().add(mapper.toContract(iac)); - - instrumentTypeQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public InstrumentType save(InstrumentType instrumentType) { - InstrumentTypeEntity entity = instrumentTypeJdbcRepository - .create(new InstrumentTypeEntity().toEntity(instrumentType)); - return entity.toDomain(); - } - - @Transactional - public InstrumentType update(InstrumentType instrumentType) { - InstrumentTypeEntity entity = instrumentTypeJdbcRepository - .update(new InstrumentTypeEntity().toEntity(instrumentType)); - return entity.toDomain(); - } - - @Transactional - public InstrumentType delete(InstrumentType instrumentType) { - InstrumentTypeEntity entity = instrumentTypeJdbcRepository.delete(new InstrumentTypeEntity().toEntity(instrumentType)); - return entity.toDomain(); - } - - public Pagination search(InstrumentTypeSearch domain) { - - if (financialConfigurationContractRepository.fetchDataFrom() != null - && financialConfigurationContractRepository.fetchDataFrom().equalsIgnoreCase("es")) { - - InstrumentTypeSearchContract instrumentTypeSearchContract = new InstrumentTypeSearchContract(); - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - instrumentTypeSearchContract = mapper.toSearchContract(domain); - Pagination instrumenttypes = instrumentTypeESRepository - .search(instrumentTypeSearchContract); - - return instrumenttypes; - - } else - return instrumentTypeJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, InstrumentType instrumentType) { - return instrumentTypeJdbcRepository.uniqueCheck(fieldName, new InstrumentTypeEntity().toEntity(instrumentType)); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentVoucherRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentVoucherRepository.java deleted file mode 100644 index 361f3448642..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/InstrumentVoucherRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.persistence.entity.InstrumentVoucherEntity; -import org.egov.egf.instrument.persistence.repository.InstrumentVoucherJdbcRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class InstrumentVoucherRepository { - - @Autowired - private InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository; - - public InstrumentVoucher findById(InstrumentVoucher instrumentVoucher) { - InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository - .findById(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); - if (entity != null) - return entity.toDomain(); - - return null; - - } - - @Transactional - public InstrumentVoucher save(InstrumentVoucher instrumentVoucher) { - InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository - .create(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); - return entity.toDomain(); - } - - @Transactional - public InstrumentVoucher update(InstrumentVoucher instrumentVoucher) { - InstrumentVoucherEntity entity = instrumentVoucherJdbcRepository - .update(new InstrumentVoucherEntity().toEntity(instrumentVoucher)); - return entity.toDomain(); - } - - /* - * public void add(CommonRequest request) { instrumentVoucherQueueRepository.add(request); } - */ - - /* - * public Pagination search(InstrumentVoucherSearch domain) { return - * instrumentVoucherJdbcRepository.search(domain); } - */ - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/SurrenderReasonESRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/SurrenderReasonESRepository.java deleted file mode 100644 index 7efabb84acc..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/SurrenderReasonESRepository.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.persistence.entity.SurrenderReasonEntity; -import org.egov.egf.instrument.web.contract.SurrenderReasonSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class SurrenderReasonESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger logger = LoggerFactory.getLogger(SurrenderReasonESRepository.class); - - public SurrenderReasonESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(SurrenderReasonSearchContract surrenderReasonSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(surrenderReasonSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToSurrenderReasonList(searchResponse); - } - - @SuppressWarnings("deprecation") - private Pagination mapToSurrenderReasonList(SearchResponse searchResponse) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) - return page; - List surrenderReasons = new ArrayList(); - SurrenderReason surrenderReason = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - surrenderReason = mapper.readValue(hit.getSourceAsString(), SurrenderReason.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - logger.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - logger.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - logger.error("IO Exception occurred: " + e1.getMessage()); - } - - surrenderReasons.add(surrenderReason); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(surrenderReasons); - - return page; - } - - private SearchRequestBuilder getSearchRequest(SurrenderReasonSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), SurrenderReasonEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchSurrenderReason(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(SurrenderReason.class.getSimpleName().toLowerCase()) - .setTypes(SurrenderReason.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) - for (String orderBy : orderByList) - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/SurrenderReasonRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/SurrenderReasonRepository.java deleted file mode 100644 index 2378f76fabf..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/repository/SurrenderReasonRepository.java +++ /dev/null @@ -1,217 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.persistence.entity.SurrenderReasonEntity; -import org.egov.egf.instrument.persistence.queue.repository.SurrenderReasonQueueRepository; -import org.egov.egf.instrument.persistence.repository.SurrenderReasonJdbcRepository; -import org.egov.egf.instrument.web.contract.SurrenderReasonSearchContract; -import org.egov.egf.instrument.web.mapper.SurrenderReasonMapper; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class SurrenderReasonRepository { - - private SurrenderReasonJdbcRepository surrenderReasonJdbcRepository; - - private SurrenderReasonQueueRepository surrenderReasonQueueRepository; - - private String persistThroughKafka; - - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - private SurrenderReasonESRepository surrenderReasonESRepository; - - @Autowired - public SurrenderReasonRepository(SurrenderReasonJdbcRepository surrenderReasonJdbcRepository, - SurrenderReasonQueueRepository surrenderReasonQueueRepository, - @Value("${persist.through.kafka}") String persistThroughKafka, - FinancialConfigurationContractRepository financialConfigurationContractRepository, - SurrenderReasonESRepository surrenderReasonESRepository) { - this.surrenderReasonJdbcRepository = surrenderReasonJdbcRepository; - this.surrenderReasonQueueRepository = surrenderReasonQueueRepository; - this.persistThroughKafka = persistThroughKafka; - this.financialConfigurationContractRepository = financialConfigurationContractRepository; - this.surrenderReasonESRepository = surrenderReasonESRepository; - - } - - public SurrenderReason findById(SurrenderReason surrenderReason) { - SurrenderReasonEntity entity = surrenderReasonJdbcRepository - .findById(new SurrenderReasonEntity().toEntity(surrenderReason)); - if (entity != null) - return entity.toDomain(); - - return null; - - } - - @Transactional - public List save(List surrenderReasons, RequestInfo requestInfo) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : surrenderReasons) - request.getSurrenderReasons().add(mapper.toContract(iac)); - - surrenderReasonQueueRepository.addToQue(request); - - return surrenderReasons; - } else { - - List resultList = new ArrayList(); - - for (SurrenderReason iac : surrenderReasons) - resultList.add(save(iac)); - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : resultList) - request.getSurrenderReasons().add(mapper.toContract(iac)); - - surrenderReasonQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List update(List surrenderReasons, RequestInfo requestInfo) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : surrenderReasons) - request.getSurrenderReasons().add(mapper.toContract(iac)); - - surrenderReasonQueueRepository.addToQue(request); - - return surrenderReasons; - } else { - - List resultList = new ArrayList(); - - for (SurrenderReason iac : surrenderReasons) - resultList.add(update(iac)); - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : resultList) - request.getSurrenderReasons().add(mapper.toContract(iac)); - - surrenderReasonQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public List delete(List surrenderReasons, RequestInfo requestInfo) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : surrenderReasons) - request.getSurrenderReasons().add(mapper.toContract(iac)); - - surrenderReasonQueueRepository.addToQue(request); - - return surrenderReasons; - } else { - - List resultList = new ArrayList(); - - for (SurrenderReason iac : surrenderReasons) - resultList.add(delete(iac)); - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - request.setRequestInfo(requestInfo); - request.setSurrenderReasons(new ArrayList<>()); - - for (SurrenderReason iac : resultList) - request.getSurrenderReasons().add(mapper.toContract(iac)); - - surrenderReasonQueueRepository.addToSearchQue(request); - - return resultList; - } - - } - - @Transactional - public SurrenderReason save(SurrenderReason surrenderReason) { - SurrenderReasonEntity entity = surrenderReasonJdbcRepository - .create(new SurrenderReasonEntity().toEntity(surrenderReason)); - return entity.toDomain(); - } - - @Transactional - public SurrenderReason update(SurrenderReason surrenderReason) { - SurrenderReasonEntity entity = surrenderReasonJdbcRepository - .update(new SurrenderReasonEntity().toEntity(surrenderReason)); - return entity.toDomain(); - } - - @Transactional - public SurrenderReason delete(SurrenderReason surrenderReason) { - SurrenderReasonEntity entity = surrenderReasonJdbcRepository - .delete(new SurrenderReasonEntity().toEntity(surrenderReason)); - return entity.toDomain(); - } - - public Pagination search(SurrenderReasonSearch domain) { - - if (financialConfigurationContractRepository.fetchDataFrom() != null - && financialConfigurationContractRepository.fetchDataFrom().equalsIgnoreCase("es")) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - SurrenderReasonSearchContract surrenderReasonSearchContract = new SurrenderReasonSearchContract(); - surrenderReasonSearchContract = mapper.toSearchContract(domain); - - return surrenderReasonESRepository.search(surrenderReasonSearchContract); - - } else - return surrenderReasonJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, SurrenderReason surrenderReason) { - return surrenderReasonJdbcRepository.uniqueCheck(fieldName, new SurrenderReasonEntity().toEntity(surrenderReason)); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentAccountCodeService.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentAccountCodeService.java deleted file mode 100644 index d9d5cf63b94..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentAccountCodeService.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.domain.repository.InstrumentAccountCodeRepository; -import org.egov.egf.instrument.domain.repository.InstrumentTypeRepository; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.repository.ChartOfAccountContractRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class InstrumentAccountCodeService { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String ACTION_VIEW = "view"; - public static final String ACTION_EDIT = "edit"; - public static final String ACTION_SEARCH = "search"; - - private InstrumentAccountCodeRepository instrumentAccountCodeRepository; - - private SmartValidator validator; - - private ChartOfAccountContractRepository chartOfAccountContractRepository; - - private InstrumentTypeRepository instrumentTypeRepository; - - @Autowired - public InstrumentAccountCodeService(SmartValidator validator, - InstrumentAccountCodeRepository instrumentAccountCodeRepository, - ChartOfAccountContractRepository chartOfAccountContractRepository, - InstrumentTypeRepository instrumentTypeRepository) { - this.validator = validator; - this.instrumentAccountCodeRepository = instrumentAccountCodeRepository; - this.chartOfAccountContractRepository = chartOfAccountContractRepository; - this.instrumentTypeRepository = instrumentTypeRepository; - } - - @Transactional - public List create(List instrumentAccountCodes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - instrumentAccountCodes = fetchRelated(instrumentAccountCodes, requestInfo); - - validate(instrumentAccountCodes, ACTION_CREATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentAccountCodeRepository.save(instrumentAccountCodes, requestInfo); - - } - - @Transactional - public List update(List instrumentAccountCodes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - instrumentAccountCodes = fetchRelated(instrumentAccountCodes, requestInfo); - - validate(instrumentAccountCodes, ACTION_UPDATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentAccountCodeRepository.update(instrumentAccountCodes, requestInfo); - - } - - @Transactional - public List delete(List instrumentAccountCodes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - validate(instrumentAccountCodes, ACTION_DELETE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - - } - - return instrumentAccountCodeRepository.delete(instrumentAccountCodes, requestInfo); - } - - private BindingResult validate(List instrumentaccountcodes, String method, - BindingResult errors) { - - try { - switch (method) { - case ACTION_VIEW: - // validator.validate(instrumentAccountCodeContractRequest.getInstrumentAccountCode(), - // errors); - break; - case ACTION_CREATE: - if (instrumentaccountcodes == null) - throw new InvalidDataException("instrumentaccountcodes", ErrorCode.NOT_NULL.getCode(), null); - for (InstrumentAccountCode instrumentAccountCode : instrumentaccountcodes) { - validator.validate(instrumentAccountCode, errors); - if (!instrumentAccountCodeRepository.uniqueCheck("instrumentTypeId", instrumentAccountCode)) - errors.addError(new FieldError("instrumentAccountCode", "instrumentType", - instrumentAccountCode.getInstrumentType(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - break; - case ACTION_UPDATE: - if (instrumentaccountcodes == null) - throw new InvalidDataException("instrumentaccountcodes", ErrorCode.NOT_NULL.getCode(), null); - for (InstrumentAccountCode instrumentAccountCode : instrumentaccountcodes) { - if (instrumentAccountCode.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - instrumentAccountCode.getId()); - validator.validate(instrumentAccountCode, errors); - if (!instrumentAccountCodeRepository.uniqueCheck("instrumentTypeId", instrumentAccountCode)) - errors.addError(new FieldError("instrumentAccountCode", "instrumentType", - instrumentAccountCode.getInstrumentType(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - break; - case ACTION_DELETE: - if (instrumentaccountcodes == null) - throw new InvalidDataException("instrumentaccountcodes", ErrorCode.NOT_NULL.getCode(), null); - for (InstrumentAccountCode instrumentaccountcode : instrumentaccountcodes) - if (instrumentaccountcode.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - instrumentaccountcode.getId()); - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - - } - - public List fetchRelated(List instrumentaccountcodes, RequestInfo requestInfo) { - - if (instrumentaccountcodes != null) - for (InstrumentAccountCode instrumentAccountCode : instrumentaccountcodes) { - - // fetch related items - - if (instrumentAccountCode.getInstrumentType() != null - && instrumentAccountCode.getInstrumentType().getName() != null) { - InstrumentTypeSearch instrumentTypeSearch = new InstrumentTypeSearch(); - instrumentTypeSearch.setName(instrumentAccountCode.getInstrumentType().getName()); - instrumentTypeSearch.setTenantId(instrumentAccountCode.getInstrumentType().getTenantId()); - Pagination response = instrumentTypeRepository.search(instrumentTypeSearch); - if (response == null || response.getPagedData() == null || response.getPagedData().isEmpty()) - throw new InvalidDataException("instrumentTypeSearchResult", ErrorCode.INVALID_REF_VALUE.getCode(), null); - instrumentAccountCode.setInstrumentType(response.getPagedData().get(0)); - } - - if (instrumentAccountCode.getAccountCode() != null - && instrumentAccountCode.getAccountCode().getGlcode() != null) { - - instrumentAccountCode.getAccountCode().setTenantId(instrumentAccountCode.getTenantId()); - ChartOfAccountContract accountCode = chartOfAccountContractRepository - .findByGlcode(instrumentAccountCode.getAccountCode(), requestInfo); - - if (accountCode == null) - throw new InvalidDataException("accountCode", ErrorCode.INVALID_REF_VALUE.getCode(), null); - - instrumentAccountCode.setAccountCode(accountCode); - } - - } - - return instrumentaccountcodes; - } - - @Transactional - public InstrumentAccountCode delete(InstrumentAccountCode instrumentAccountCode) { - return instrumentAccountCodeRepository.delete(instrumentAccountCode); - } - - public Pagination search(InstrumentAccountCodeSearch instrumentAccountCodeSearch) { - return instrumentAccountCodeRepository.search(instrumentAccountCodeSearch); - } - - @Transactional - public InstrumentAccountCode save(InstrumentAccountCode instrumentAccountCode) { - return instrumentAccountCodeRepository.save(instrumentAccountCode); - } - - @Transactional - public InstrumentAccountCode update(InstrumentAccountCode instrumentAccountCode) { - return instrumentAccountCodeRepository.update(instrumentAccountCode); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentService.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentService.java deleted file mode 100644 index e76bfa80f76..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentService.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; -import java.util.UUID; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.domain.repository.InstrumentRepository; -import org.egov.egf.instrument.domain.repository.InstrumentTypeRepository; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.egov.egf.master.web.repository.BankAccountContractRepository; -import org.egov.egf.master.web.repository.BankContractRepository; -import org.egov.egf.master.web.repository.FinancialStatusContractRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class InstrumentService { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String ACTION_VIEW = "view"; - public static final String ACTION_EDIT = "edit"; - public static final String ACTION_SEARCH = "search"; - - private InstrumentRepository instrumentRepository; - - private SmartValidator validator; - - private BankContractRepository bankContractRepository; - - private FinancialStatusContractRepository financialStatusContractRepository; - - private BankAccountContractRepository bankAccountContractRepository; - - private InstrumentTypeRepository instrumentTypeRepository; - - @Autowired - public InstrumentService(SmartValidator validator, InstrumentRepository instrumentRepository, BankContractRepository bankContractRepository, - FinancialStatusContractRepository financialStatusContractRepository, - BankAccountContractRepository bankAccountContractRepository, - InstrumentTypeRepository instrumentTypeRepository) { - this.validator = validator; - this.instrumentRepository = instrumentRepository; - this.bankContractRepository = bankContractRepository; - this.financialStatusContractRepository = financialStatusContractRepository; - this.bankAccountContractRepository = bankAccountContractRepository; - this.instrumentTypeRepository = instrumentTypeRepository; - } - - @Transactional - public List create(List instruments, BindingResult errors, RequestInfo requestInfo) { - - try { - - instruments = fetchRelated(instruments, requestInfo); - - validate(instruments, ACTION_CREATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentRepository.save(instruments, requestInfo); - - } - - @Transactional - public List update(List instruments, BindingResult errors, RequestInfo requestInfo) { - - try { - - instruments = fetchRelated(instruments, requestInfo); - - validate(instruments, ACTION_UPDATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentRepository.update(instruments, requestInfo); - - } - - @Transactional - public List delete(List instruments, BindingResult errors, RequestInfo requestInfo) { - - try { - - validate(instruments, ACTION_DELETE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentRepository.delete(instruments, requestInfo); - - } - - private BindingResult validate(List instruments, String method, BindingResult errors) { - - try { - switch (method) { - case ACTION_VIEW: - // validator.validate(instrumentContractRequest.getInstrument(), - // errors); - break; - case ACTION_CREATE: - if (instruments == null) - throw new InvalidDataException("instruments", ErrorCode.NOT_NULL.getCode(), null); - Calendar cal = Calendar.getInstance(); - cal.add(Calendar.MONTH, -6); - Calendar cal1 = Calendar.getInstance(); - for (Instrument instrument : instruments) { - switch (instrument.getInstrumentType().getName().toLowerCase()) { - case "cash": - if (instrument.getTransactionNumber() == null) - throw new InvalidDataException("TransactionNumber(Cash)", ErrorCode.NOT_NULL.getCode(), null); - // Assert.isTrue(DateUtils.isSameDay(instrument.getTransactionDate(), Calendar.getInstance().getTime()), - // "Cash Transaction Date must be current date"); - // Assert.notNull(instrument.getPayee(), "Payee Details for Cash Transaction must not be null"); - break; - case "cheque": - if (instrument.getTransactionNumber() == null) - throw new InvalidDataException("TransactionNumber(Cheque)", ErrorCode.NOT_NULL.getCode(), null); - // Assert.notNull(instrument.getPayee(), "Cheque Payee Details must not be null"); - // cal1.setTime(instrument.getTransactionDate()); - // Assert.isTrue(cal1.after(cal), "Cheque Transaction should be before 6 months of current date or a - // future date"); - if (instrument.getBank() == null) - throw new InvalidDataException("BankDetails(Cheque)", ErrorCode.NOT_NULL.getCode(), null); - break; - case "dd": - if (instrument.getTransactionNumber() == null) - throw new InvalidDataException("TransactionNumber(DD)", ErrorCode.NOT_NULL.getCode(), null); - cal1.setTime(instrument.getTransactionDate()); - // Assert.isTrue(cal1.after(cal), "DD Transaction should be before 6 months of current date or a future - // date"); - // Assert.notNull(instrument.getPayee(), "DD Payee Details must not be null"); - if (instrument.getBank() == null) - throw new InvalidDataException("BankDetails(DD)", ErrorCode.NOT_NULL.getCode(), null); - break; - case "online": - if (instrument.getTransactionNumber() == null) - throw new InvalidDataException("TransactionNumber(Online)", ErrorCode.NOT_NULL.getCode(), null); - // Assert.notNull(instrument.getPayee(), "Online Payee Details must not be null"); - // cal1.setTime(instrument.getTransactionDate()); - // Assert.isTrue(cal1.after(cal), "DD Transaction should be before 6 months of current date or a future - // date"); - break; - case "bankchallan": - if (instrument.getTransactionNumber() == null) - throw new InvalidDataException("TransactionNumber(BankChallan)", ErrorCode.NOT_NULL.getCode(), null); - if (instrument.getBank() == null) - throw new InvalidDataException("BankDetails(BankChallan)", ErrorCode.NOT_NULL.getCode(), null); - if (instrument.getBankAccount() == null) - throw new InvalidDataException("BankAccountDetails(BankChallan)", ErrorCode.NOT_NULL.getCode(), null); - // Assert.notNull(instrument.getPayee(), "Bank Challan Payee Details must not be null"); - // cal1.setTime(instrument.getTransactionDate()); - // Assert.isTrue(cal1.after(cal), "DD Transaction should be before 6 months of current date or a future - // date"); - break; - } - validator.validate(instrument, errors); - } - break; - case ACTION_UPDATE: - if (instruments == null) - throw new InvalidDataException("instruments", ErrorCode.NOT_NULL.getCode(), null); - for (Instrument instrument : instruments) { - if (instrument.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), instrument.getId()); - validator.validate(instrument, errors); - } - break; - case ACTION_DELETE: - if (instruments == null) - throw new InvalidDataException("instruments", ErrorCode.NOT_NULL.getCode(), null); - for (Instrument instrument : instruments) - if (instrument.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), instrument.getId()); - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - - } - - public List fetchRelated(List instruments, RequestInfo requestInfo) { - - if (instruments != null) - for (Instrument instrument : instruments) { - - if ("create".equalsIgnoreCase(requestInfo.getAction())) - instrument.setId(UUID.randomUUID().toString().replace("-", "")); - - // fetch related items - - if (instrument.getInstrumentType() != null && instrument.getInstrumentType().getName() != null) { - InstrumentTypeSearch instrumentTypeSearch = new InstrumentTypeSearch(); - instrumentTypeSearch.setName(instrument.getInstrumentType().getName()); - instrumentTypeSearch.setTenantId(instrument.getTenantId()); - Pagination response = instrumentTypeRepository.search(instrumentTypeSearch); - if (response == null || response.getPagedData() == null || response.getPagedData().isEmpty()) - throw new InvalidDataException("instrumentType", "instrumentType.invalid", - " Invalid instrumentType"); - instrument.setInstrumentType(response.getPagedData().get(0)); - } - bankContractRepository.getClass(); - /* if (instrument.getBank() != null && instrument.getBank().getId() != null) { - instrument.getBank().setTenantId(instrument.getTenantId()); - BankContract bank = bankContractRepository.findById(instrument.getBank(), requestInfo); - if (bank == null) - throw new InvalidDataException("bank", "bank.invalid", " Invalid bank"); - instrument.setBank(bank); - }*/ - /* if (instrument.getBankAccount() != null && instrument.getBankAccount().getAccountNumber() != null) { - instrument.getBankAccount().setTenantId(instrument.getTenantId()); - BankAccountContract bankAccount = bankAccountContractRepository - .findByAccountNumber(instrument.getBankAccount(), requestInfo); - if (bankAccount == null) - throw new InvalidDataException("bankAccount", "bankAccount.invalid", " Invalid bankAccount"); - instrument.setBankAccount(bankAccount); - }*/ - bankAccountContractRepository.getClass(); -// if (instrument.getFinancialStatus() != null) { -// instrument.getFinancialStatus().setTenantId(instrument.getTenantId()); -// FinancialStatusContract financialStatus = financialStatusContractRepository -// .findById(instrument.getFinancialStatus(), requestInfo); -// if (financialStatus == null) -// throw new InvalidDataException("financialStatus", "financialStatus.invalid", -// " Invalid financialStatus"); -// instrument.setFinancialStatus(financialStatus); -// } - - //Reason for instrument surrender is not initiated by collection service so that for now we are commenting out the validation from this service. - - /* if (instrument.getSurrenderReason() != null) { - instrument.getSurrenderReason().setTenantId(instrument.getTenantId()); - SurrenderReason surrenderReason = surrenderReasonRepository - .findById(instrument.getSurrenderReason()); - if (surrenderReason == null) - throw new InvalidDataException("surrenderReason", "surrenderReason.invalid", - " Invalid surrenderReason"); - instrument.setSurrenderReason(surrenderReason); - } */ - - } - - return instruments; - } - - public Pagination search(InstrumentSearch instrumentSearch) { - return instrumentRepository.search(instrumentSearch); - } - - @Transactional - public Instrument save(Instrument instrument) { - return instrumentRepository.save(instrument); - } - - @Transactional - public Instrument update(Instrument instrument) { - return instrumentRepository.update(instrument); - } - - @Transactional - public Instrument delete(Instrument instrument) { - return instrumentRepository.delete(instrument); - } - - public List deposit(InstrumentRequest instrumentDepositRequest, BindingResult errors, - RequestInfo requestInfo) { - Instrument instrument = new Instrument(); - instrument.setId(instrumentDepositRequest.getInstruments().get(0).getId()); - instrument.setTenantId(instrumentDepositRequest.getInstruments().get(0).getTenantId()); - - FinancialStatusContract financialStatusContract = new FinancialStatusContract(); - financialStatusContract.setCode("Deposited"); - financialStatusContract.setModuleType("Instrument"); - - instrument = instrumentRepository.findById(instrument); - FinancialStatusContract financialStatusContract1 = new FinancialStatusContract(); - financialStatusContract1 = financialStatusContractRepository.findByModuleCode(financialStatusContract); - instrument.setFinancialStatus(financialStatusContract1); - instrument.setRemittanceVoucherId(instrumentDepositRequest.getInstruments().get(0).getRemittanceVoucherId()); - List instrumentsToUpdate = new ArrayList<>(); - instrumentsToUpdate.add(instrument); - return instrumentRepository.update(instrumentsToUpdate, requestInfo); - } - - public List dishonor(InstrumentRequest instrumentDepositRequest, BindingResult errors, - RequestInfo requestInfo) { - Instrument instrument = new Instrument(); - instrument.setId(instrumentDepositRequest.getInstruments().get(0).getId()); - instrument.setTenantId(instrumentDepositRequest.getInstruments().get(0).getTenantId()); - - FinancialStatusContract financialStatusContract = new FinancialStatusContract(); - financialStatusContract.setCode("Deposited"); - financialStatusContract.setModuleType("Instrument"); - - instrument = instrumentRepository.findById(instrument); - FinancialStatusContract financialStatusContract1 = new FinancialStatusContract(); - financialStatusContract1 = financialStatusContractRepository.findByModuleCode(financialStatusContract); - instrument.setFinancialStatus(financialStatusContract1); - List instrumentsToUpdate = new ArrayList<>(); - instrumentsToUpdate.add(instrument); - return instrumentRepository.update(instrumentsToUpdate, requestInfo); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentTypeService.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentTypeService.java deleted file mode 100644 index a62b9cbb541..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/InstrumentTypeService.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.domain.repository.InstrumentTypeRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class InstrumentTypeService { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String ACTION_VIEW = "view"; - public static final String ACTION_EDIT = "edit"; - public static final String ACTION_SEARCH = "search"; - - private InstrumentTypeRepository instrumentTypeRepository; - - private SmartValidator validator; - - @Autowired - public InstrumentTypeService(SmartValidator validator, InstrumentTypeRepository instrumentTypeRepository) { - this.validator = validator; - this.instrumentTypeRepository = instrumentTypeRepository; - } - - @Transactional - public List create(List instrumentTypes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - instrumentTypes = fetchRelated(instrumentTypes); - - validate(instrumentTypes, ACTION_CREATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentTypeRepository.save(instrumentTypes, requestInfo); - - } - - @Transactional - public List update(List instrumentTypes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - instrumentTypes = fetchRelated(instrumentTypes); - - validate(instrumentTypes, ACTION_UPDATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentTypeRepository.update(instrumentTypes, requestInfo); - - } - - @Transactional - public List delete(List instrumentTypes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - validate(instrumentTypes, ACTION_DELETE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return instrumentTypeRepository.delete(instrumentTypes, requestInfo); - - } - - private BindingResult validate(List instrumenttypes, String method, BindingResult errors) { - - try { - switch (method) { - case ACTION_VIEW: - // validator.validate(instrumentTypeContractRequest.getInstrumentType(), - // errors); - break; - case ACTION_CREATE: - if (instrumenttypes == null) - throw new InvalidDataException("instruments", ErrorCode.NOT_NULL.getCode(), null); - for (InstrumentType instrumentType : instrumenttypes) { - validator.validate(instrumentType, errors); - if (!instrumentTypeRepository.uniqueCheck("name", instrumentType)) - errors.addError(new FieldError("instrumentType", "name", instrumentType.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - break; - case ACTION_UPDATE: - if (instrumenttypes == null) - throw new InvalidDataException("instruments", ErrorCode.NOT_NULL.getCode(), null); - for (InstrumentType instrumentType : instrumenttypes) { - if (instrumentType.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), instrumentType.getId()); - validator.validate(instrumentType, errors); - if (!instrumentTypeRepository.uniqueCheck("name", instrumentType)) - errors.addError(new FieldError("instrumentType", "name", instrumentType.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - break; - case ACTION_DELETE: - if (instrumenttypes == null) - throw new InvalidDataException("instruments", ErrorCode.NOT_NULL.getCode(), null); - for (InstrumentType instrumenttype : instrumenttypes) - if (instrumenttype.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), instrumenttype.getId()); - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - - } - - @Transactional - public InstrumentType delete(InstrumentType instrumentType) { - return instrumentTypeRepository.delete(instrumentType); - } - - public List fetchRelated(List instrumenttypes) { - - return instrumenttypes; - } - - public Pagination search(InstrumentTypeSearch instrumentTypeSearch) { - return instrumentTypeRepository.search(instrumentTypeSearch); - } - - @Transactional - public InstrumentType save(InstrumentType instrumentType) { - return instrumentTypeRepository.save(instrumentType); - } - - @Transactional - public InstrumentType update(InstrumentType instrumentType) { - return instrumentTypeRepository.update(instrumentType); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/SurrenderReasonService.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/SurrenderReasonService.java deleted file mode 100644 index c7d1b2f8d29..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/domain/service/SurrenderReasonService.java +++ /dev/null @@ -1,181 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.domain.repository.SurrenderReasonRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class SurrenderReasonService { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String ACTION_VIEW = "view"; - public static final String ACTION_EDIT = "edit"; - public static final String ACTION_SEARCH = "search"; - - @Autowired - private SurrenderReasonRepository surrenderReasonRepository; - - @Autowired - private SmartValidator validator; - - @Autowired - public SurrenderReasonService(SmartValidator validator, SurrenderReasonRepository surrenderReasonRepository) { - this.validator = validator; - this.surrenderReasonRepository = surrenderReasonRepository; - } - - @Transactional - public List create(List surrenderReasons, BindingResult errors, - RequestInfo requestInfo) { - - try { - - surrenderReasons = fetchRelated(surrenderReasons); - - validate(surrenderReasons, ACTION_CREATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return surrenderReasonRepository.save(surrenderReasons, requestInfo); - - } - - @Transactional - public List update(List surrenderReasons, BindingResult errors, - RequestInfo requestInfo) { - - try { - - surrenderReasons = fetchRelated(surrenderReasons); - - validate(surrenderReasons, ACTION_UPDATE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return surrenderReasonRepository.update(surrenderReasons, requestInfo); - - } - - @Transactional - public List delete(List surrenderReasons, BindingResult errors, - RequestInfo requestInfo) { - - try { - - validate(surrenderReasons, ACTION_DELETE, errors); - - if (errors.hasErrors()) - throw new CustomBindException(errors); - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - - } - - return surrenderReasonRepository.delete(surrenderReasons, requestInfo); - - } - - private BindingResult validate(List surrenderreasons, String method, BindingResult errors) { - - try { - switch (method) { - case ACTION_VIEW: - // validator.validate(surrenderReasonContractRequest.getSurrenderReason(), - // errors); - break; - case ACTION_CREATE: - if (surrenderreasons == null) - throw new InvalidDataException("surrenderreasons", ErrorCode.NOT_NULL.getCode(), null); - for (SurrenderReason surrenderReason : surrenderreasons) { - validator.validate(surrenderReason, errors); - if (!surrenderReasonRepository.uniqueCheck("name", surrenderReason)) - errors.addError(new FieldError("surrenderReason", "name", surrenderReason.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - break; - case ACTION_UPDATE: - if (surrenderreasons == null) - throw new InvalidDataException("surrenderreasons", ErrorCode.NOT_NULL.getCode(), null); - for (SurrenderReason surrenderReason : surrenderreasons) { - if (surrenderReason.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - surrenderReason.getId()); - validator.validate(surrenderReason, errors); - if (!surrenderReasonRepository.uniqueCheck("name", surrenderReason)) - errors.addError(new FieldError("surrenderReason", "name", surrenderReason.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - case ACTION_DELETE: - if (surrenderreasons == null) - throw new InvalidDataException("surrenderreasons", ErrorCode.NOT_NULL.getCode(), null); - for (SurrenderReason surrenderreason : surrenderreasons) - if (surrenderreason.getId() == null) - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - surrenderreason.getId()); - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - - } - - @Transactional - public SurrenderReason delete(SurrenderReason surrenderReason) { - return surrenderReasonRepository.delete(surrenderReason); - } - - public List fetchRelated(List surrenderreasons) { - - return surrenderreasons; - } - - public Pagination search(SurrenderReasonSearch surrenderReasonSearch) { - return surrenderReasonRepository.search(surrenderReasonSearch); - } - - @Transactional - public SurrenderReason save(SurrenderReason surrenderReason) { - return surrenderReasonRepository.save(surrenderReason); - } - - @Transactional - public SurrenderReason update(SurrenderReason surrenderReason) { - return surrenderReasonRepository.update(surrenderReason); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/DishonorReasonEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/DishonorReasonEntity.java deleted file mode 100644 index 9293ec347c4..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/DishonorReasonEntity.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.instrument.domain.model.DishonorReason; -import org.egov.egf.instrument.domain.model.Instrument; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class DishonorReasonEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_instrumentdishonor"; - private String id; - private String reason; - private String remarks; - private String instrumentid; - private String reversalVoucherId; - private Long dishonorDate; - - public DishonorReason toDomain() { - DishonorReason dishonorReason = new DishonorReason(); - super.toDomain(dishonorReason); - dishonorReason.setId(id); - dishonorReason.setReason(reason); - dishonorReason.setRemarks(remarks); - dishonorReason.setInstrument(instrumentid); - dishonorReason.setReversalVoucherId(reversalVoucherId); - dishonorReason.setDishonorDate(dishonorDate); - return dishonorReason; - } - - public DishonorReasonEntity toEntity(DishonorReason dishonorReason) { - super.toEntity(dishonorReason); - id = dishonorReason.getId(); - reason = dishonorReason.getReason(); - remarks = dishonorReason.getRemarks(); - instrumentid = dishonorReason.getInstrument(); - reversalVoucherId = dishonorReason.getReversalVoucherId(); - dishonorDate = dishonorReason.getDishonorDate(); - return this; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/DishonorReasonSearchEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/DishonorReasonSearchEntity.java deleted file mode 100644 index 93816ef2bdb..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/DishonorReasonSearchEntity.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.egf.instrument.domain.model.DishonorReason; -import org.egov.egf.instrument.domain.model.DishonorReasonSearch; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class DishonorReasonSearchEntity extends DishonorReasonEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - @Override - public DishonorReason toDomain() { - DishonorReason dishonorReason = new DishonorReason(); - super.toDomain(dishonorReason); - return dishonorReason; - } - - public DishonorReasonSearchEntity toEntity(DishonorReasonSearch dishonorReasonSearch) { - super.toEntity(dishonorReasonSearch); - pageSize = dishonorReasonSearch.getPageSize(); - offset = dishonorReasonSearch.getOffset(); - sortBy = dishonorReasonSearch.getSortBy(); - ids = dishonorReasonSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentAccountCodeEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentAccountCodeEntity.java deleted file mode 100644 index 6bd2db532c0..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentAccountCodeEntity.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.master.web.contract.ChartOfAccountContract; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class InstrumentAccountCodeEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_instrumentaccountcode"; - private String id; - private String instrumentTypeId; - private String accountCodeId; - - public InstrumentAccountCode toDomain() { - InstrumentAccountCode instrumentAccountCode = new InstrumentAccountCode(); - super.toDomain(instrumentAccountCode); - instrumentAccountCode.setId(id); - instrumentAccountCode.setInstrumentType(InstrumentType.builder().name(instrumentTypeId).build()); - instrumentAccountCode.setAccountCode(ChartOfAccountContract.builder().glcode(accountCodeId).build()); - return instrumentAccountCode; - } - - public InstrumentAccountCodeEntity toEntity(InstrumentAccountCode instrumentAccountCode) { - super.toEntity(instrumentAccountCode); - id = instrumentAccountCode.getId(); - instrumentTypeId = instrumentAccountCode.getInstrumentType() != null - ? instrumentAccountCode.getInstrumentType().getName() : null; - accountCodeId = instrumentAccountCode.getAccountCode() != null - ? instrumentAccountCode.getAccountCode().getGlcode() : null; - return this; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentAccountCodeSearchEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentAccountCodeSearchEntity.java deleted file mode 100644 index 1bd7f89eebd..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentAccountCodeSearchEntity.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentAccountCodeSearchEntity extends InstrumentAccountCodeEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - @Override - public InstrumentAccountCode toDomain() { - InstrumentAccountCode instrumentAccountCode = new InstrumentAccountCode(); - super.toDomain(instrumentAccountCode); - return instrumentAccountCode; - } - - public InstrumentAccountCodeSearchEntity toEntity(InstrumentAccountCodeSearch instrumentAccountCodeSearch) { - super.toEntity(instrumentAccountCodeSearch); - pageSize = instrumentAccountCodeSearch.getPageSize(); - offset = instrumentAccountCodeSearch.getOffset(); - sortBy = instrumentAccountCodeSearch.getSortBy(); - ids = instrumentAccountCodeSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentEntity.java deleted file mode 100644 index 8d68faec394..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentEntity.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import java.math.BigDecimal; -import java.util.Date; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.FinancialStatusContract; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class InstrumentEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_instrument"; - private String id; - private String transactionNumber; - private Date transactionDate; - private BigDecimal amount; - private String instrumentTypeId; - private String bankId; - private String branchName; - private String bankAccountId; - private String financialStatusId; - private String remittanceVoucherId; - private String transactionType; - private String payee; - private String drawer; - private String surrenderReasonId; - private String serialNo; - private String payinSlipId; - private BigDecimal reconciledAmount; - private Date reconciledOn; - - public Instrument toDomain() { - Instrument instrument = new Instrument(); - super.toDomain(instrument); - instrument.setId(id); - instrument.setTransactionNumber(transactionNumber); - instrument.setTransactionDate(transactionDate); - instrument.setAmount(amount); - instrument.setInstrumentType(InstrumentType.builder().name(instrumentTypeId).build()); - instrument.setBank(BankContract.builder().id(bankId).build()); - instrument.setBranchName(branchName); - instrument.setBankAccount(BankAccountContract.builder().accountNumber(bankAccountId).build()); - instrument.setFinancialStatus(FinancialStatusContract.builder().id(financialStatusId).build()); - instrument.setRemittanceVoucherId(remittanceVoucherId); - if (transactionType != null) - instrument.setTransactionType(TransactionType.valueOf(transactionType)); - instrument.setPayee(payee); - instrument.setDrawer(drawer); - instrument.setSurrenderReason(SurrenderReason.builder().id(surrenderReasonId).build()); - instrument.setSerialNo(serialNo); - instrument.setPayinSlipId(payinSlipId); - instrument.setReconciledAmount(reconciledAmount); - instrument.setReconciledOn(reconciledOn); - return instrument; - } - - public InstrumentEntity toEntity(Instrument instrument) { - super.toEntity(instrument); - id = instrument.getId(); - transactionNumber = instrument.getTransactionNumber(); - transactionDate = instrument.getTransactionDate(); - amount = instrument.getAmount(); - instrumentTypeId = instrument.getInstrumentType() != null ? instrument.getInstrumentType().getName() - : null; - bankId = instrument.getBank() != null ? instrument.getBank().getId() : null; - branchName = instrument.getBranchName(); - bankAccountId = instrument.getBankAccount() != null ? instrument.getBankAccount().getAccountNumber() - : null; - financialStatusId = instrument.getFinancialStatus() != null ? instrument.getFinancialStatus().getCode() - : null; - remittanceVoucherId = instrument.getRemittanceVoucherId(); - transactionType = instrument.getTransactionType() != null ? instrument.getTransactionType().toString() - : null; - payee = instrument.getPayee(); - drawer = instrument.getDrawer(); - surrenderReasonId = instrument.getSurrenderReason() != null ? instrument.getSurrenderReason().getId() - : null; - serialNo = instrument.getSerialNo(); - payinSlipId = instrument.getPayinSlipId(); - reconciledAmount = instrument.getReconciledAmount(); - reconciledOn = instrument.getReconciledOn(); - return this; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentSearchEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentSearchEntity.java deleted file mode 100644 index c02bc43ad1b..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentSearchEntity.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import java.util.Date; - -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentSearchEntity extends InstrumentEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String instrumentTypes; - private String financialStatuses; - private Date transactionFromDate; - private Date transactionToDate; - private String receiptIds; - - @Override - public Instrument toDomain() { - Instrument instrument = new Instrument(); - super.toDomain(instrument); - return instrument; - } - - public InstrumentSearchEntity toEntity(InstrumentSearch instrumentSearch) { - super.toEntity(instrumentSearch); - pageSize = instrumentSearch.getPageSize(); - offset = instrumentSearch.getOffset(); - sortBy = instrumentSearch.getSortBy(); - ids = instrumentSearch.getIds(); - financialStatuses = instrumentSearch.getFinancialStatuses(); - instrumentTypes = instrumentSearch.getInstrumentTypes(); - transactionFromDate = instrumentSearch.getTransactionFromDate(); - transactionToDate = instrumentSearch.getTransactionToDate(); - receiptIds = instrumentSearch.getReceiptIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypeEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypeEntity.java deleted file mode 100644 index de16b2abb55..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypeEntity.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.instrument.domain.model.InstrumentType; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class InstrumentTypeEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_instrumenttype"; - private String id; - private String name; - private String description; - private Boolean active; - - public InstrumentType toDomain() { - InstrumentType instrumentType = new InstrumentType(); - super.toDomain(instrumentType); - instrumentType.setId(id); - instrumentType.setName(name); - instrumentType.setDescription(description); - instrumentType.setActive(active); - return instrumentType; - } - - public InstrumentTypeEntity toEntity(InstrumentType instrumentType) { - super.toEntity(instrumentType); - id = instrumentType.getId(); - name = instrumentType.getName(); - description = instrumentType.getDescription(); - active = instrumentType.getActive(); - return this; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypePropertyEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypePropertyEntity.java deleted file mode 100644 index e9e6a1f054e..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypePropertyEntity.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeProperty; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.master.web.contract.FinancialStatusContract; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class InstrumentTypePropertyEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_instrumenttypeproperty"; - private String id; - private String transactionType; - private Boolean reconciledOncreate; - private String statusOnCreateId; - private String statusOnUpdateId; - private String statusOnReconcileId; - private String instrumentTypeId; - - public InstrumentTypeProperty toDomain() { - InstrumentTypeProperty instrumentTypeProperty = new InstrumentTypeProperty(); - super.toDomain(instrumentTypeProperty); - instrumentTypeProperty.setTransactionType(TransactionType.valueOf(transactionType)); - instrumentTypeProperty.setReconciledOncreate(reconciledOncreate); - instrumentTypeProperty.setStatusOnCreate(FinancialStatusContract.builder().code(statusOnCreateId).build()); - instrumentTypeProperty.setStatusOnUpdate(FinancialStatusContract.builder().code(statusOnUpdateId).build()); - instrumentTypeProperty - .setStatusOnReconcile(FinancialStatusContract.builder().code(statusOnReconcileId).build()); - instrumentTypeProperty.setInstrumentType(InstrumentType.builder().id(instrumentTypeId).build()); - return instrumentTypeProperty; - } - - public InstrumentTypePropertyEntity toEntity(InstrumentTypeProperty instrumentTypeProperty) { - super.toEntity(instrumentTypeProperty); - - transactionType = instrumentTypeProperty.getTransactionType() != null - ? instrumentTypeProperty.getTransactionType().toString() : null; - - reconciledOncreate = instrumentTypeProperty.getReconciledOncreate(); - statusOnCreateId = instrumentTypeProperty.getStatusOnCreate() != null - ? instrumentTypeProperty.getStatusOnCreate().getCode() : null; - statusOnUpdateId = instrumentTypeProperty.getStatusOnUpdate() != null - ? instrumentTypeProperty.getStatusOnUpdate().getCode() : null; - statusOnReconcileId = instrumentTypeProperty.getStatusOnReconcile() != null - ? instrumentTypeProperty.getStatusOnReconcile().getCode() : null; - - instrumentTypeId = instrumentTypeProperty.getInstrumentType() != null - ? instrumentTypeProperty.getInstrumentType().getId() : null; - return this; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypeSearchEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypeSearchEntity.java deleted file mode 100644 index 3246332cfb8..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentTypeSearchEntity.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentTypeSearchEntity extends InstrumentTypeEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - @Override - public InstrumentType toDomain() { - InstrumentType instrumentType = new InstrumentType(); - super.toDomain(instrumentType); - return instrumentType; - } - - public InstrumentTypeSearchEntity toEntity(InstrumentTypeSearch instrumentTypeSearch) { - super.toEntity(instrumentTypeSearch); - pageSize = instrumentTypeSearch.getPageSize(); - offset = instrumentTypeSearch.getOffset(); - sortBy = instrumentTypeSearch.getSortBy(); - ids = instrumentTypeSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentVoucherEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentVoucherEntity.java deleted file mode 100644 index 1fb4f32b844..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentVoucherEntity.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class InstrumentVoucherEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_instrumentvoucher"; - private String id; - private String instrumentId; - private String voucherHeaderId; - private String receiptHeaderId; - - public InstrumentVoucher toDomain() { - InstrumentVoucher instrumentVoucher = new InstrumentVoucher(); - super.toDomain(instrumentVoucher); - instrumentVoucher.setInstrument(Instrument.builder().id(instrumentId).build()); - instrumentVoucher.setVoucherHeaderId(voucherHeaderId); - instrumentVoucher.setReceiptHeaderId(receiptHeaderId); - return instrumentVoucher; - } - - public InstrumentVoucherEntity toEntity(InstrumentVoucher instrumentVoucher) { - super.toEntity(instrumentVoucher); - instrumentId = instrumentVoucher.getInstrument() != null ? instrumentVoucher.getInstrument().getId() - : null; - voucherHeaderId = instrumentVoucher.getVoucherHeaderId(); - receiptHeaderId = instrumentVoucher.getReceiptHeaderId(); - return this; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentVoucherSearchEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentVoucherSearchEntity.java deleted file mode 100644 index 75731029095..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/InstrumentVoucherSearchEntity.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.domain.model.InstrumentVoucherSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentVoucherSearchEntity extends InstrumentVoucherEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String instruments; - private String receiptIds; - - @Override - public InstrumentVoucher toDomain() { - InstrumentVoucher instrumentVoucher = new InstrumentVoucher(); - super.toDomain(instrumentVoucher); - return instrumentVoucher; - } - - public InstrumentVoucherSearchEntity toEntity(InstrumentVoucherSearch instrumentVoucherSearch) { - super.toEntity(instrumentVoucherSearch); - pageSize = instrumentVoucherSearch.getPageSize(); - offset = instrumentVoucherSearch.getOffset(); - sortBy = instrumentVoucherSearch.getSortBy(); - ids = instrumentVoucherSearch.getIds(); - instruments = instrumentVoucherSearch.getInstruments(); - receiptIds = instrumentVoucherSearch.getReceiptIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/SurrenderReasonEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/SurrenderReasonEntity.java deleted file mode 100644 index 8a66f03f5e7..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/SurrenderReasonEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.instrument.domain.model.SurrenderReason; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class SurrenderReasonEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_surrenderreason"; - private String id; - private String name; - private String description; - - public SurrenderReason toDomain() { - SurrenderReason surrenderReason = new SurrenderReason(); - super.toDomain(surrenderReason); - surrenderReason.setId(id); - surrenderReason.setName(name); - surrenderReason.setDescription(description); - return surrenderReason; - } - - public SurrenderReasonEntity toEntity(SurrenderReason surrenderReason) { - super.toEntity(surrenderReason); - id = surrenderReason.getId(); - name = surrenderReason.getName(); - description = surrenderReason.getDescription(); - return this; - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/SurrenderReasonSearchEntity.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/SurrenderReasonSearchEntity.java deleted file mode 100644 index 5f38a64e3c3..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/entity/SurrenderReasonSearchEntity.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.egov.egf.instrument.persistence.entity; - -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SurrenderReasonSearchEntity extends SurrenderReasonEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - @Override - public SurrenderReason toDomain() { - SurrenderReason surrenderReason = new SurrenderReason(); - super.toDomain(surrenderReason); - return surrenderReason; - } - - public SurrenderReasonSearchEntity toEntity(SurrenderReasonSearch surrenderReasonSearch) { - super.toEntity(surrenderReasonSearch); - pageSize = surrenderReasonSearch.getPageSize(); - offset = surrenderReasonSearch.getOffset(); - sortBy = surrenderReasonSearch.getSortBy(); - ids = surrenderReasonSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentListener.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentListener.java deleted file mode 100644 index 715526b71cc..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentListener.java +++ /dev/null @@ -1,273 +0,0 @@ -package org.egov.egf.instrument.persistence.queue; - -import java.util.HashMap; - -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.service.InstrumentAccountCodeService; -import org.egov.egf.instrument.domain.service.InstrumentService; -import org.egov.egf.instrument.domain.service.InstrumentTypeService; -import org.egov.egf.instrument.domain.service.SurrenderReasonService; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.egov.egf.instrument.web.mapper.InstrumentAccountCodeMapper; -import org.egov.egf.instrument.web.mapper.InstrumentMapper; -import org.egov.egf.instrument.web.mapper.InstrumentTypeMapper; -import org.egov.egf.instrument.web.mapper.SurrenderReasonMapper; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeRequest; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.egf.instrument.web.requests.InstrumentTypeRequest; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FinancialInstrumentListener { - - @Value("${kafka.topics.egf.instrument.completed.topic}") - private String completedTopic; - - @Value("${kafka.topics.egf.instrument.instrument.accountcode.completed.key}") - private String instrumentAccountCodeCompletedKey; - - @Value("${kafka.topics.egf.instrument.instrument.completed.key}") - private String instrumentCompletedKey; - - @Value("${kafka.topics.egf.instrument.instrument.type.completed.key}") - private String instrumentTypeCompletedKey; - - @Value("${kafka.topics.egf.instrument.surrender.reason.completed.key}") - private String surrenderReasonCompletedKey; - - @Autowired - private ObjectMapper objectMapper; - - @Autowired - private FinancialInstrumentProducer financialProducer; - - @Autowired - private InstrumentAccountCodeService instrumentAccountCodeService; - - @Autowired - private InstrumentService instrumentService; - - @Autowired - private InstrumentTypeService instrumentTypeService; - - @Autowired - private SurrenderReasonService surrenderReasonService; - - @KafkaListener(id = "${kafka.topics.egf.instrument.validated.id}", topics = "${kafka.topics.egf.instrument.validated.topic}", groupId = "${kafka.topics.egf.instrument.validated.group}") - public void process(HashMap mastersMap) { - - InstrumentAccountCodeMapper accountCodeMapper = new InstrumentAccountCodeMapper(); - InstrumentMapper instrumentMapper = new InstrumentMapper(); - InstrumentTypeMapper typeMapper = new InstrumentTypeMapper(); - SurrenderReasonMapper srMapper = new SurrenderReasonMapper(); - - if (mastersMap.get("instrumentaccountcode_create") != null) { - - InstrumentAccountCodeRequest request = objectMapper - .convertValue(mastersMap.get("instrumentaccountcode_create"), InstrumentAccountCodeRequest.class); - - for (InstrumentAccountCodeContract instrumentAccountCodeContract : request.getInstrumentAccountCodes()) { - InstrumentAccountCode domain = accountCodeMapper.toDomain(instrumentAccountCodeContract); - instrumentAccountCodeService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("instrumentaccountcode_persisted", request); - financialProducer.sendMessage(completedTopic, instrumentAccountCodeCompletedKey, mastersMap); - } - - if (mastersMap.get("instrumentaccountcode_update") != null) - - { - - InstrumentAccountCodeRequest request = objectMapper - .convertValue(mastersMap.get("instrumentaccountcode_update"), InstrumentAccountCodeRequest.class); - - for (InstrumentAccountCodeContract instrumentAccountCodeContract : request.getInstrumentAccountCodes()) { - InstrumentAccountCode domain = accountCodeMapper.toDomain(instrumentAccountCodeContract); - instrumentAccountCodeService.update(domain); - } - - mastersMap.clear(); - mastersMap.put("instrumentaccountcode_persisted", request); - financialProducer.sendMessage(completedTopic, instrumentAccountCodeCompletedKey, mastersMap); - } - - if (mastersMap.get("instrumentaccountcode_delete") != null) - - { - - InstrumentAccountCodeRequest request = objectMapper - .convertValue(mastersMap.get("instrumentaccountcode_delete"), InstrumentAccountCodeRequest.class); - - for (InstrumentAccountCodeContract instrumentAccountCodeContract : request.getInstrumentAccountCodes()) { - InstrumentAccountCode domain = accountCodeMapper.toDomain(instrumentAccountCodeContract); - instrumentAccountCodeService.delete(domain); - } - - mastersMap.clear(); - mastersMap.put("instrumentaccountcode_deleted", request); - financialProducer.sendMessage(completedTopic, instrumentAccountCodeCompletedKey, mastersMap); - } - - if (mastersMap.get("instrument_create") != null) { - - InstrumentRequest request = objectMapper.convertValue(mastersMap.get("instrument_create"), - InstrumentRequest.class); - - for (InstrumentContract instrumentContract : request.getInstruments()) { - Instrument domain = instrumentMapper.toDomain(instrumentContract); - instrumentService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("instrument_persisted", request); - financialProducer.sendMessage(completedTopic, instrumentCompletedKey, mastersMap); - } - - if (mastersMap.get("instrument_update") != null) - - { - - InstrumentRequest request = objectMapper.convertValue(mastersMap.get("instrument_update"), - InstrumentRequest.class); - - for (InstrumentContract instrumentContract : request.getInstruments()) { - Instrument domain = instrumentMapper.toDomain(instrumentContract); - instrumentService.update(domain); - } - - mastersMap.clear(); - mastersMap.put("instrument_persisted", request); - financialProducer.sendMessage(completedTopic, instrumentCompletedKey, mastersMap); - } - - if (mastersMap.get("instrument_delete") != null) - - { - - InstrumentRequest request = objectMapper.convertValue(mastersMap.get("instrument_delete"), - InstrumentRequest.class); - - for (InstrumentContract instrumentContract : request.getInstruments()) { - Instrument domain = instrumentMapper.toDomain(instrumentContract); - instrumentService.delete(domain); - } - - mastersMap.clear(); - mastersMap.put("instrument_deleted", request); - financialProducer.sendMessage(completedTopic, instrumentCompletedKey, mastersMap); - } - - if (mastersMap.get("instrumenttype_create") != null) { - - InstrumentTypeRequest request = objectMapper.convertValue(mastersMap.get("instrumenttype_create"), - InstrumentTypeRequest.class); - - for (InstrumentTypeContract instrumentTypeContract : request.getInstrumentTypes()) { - InstrumentType domain = typeMapper.toDomain(instrumentTypeContract); - instrumentTypeService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("instrumenttype_persisted", request); - financialProducer.sendMessage(completedTopic, instrumentTypeCompletedKey, mastersMap); - } - - if (mastersMap.get("instrumenttype_update") != null) - - { - - InstrumentTypeRequest request = objectMapper.convertValue(mastersMap.get("instrumenttype_update"), - InstrumentTypeRequest.class); - - for (InstrumentTypeContract instrumentTypeContract : request.getInstrumentTypes()) { - InstrumentType domain = typeMapper.toDomain(instrumentTypeContract); - instrumentTypeService.update(domain); - } - - mastersMap.clear(); - mastersMap.put("instrumenttype_persisted", request); - financialProducer.sendMessage(completedTopic, instrumentTypeCompletedKey, mastersMap); - } - - if (mastersMap.get("instrumenttype_delete") != null) - - { - - InstrumentTypeRequest request = objectMapper.convertValue(mastersMap.get("instrumenttype_delete"), - InstrumentTypeRequest.class); - - for (InstrumentTypeContract instrumentTypeContract : request.getInstrumentTypes()) { - InstrumentType domain = typeMapper.toDomain(instrumentTypeContract); - instrumentTypeService.delete(domain); - } - - mastersMap.clear(); - mastersMap.put("instrumenttype_deleted", request); - financialProducer.sendMessage(completedTopic, instrumentTypeCompletedKey, mastersMap); - } - - if (mastersMap.get("surrenderreason_create") != null) { - - SurrenderReasonRequest request = objectMapper.convertValue(mastersMap.get("surrenderreason_create"), - SurrenderReasonRequest.class); - - for (SurrenderReasonContract surrenderReasonContract : request.getSurrenderReasons()) { - SurrenderReason domain = srMapper.toDomain(surrenderReasonContract); - surrenderReasonService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("surrenderreason_persisted", request); - financialProducer.sendMessage(completedTopic, surrenderReasonCompletedKey, mastersMap); - } - - if (mastersMap.get("surrenderreason_update") != null) - - { - - SurrenderReasonRequest request = objectMapper.convertValue(mastersMap.get("surrenderreason_update"), - SurrenderReasonRequest.class); - - for (SurrenderReasonContract surrenderReasonContract : request.getSurrenderReasons()) { - SurrenderReason domain = srMapper.toDomain(surrenderReasonContract); - surrenderReasonService.update(domain); - } - - mastersMap.clear(); - mastersMap.put("surrenderreason_persisted", request); - financialProducer.sendMessage(completedTopic, surrenderReasonCompletedKey, mastersMap); - } - - if (mastersMap.get("surrenderreason_delete") != null) - - { - SurrenderReasonRequest request = objectMapper.convertValue(mastersMap.get("surrenderreason_delete"), - SurrenderReasonRequest.class); - - for (SurrenderReasonContract surrenderReasonContract : request.getSurrenderReasons()) { - SurrenderReason domain = srMapper.toDomain(surrenderReasonContract); - surrenderReasonService.delete(domain); - } - - mastersMap.clear(); - mastersMap.put("surrenderreason_deleted", request); - financialProducer.sendMessage(completedTopic, surrenderReasonCompletedKey, mastersMap); - } - - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentProducer.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentProducer.java deleted file mode 100644 index de2eb6d1b7a..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentProducer.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.egov.egf.instrument.persistence.queue; - -import java.util.Map; - -import org.egov.tracer.kafka.LogAwareKafkaTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class FinancialInstrumentProducer { - - private LogAwareKafkaTemplate kafkaTemplate; - - @Autowired - public FinancialInstrumentProducer(LogAwareKafkaTemplate kafkaTemplate) { - this.kafkaTemplate = kafkaTemplate; - } - - public void sendMessage(String topic, String key, Map message) { - kafkaTemplate.send(topic, key, message); - } - -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/ObjectMapperFactory.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/ObjectMapperFactory.java deleted file mode 100644 index 1ace36f8229..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/ObjectMapperFactory.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.persistence.queue; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class ObjectMapperFactory { - - private ObjectMapper objectMapper; - - public ObjectMapperFactory(ObjectMapper objectMapper) { - this.objectMapper = objectMapper; - } - - public ObjectMapper create() { - objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - return objectMapper; - } -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentAccountCodeQueueRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentAccountCodeQueueRepository.java deleted file mode 100644 index b50907cbc19..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentAccountCodeQueueRepository.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import java.util.HashMap; - -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentAccountCodeQueueRepository { - - private FinancialInstrumentProducer financialInstrumentProducer; - - private String validatedTopic; - - private String instrumentAccountCodeValidatedKey; - - private String completedTopic; - - private String instrumentAccountCodeCompletedKey; - - @Autowired - public InstrumentAccountCodeQueueRepository(FinancialInstrumentProducer financialInstrumentProducer, - @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic, - @Value("${kafka.topics.egf.instrument.instrument.accountcode.validated.key}") String instrumentAccountCodeValidatedKey, - @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic, - @Value("${kafka.topics.egf.instrument.instrument.accountcode.completed.key}") String instrumentAccountCodeCompletedKey) { - - this.financialInstrumentProducer = financialInstrumentProducer; - this.validatedTopic = validatedTopic; - this.instrumentAccountCodeValidatedKey = instrumentAccountCodeValidatedKey; - this.completedTopic = completedTopic; - this.instrumentAccountCodeCompletedKey = instrumentAccountCodeCompletedKey; - } - - public void addToQue(InstrumentAccountCodeRequest request) { - HashMap topicMap = new HashMap(); - - switch (request.getRequestInfo().getAction().toLowerCase()) { - - case "create": - topicMap.put("instrumentaccountcode_create", request); - System.out.println("push create topic" + request); - break; - case "update": - topicMap.put("instrumentaccountcode_update", request); - break; - case "delete": - topicMap.put("instrumentaccountcode_delete", request); - break; - - } - financialInstrumentProducer.sendMessage(validatedTopic, instrumentAccountCodeValidatedKey, topicMap); - } - - public void addToSearchQue(InstrumentAccountCodeRequest request) { - - HashMap topicMap = new HashMap(); - - if (!request.getInstrumentAccountCodes().isEmpty()) { - - topicMap.put("instrumentaccountcode_persisted", request); - - System.out.println("push search topic" + request); - - } - - financialInstrumentProducer.sendMessage(completedTopic, instrumentAccountCodeCompletedKey, topicMap); - - } -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentQueueRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentQueueRepository.java deleted file mode 100644 index 2c4c677fbf1..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentQueueRepository.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import java.util.HashMap; - -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentQueueRepository { - - private FinancialInstrumentProducer financialInstrumentProducer; - - private String validatedTopic; - - private String instrumentValidatedKey; - - private String completedTopic; - - private String instrumentCompletedKey; - - @Autowired - public InstrumentQueueRepository(FinancialInstrumentProducer financialInstrumentProducer, - @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic, - @Value("${kafka.topics.egf.instrument.instrument.validated.key}") String instrumentValidatedKey, - @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic, - @Value("${kafka.topics.egf.instrument.instrument.completed.key}") String instrumentCompletedKey) { - - this.financialInstrumentProducer = financialInstrumentProducer; - this.validatedTopic = validatedTopic; - this.instrumentValidatedKey = instrumentValidatedKey; - this.completedTopic = completedTopic; - this.instrumentCompletedKey = instrumentCompletedKey; - } - - public void addToQue(InstrumentRequest request) { - HashMap topicMap = new HashMap(); - - switch (request.getRequestInfo().getAction().toLowerCase()) { - - case "create": - topicMap.put("instrument_create", request); - System.out.println("push create topic" + request); - break; - case "update": - topicMap.put("instrument_update", request); - break; - case "delete": - topicMap.put("instrument_delete", request); - break; - - } - financialInstrumentProducer.sendMessage(validatedTopic, instrumentValidatedKey, topicMap); - } - - public void addToSearchQue(InstrumentRequest request) { - - HashMap topicMap = new HashMap(); - - if (!request.getInstruments().isEmpty()) { - - topicMap.put("instrument_persisted", request); - - System.out.println("push search topic" + request); - - } - - financialInstrumentProducer.sendMessage(completedTopic, instrumentCompletedKey, topicMap); - - } -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentTypeQueueRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentTypeQueueRepository.java deleted file mode 100644 index 4cb3867869b..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentTypeQueueRepository.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import java.util.HashMap; - -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.requests.InstrumentTypeRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentTypeQueueRepository { - - private FinancialInstrumentProducer financialInstrumentProducer; - - private String validatedTopic; - - private String instrumentTypeValidatedKey; - - private String completedTopic; - - private String instrumentTypeCompletedKey; - - @Autowired - public InstrumentTypeQueueRepository(FinancialInstrumentProducer financialInstrumentProducer, - @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic, - @Value("${kafka.topics.egf.instrument.instrument.type.validated.key}") String instrumentTypeValidatedKey, - @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic, - @Value("${kafka.topics.egf.instrument.instrument.type.completed.key}") String instrumentTypeCompletedKey) { - - this.financialInstrumentProducer = financialInstrumentProducer; - this.validatedTopic = validatedTopic; - this.instrumentTypeValidatedKey = instrumentTypeValidatedKey; - this.completedTopic = completedTopic; - this.instrumentTypeCompletedKey = instrumentTypeCompletedKey; - } - - public void addToQue(InstrumentTypeRequest request) { - HashMap topicMap = new HashMap(); - - switch (request.getRequestInfo().getAction().toLowerCase()) { - - case "create": - topicMap.put("instrumenttype_create", request); - System.out.println("push create topic" + request); - break; - case "update": - topicMap.put("instrumenttype_update", request); - break; - case "delete": - topicMap.put("instrumenttype_delete", request); - break; - - } - financialInstrumentProducer.sendMessage(validatedTopic, instrumentTypeValidatedKey, topicMap); - } - - public void addToSearchQue(InstrumentTypeRequest request) { - - HashMap topicMap = new HashMap(); - - if (!request.getInstrumentTypes().isEmpty()) { - - topicMap.put("instrumenttype_persisted", request); - - System.out.println("push search topic" + request); - - } - - financialInstrumentProducer.sendMessage(completedTopic, instrumentTypeCompletedKey, topicMap); - - } -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/SurrenderReasonQueueRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/SurrenderReasonQueueRepository.java deleted file mode 100644 index 640ff6bc93b..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/queue/repository/SurrenderReasonQueueRepository.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import java.util.HashMap; - -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -@Service -public class SurrenderReasonQueueRepository { - - private FinancialInstrumentProducer financialInstrumentProducer; - - private String validatedTopic; - - private String surrenderReasonValidatedKey; - - private String completedTopic; - - private String surrenderReasonCompletedKey; - - @Autowired - public SurrenderReasonQueueRepository(FinancialInstrumentProducer financialInstrumentProducer, - @Value("${kafka.topics.egf.instrument.validated.topic}") String validatedTopic, - @Value("${kafka.topics.egf.instrument.surrender.reason.validated.key}") String surrenderReasonValidatedKey, - @Value("${kafka.topics.egf.instrument.completed.topic}") String completedTopic, - @Value("${kafka.topics.egf.instrument.surrender.reason.completed.key}") String surrenderReasonCompletedKey) { - - this.financialInstrumentProducer = financialInstrumentProducer; - this.validatedTopic = validatedTopic; - this.surrenderReasonValidatedKey = surrenderReasonValidatedKey; - this.completedTopic = completedTopic; - this.surrenderReasonCompletedKey = surrenderReasonCompletedKey; - } - - public void addToQue(SurrenderReasonRequest request) { - HashMap topicMap = new HashMap(); - - switch (request.getRequestInfo().getAction().toLowerCase()) { - - case "create": - topicMap.put("surrenderreason_create", request); - System.out.println("push create topic" + request); - break; - case "update": - topicMap.put("surrenderreason_update", request); - break; - case "delete": - topicMap.put("surrenderreason_delete", request); - break; - - } - financialInstrumentProducer.sendMessage(validatedTopic, surrenderReasonValidatedKey, topicMap); - } - - public void addToSearchQue(SurrenderReasonRequest request) { - - HashMap topicMap = new HashMap(); - - if (!request.getSurrenderReasons().isEmpty()) { - - topicMap.put("surrenderreason_persisted", request); - - System.out.println("push search topic" + request); - - } - - financialInstrumentProducer.sendMessage(completedTopic, surrenderReasonCompletedKey, topicMap); - - } -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/DishonorReasonJdbcRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/DishonorReasonJdbcRepository.java deleted file mode 100644 index b2274fb0d57..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/DishonorReasonJdbcRepository.java +++ /dev/null @@ -1,175 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.instrument.domain.model.DishonorReason; -import org.egov.egf.instrument.domain.model.DishonorReasonSearch; -import org.egov.egf.instrument.persistence.entity.DishonorReasonEntity; -import org.egov.egf.instrument.persistence.entity.DishonorReasonSearchEntity; -import org.egov.egf.instrument.persistence.entity.InstrumentVoucherEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class DishonorReasonJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(DishonorReasonJdbcRepository.class); - - static { - LOG.debug("init dishonorrReason"); - init(DishonorReasonEntity.class); - LOG.debug("end init dishonorrReason"); - } - - public DishonorReasonJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - this.jdbcTemplate = jdbcTemplate; - } - - public DishonorReasonEntity create(DishonorReasonEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public DishonorReasonEntity update(DishonorReasonEntity entity) { - super.update(entity); - return entity; - - } - - public DishonorReasonEntity delete(DishonorReasonEntity entity) { - super.delete(DishonorReasonEntity.TABLE_NAME, entity.getId()); - return entity; - } - - @Override - public void delete(final String tenantId, final String instrumentId) { - super.delete(DishonorReasonEntity.TABLE_NAME, tenantId, "instrumentid", instrumentId); - } - - public Pagination search(DishonorReasonSearch domain) { - DishonorReasonSearchEntity dishonorReasonSearchEntity = new DishonorReasonSearchEntity(); - dishonorReasonSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (dishonorReasonSearchEntity.getSortBy() != null && !dishonorReasonSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(dishonorReasonSearchEntity.getSortBy()); - validateEntityFieldName(dishonorReasonSearchEntity.getSortBy(), DishonorReasonEntity.class); - } - - String orderBy = "order by id"; - if (dishonorReasonSearchEntity.getSortBy() != null && !dishonorReasonSearchEntity.getSortBy().isEmpty()) - orderBy = "order by " + dishonorReasonSearchEntity.getSortBy(); - - searchQuery = searchQuery.replace(":tablename", DishonorReasonEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (dishonorReasonSearchEntity.getTenantId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", dishonorReasonSearchEntity.getTenantId()); - } - if (dishonorReasonSearchEntity.getId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id =:id"); - paramValues.put("id", dishonorReasonSearchEntity.getId()); - } - if (dishonorReasonSearchEntity.getReason() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("reason =:reason"); - paramValues.put("reason", dishonorReasonSearchEntity.getReason()); - } - if (dishonorReasonSearchEntity.getRemarks() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("remarks =:remarks"); - paramValues.put("remarks", dishonorReasonSearchEntity.getRemarks()); - } - if (dishonorReasonSearchEntity.getIds() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id in (:ids)"); - paramValues.put("ids", dishonorReasonSearchEntity.getIds()); - } - if (dishonorReasonSearchEntity.getInstrumentid() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("instrumentid in (:instrumentids)"); - paramValues.put("instrumentids", new ArrayList(Arrays.asList(dishonorReasonSearchEntity.getInstrumentid().split(",")))); - } - - Pagination page = new Pagination<>(); - if (dishonorReasonSearchEntity.getOffset() != null) - page.setOffset(dishonorReasonSearchEntity.getOffset()); - if (dishonorReasonSearchEntity.getPageSize() != null) - page.setPageSize(dishonorReasonSearchEntity.getPageSize()); - - if (params.length() > 0) - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(DishonorReasonEntity.class); - - List dishonorReasonEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(dishonorReasonEntities.size()); - - List dishonorreasons = new ArrayList<>(); - for (DishonorReasonEntity dishonorReasonEntity : dishonorReasonEntities) - dishonorreasons.add(dishonorReasonEntity.toDomain()); - page.setPagedData(dishonorreasons); - - return page; - } - - public DishonorReasonEntity findById(DishonorReasonEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) - paramValues.put(s, getValue(getField(entity, s), entity)); - - List dishonorreasons = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(DishonorReasonEntity.class)); - if (dishonorreasons.isEmpty()) - return null; - else - return dishonorreasons.get(0); - - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentAccountCodeJdbcRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentAccountCodeJdbcRepository.java deleted file mode 100644 index c4fd24e038c..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentAccountCodeJdbcRepository.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentAccountCodeEntity; -import org.egov.egf.instrument.persistence.entity.InstrumentAccountCodeSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentAccountCodeJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(InstrumentAccountCodeJdbcRepository.class); - - static { - LOG.debug("init instrumentAccountCode"); - init(InstrumentAccountCodeEntity.class); - LOG.debug("end init instrumentAccountCode"); - } - - public InstrumentAccountCodeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - this.jdbcTemplate = jdbcTemplate; - } - - public InstrumentAccountCodeEntity create(InstrumentAccountCodeEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public InstrumentAccountCodeEntity update(InstrumentAccountCodeEntity entity) { - super.update(entity); - return entity; - - } - - public InstrumentAccountCodeEntity delete(InstrumentAccountCodeEntity entity) { - super.delete(InstrumentAccountCodeEntity.TABLE_NAME, entity.getId()); - return entity; - } - - public Pagination search(InstrumentAccountCodeSearch domain) { - InstrumentAccountCodeSearchEntity instrumentAccountCodeSearchEntity = new InstrumentAccountCodeSearchEntity(); - instrumentAccountCodeSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (instrumentAccountCodeSearchEntity.getSortBy() != null - && !instrumentAccountCodeSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(instrumentAccountCodeSearchEntity.getSortBy()); - validateEntityFieldName(instrumentAccountCodeSearchEntity.getSortBy(), InstrumentAccountCodeEntity.class); - } - - String orderBy = "order by id"; - if (instrumentAccountCodeSearchEntity.getSortBy() != null - && !instrumentAccountCodeSearchEntity.getSortBy().isEmpty()) - orderBy = "order by " + instrumentAccountCodeSearchEntity.getSortBy(); - - searchQuery = searchQuery.replace(":tablename", InstrumentAccountCodeEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (instrumentAccountCodeSearchEntity.getTenantId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", instrumentAccountCodeSearchEntity.getTenantId()); - } - if (instrumentAccountCodeSearchEntity.getId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id =:id"); - paramValues.put("id", instrumentAccountCodeSearchEntity.getId()); - } - if (instrumentAccountCodeSearchEntity.getInstrumentTypeId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("instrumentTypeId =:instrumentType"); - paramValues.put("instrumentType", instrumentAccountCodeSearchEntity.getInstrumentTypeId()); - } - if (instrumentAccountCodeSearchEntity.getAccountCodeId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("accountCodeId =:accountCode"); - paramValues.put("accountCode", instrumentAccountCodeSearchEntity.getAccountCodeId()); - } - if (instrumentAccountCodeSearchEntity.getIds() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id in (:ids)"); - paramValues.put("ids", instrumentAccountCodeSearchEntity.getIds()); - } - - Pagination page = new Pagination<>(); - if (instrumentAccountCodeSearchEntity.getOffset() != null) - page.setOffset(instrumentAccountCodeSearchEntity.getOffset()); - if (instrumentAccountCodeSearchEntity.getPageSize() != null) - page.setPageSize(instrumentAccountCodeSearchEntity.getPageSize()); - - if (params.length() > 0) - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(InstrumentAccountCodeEntity.class); - - List instrumentAccountCodeEntities = namedParameterJdbcTemplate - .query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(instrumentAccountCodeEntities.size()); - - List instrumentaccountcodes = new ArrayList<>(); - for (InstrumentAccountCodeEntity instrumentAccountCodeEntity : instrumentAccountCodeEntities) - instrumentaccountcodes.add(instrumentAccountCodeEntity.toDomain()); - page.setPagedData(instrumentaccountcodes); - - return page; - } - - public InstrumentAccountCodeEntity findById(InstrumentAccountCodeEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) - paramValues.put(s, getValue(getField(entity, s), entity)); - - List instrumentaccountcodes = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(InstrumentAccountCodeEntity.class)); - if (instrumentaccountcodes.isEmpty()) - return null; - else - return instrumentaccountcodes.get(0); - - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentJdbcRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentJdbcRepository.java deleted file mode 100644 index 658b7346aef..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentJdbcRepository.java +++ /dev/null @@ -1,341 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.instrument.domain.model.DishonorReason; -import org.egov.egf.instrument.domain.model.DishonorReasonSearch; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.domain.model.InstrumentVoucherSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentEntity; -import org.egov.egf.instrument.persistence.entity.InstrumentSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(InstrumentJdbcRepository.class); - - private final InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository; - private final DishonorReasonJdbcRepository dishonorReasonJdbcRepository; - - static { - LOG.debug("init instrument"); - init(InstrumentEntity.class); - LOG.debug("end init instrument"); - } - - public InstrumentJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate, - InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository, DishonorReasonJdbcRepository dishonorReasonJdbcRepository) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - this.jdbcTemplate = jdbcTemplate; - this.instrumentVoucherJdbcRepository = instrumentVoucherJdbcRepository; - this.dishonorReasonJdbcRepository = dishonorReasonJdbcRepository; - } - - public InstrumentEntity create(InstrumentEntity entity) { - - // entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public InstrumentEntity update(InstrumentEntity entity) { - super.update(entity); - return entity; - - } - - public InstrumentEntity delete(InstrumentEntity entity) { - super.delete(entity, entity.getDeleteReason()); - return entity; - } - - public Pagination search(InstrumentSearch domain) { - InstrumentSearchEntity instrumentSearchEntity = new InstrumentSearchEntity(); - instrumentSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (instrumentSearchEntity.getSortBy() != null && !instrumentSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(instrumentSearchEntity.getSortBy()); - validateEntityFieldName(instrumentSearchEntity.getSortBy(), InstrumentEntity.class); - } - - String orderBy = "order by id"; - if (instrumentSearchEntity.getSortBy() != null && !instrumentSearchEntity.getSortBy().isEmpty()) - orderBy = "order by " + instrumentSearchEntity.getSortBy(); - - searchQuery = searchQuery.replace(":tablename", InstrumentEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (instrumentSearchEntity.getTenantId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", instrumentSearchEntity.getTenantId()); - } - if (instrumentSearchEntity.getId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id =:id"); - paramValues.put("id", instrumentSearchEntity.getId()); - } - if (instrumentSearchEntity.getTransactionNumber() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("transactionNumber =:transactionNumber"); - paramValues.put("transactionNumber", instrumentSearchEntity.getTransactionNumber()); - } - if (instrumentSearchEntity.getTransactionDate() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("transactionDate =:transactionDate"); - paramValues.put("transactionDate", instrumentSearchEntity.getTransactionDate()); - } - if (instrumentSearchEntity.getAmount() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("amount =:amount"); - paramValues.put("amount", instrumentSearchEntity.getAmount()); - } - if (instrumentSearchEntity.getInstrumentTypeId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("instrumentTypeid =:instrumentType"); - paramValues.put("instrumentType", instrumentSearchEntity.getInstrumentTypeId()); - } - if (instrumentSearchEntity.getBankId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("bankid =:bank"); - paramValues.put("bank", instrumentSearchEntity.getBankId()); - } - if (instrumentSearchEntity.getBranchName() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("branchName =:branchName"); - paramValues.put("branchName", instrumentSearchEntity.getBranchName()); - } - if (instrumentSearchEntity.getBankAccountId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("bankAccountid =:bankAccount"); - paramValues.put("bankAccount", instrumentSearchEntity.getBankAccountId()); - } - if (instrumentSearchEntity.getFinancialStatusId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("financialStatusid =:financialStatus"); - paramValues.put("financialStatus", instrumentSearchEntity.getFinancialStatusId()); - } - if (instrumentSearchEntity.getRemittanceVoucherId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("remittanceVoucherId =:remittanceVoucherId"); - paramValues.put("remittanceVoucherId", instrumentSearchEntity.getRemittanceVoucherId()); - } - if (instrumentSearchEntity.getTransactionType() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("transactionType =:transactionType"); - paramValues.put("transactionType", instrumentSearchEntity.getTransactionType()); - } - if (instrumentSearchEntity.getPayee() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("payee =:payee"); - paramValues.put("payee", instrumentSearchEntity.getPayee()); - } - if (instrumentSearchEntity.getDrawer() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("drawer =:drawer"); - paramValues.put("drawer", instrumentSearchEntity.getDrawer()); - } - if (instrumentSearchEntity.getSurrenderReasonId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("surrenderReasonid =:surrenderReason"); - paramValues.put("surrenderReason", instrumentSearchEntity.getSurrenderReasonId()); - } - if (instrumentSearchEntity.getSerialNo() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("serialNo =:serialNo"); - paramValues.put("serialNo", instrumentSearchEntity.getSerialNo()); - } - - if (instrumentSearchEntity.getReceiptIds() != null) { - InstrumentVoucherSearch ivs = new InstrumentVoucherSearch(); - ivs.setTenantId(instrumentSearchEntity.getTenantId()); - ivs.setReceiptIds(instrumentSearchEntity.getReceiptIds()); - Pagination instrumentVoucherList = instrumentVoucherJdbcRepository.search(ivs); - if (instrumentVoucherList != null && instrumentVoucherList.getPagedData() != null - && !instrumentVoucherList.getPagedData().isEmpty()) { - List idList = new ArrayList<>(); - for (InstrumentVoucher iv : instrumentVoucherList.getPagedData()) { - idList.add(iv.getInstrument().getId()); - } - if (!idList.isEmpty()) { - if (params.length() > 0) - params.append(" and "); - params.append("id in (:ids)"); - paramValues.put("ids", idList); - } - } - } - - if (instrumentSearchEntity.getIds() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id in (:ids)"); - paramValues.put("ids", new ArrayList(Arrays.asList(instrumentSearchEntity.getIds().split(",")))); - } - if (instrumentSearchEntity.getFinancialStatuses() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("financialStatusId in (:financialStatuses)"); - paramValues.put("financialStatuses", - new ArrayList(Arrays.asList(instrumentSearchEntity.getFinancialStatuses().split(",")))); - } - if (instrumentSearchEntity.getInstrumentTypes() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("instrumentTypeId in (:instrumentTypes)"); - paramValues.put("instrumentTypes", - new ArrayList(Arrays.asList(instrumentSearchEntity.getInstrumentTypes().split(",")))); - } - if (instrumentSearchEntity.getTransactionFromDate() != null && instrumentSearchEntity.getTransactionToDate() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("transactionDate >= :fromDate and transactionDate <= :toDate"); - paramValues.put("fromDate", instrumentSearchEntity.getTransactionFromDate()); - paramValues.put("toDate", instrumentSearchEntity.getTransactionToDate()); - } - - Pagination page = new Pagination<>(); - if (instrumentSearchEntity.getOffset() != null) - page.setOffset(instrumentSearchEntity.getOffset()); - if (instrumentSearchEntity.getPageSize() != null) - page.setPageSize(instrumentSearchEntity.getPageSize()); - - if (params.length() > 0) - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(InstrumentEntity.class); - - List instrumentEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(instrumentEntities.size()); - - List instruments = new ArrayList<>(); - StringBuffer ids = new StringBuffer(); - for (InstrumentEntity instrumentEntity : instrumentEntities) { - if (ids != null && ids.length() > 0) { - ids.append(","); - } - ids.append(instrumentEntity.getId()); - instruments.add(instrumentEntity.toDomain()); - } - populateInstrumentVouchers(instruments, ids, domain.getTenantId()); - populateIntrumentDishonor(instruments, ids, domain.getTenantId()); - page.setPagedData(instruments); - - return page; - } - - private void populateIntrumentDishonor(List instruments, StringBuffer ids, String tenantId) { - DishonorReasonSearch drs = new DishonorReasonSearch(); - drs.setTenantId(tenantId); - drs.setInstrument(ids.toString()); - Pagination dishonorList = dishonorReasonJdbcRepository.search(drs); - if(dishonorList != null && dishonorList.getPagedData() != null && !dishonorList.getPagedData().isEmpty()){ - Map map = dishonorList.getPagedData().stream().collect(Collectors.toMap(DishonorReason::getInstrument, Function.identity())); - instruments.stream().forEach(ins -> { - if(map.get(ins.getId()) != null) - ins.setDishonorReason(map.get(ins.getId())); - }); - }else{ - instruments.stream().forEach(ins -> { - ins.setDishonorReason(null); - }); - } - } - - private void populateInstrumentVouchers(List instruments, StringBuffer ids, String tenantId) { - InstrumentVoucherSearch ivs = new InstrumentVoucherSearch(); - ivs.setTenantId(tenantId); - ivs.setInstruments(ids.toString()); - Map> instrumentVoucherMap = new HashMap<>(); - Pagination instrumentVouchers = instrumentVoucherJdbcRepository.search(ivs); - if (instrumentVouchers != null && instrumentVouchers.getPagedData() != null) { - for (InstrumentVoucher iv : instrumentVouchers.getPagedData()) { - if (instrumentVoucherMap.get(iv.getInstrument().getId()) == null) { - ArrayList list = new ArrayList<>(); - list.add(iv); - instrumentVoucherMap.put(iv.getInstrument().getId(), list); - } else { - instrumentVoucherMap.get(iv.getInstrument().getId()).add(iv); - } - } - } - - for (Instrument i : instruments) { - if (instrumentVoucherMap.get(i.getId()) != null) { - i.setInstrumentVouchers(instrumentVoucherMap.get(i.getId())); - } - } - - } - - public InstrumentEntity findById(InstrumentEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) - paramValues.put(s, getValue(getField(entity, s), entity)); - - List instruments = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(InstrumentEntity.class)); - if (instruments.isEmpty()) - return null; - else - return instruments.get(0); - - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentTypeJdbcRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentTypeJdbcRepository.java deleted file mode 100644 index deeaf01b857..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentTypeJdbcRepository.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentTypeEntity; -import org.egov.egf.instrument.persistence.entity.InstrumentTypeSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentTypeJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(InstrumentTypeJdbcRepository.class); - - static { - LOG.debug("init instrumentType"); - init(InstrumentTypeEntity.class); - LOG.debug("end init instrumentType"); - } - - public InstrumentTypeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - this.jdbcTemplate = jdbcTemplate; - } - - public InstrumentTypeEntity create(InstrumentTypeEntity entity) { - - // entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public InstrumentTypeEntity update(InstrumentTypeEntity entity) { - super.update(entity); - return entity; - - } - - public InstrumentTypeEntity delete(InstrumentTypeEntity entity) { - super.delete(InstrumentTypeEntity.TABLE_NAME, entity.getId()); - return entity; - } - - public Pagination search(InstrumentTypeSearch domain) { - InstrumentTypeSearchEntity instrumentTypeSearchEntity = new InstrumentTypeSearchEntity(); - instrumentTypeSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (instrumentTypeSearchEntity.getSortBy() != null && !instrumentTypeSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(instrumentTypeSearchEntity.getSortBy()); - validateEntityFieldName(instrumentTypeSearchEntity.getSortBy(), InstrumentTypeEntity.class); - } - - String orderBy = "order by id"; - if (instrumentTypeSearchEntity.getSortBy() != null && !instrumentTypeSearchEntity.getSortBy().isEmpty()) - orderBy = "order by " + instrumentTypeSearchEntity.getSortBy(); - - searchQuery = searchQuery.replace(":tablename", InstrumentTypeEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (instrumentTypeSearchEntity.getTenantId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", instrumentTypeSearchEntity.getTenantId()); - } - if (instrumentTypeSearchEntity.getId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id =:id"); - paramValues.put("id", instrumentTypeSearchEntity.getId()); - } - if (instrumentTypeSearchEntity.getName() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("name =:name"); - paramValues.put("name", instrumentTypeSearchEntity.getName()); - } - if (instrumentTypeSearchEntity.getDescription() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("description =:description"); - paramValues.put("description", instrumentTypeSearchEntity.getDescription()); - } - if (instrumentTypeSearchEntity.getActive() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("active =:active"); - paramValues.put("active", instrumentTypeSearchEntity.getActive()); - } - - if (instrumentTypeSearchEntity.getIds() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id in (:ids)"); - paramValues.put("ids", instrumentTypeSearchEntity.getIds()); - } - - Pagination page = new Pagination<>(); - if (instrumentTypeSearchEntity.getOffset() != null) - page.setOffset(instrumentTypeSearchEntity.getOffset()); - if (instrumentTypeSearchEntity.getPageSize() != null) - page.setPageSize(instrumentTypeSearchEntity.getPageSize()); - - if (params.length() > 0) - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - else - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(InstrumentTypeEntity.class); - - /* - * searchQuery= "select * from egf_instrumenttype egf_instrumenttype, egf_instrumenttypeproperty properties where " + - * "egf_instrumenttype.name=properties.instrumentTypeId"; - */ - - List instrumentTypeEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(instrumentTypeEntities.size()); - - List instrumenttypes = new ArrayList<>(); - for (InstrumentTypeEntity instrumentTypeEntity : instrumentTypeEntities) - instrumenttypes.add(instrumentTypeEntity.toDomain()); - page.setPagedData(instrumenttypes); - - return page; - } - - public InstrumentTypeEntity findById(InstrumentTypeEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) - paramValues.put(s, getValue(getField(entity, s), entity)); - - List instrumenttypes = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(InstrumentTypeEntity.class)); - if (instrumenttypes.isEmpty()) - return null; - else - return instrumenttypes.get(0); - - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentTypePropertyJdbcRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentTypePropertyJdbcRepository.java deleted file mode 100644 index ecdda28668a..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentTypePropertyJdbcRepository.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.instrument.persistence.entity.InstrumentTypePropertyEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentTypePropertyJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(InstrumentTypePropertyJdbcRepository.class); - - static { - LOG.debug("init instrumentTypeProperty"); - init(InstrumentTypePropertyEntity.class); - LOG.debug("end init instrumentTypeProperty"); - } - - public InstrumentTypePropertyJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public InstrumentTypePropertyEntity create(InstrumentTypePropertyEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public InstrumentTypePropertyEntity update(InstrumentTypePropertyEntity entity) { - super.update(entity); - return entity; - - } - - /* - * public Pagination search(InstrumentTypeProperty domain) { InstrumentTypePropertyEntity - * instrumentTypePropertySearchEntity = new InstrumentTypePropertyEntity(); - * instrumentTypePropertySearchEntity.toEntity(domain); String searchQuery = - * "select :selectfields from :tablename :condition :orderby "; Map paramValues = new HashMap<>(); - * StringBuffer params = new StringBuffer(); if (instrumentTypePropertySearchEntity.getSortBy() != null && - * !instrumentTypePropertySearchEntity.getSortBy().isEmpty()) { - * validateSortByOrder(instrumentTypePropertySearchEntity.getSortBy()); - * validateEntityFieldName(instrumentTypePropertySearchEntity.getSortBy(), InstrumentTypePropertyEntity.class); } String - * orderBy = "order by id"; if (instrumentTypePropertySearchEntity.getSortBy() != null && - * !instrumentTypePropertySearchEntity.getSortBy().isEmpty()) orderBy = "order by " + - * instrumentTypePropertySearchEntity.getSortBy(); searchQuery = searchQuery.replace(":tablename", - * InstrumentTypePropertyEntity.TABLE_NAME); searchQuery = searchQuery.replace(":selectfields", " * "); // implement jdbc - * specfic search if (instrumentTypePropertySearchEntity.getTransactionTypeId() != null) { if (params.length() > 0) - * params.append(" and "); params.append( "transactionType =:transactionType"); paramValues.put("transactionType", - * instrumentTypePropertySearchEntity.getTransactionTypeId()); } if - * (instrumentTypePropertySearchEntity.getReconciledOncreate() != null) { if (params.length() > 0) params.append(" and "); - * params.append( "reconciledOncreate =:reconciledOncreate"); paramValues.put("reconciledOncreate", - * instrumentTypePropertySearchEntity.getReconciledOncreate()); } if (instrumentTypePropertySearchEntity.getStatusOnCreateId() - * != null) { if (params.length() > 0) params.append(" and "); params.append( "statusOnCreate =:statusOnCreate"); - * paramValues.put("statusOnCreate", instrumentTypePropertySearchEntity.getStatusOnCreateId()); } if - * (instrumentTypePropertySearchEntity.getStatusOnUpdateId() != null) { if (params.length() > 0) params.append(" and "); - * params.append( "statusOnUpdate =:statusOnUpdate"); paramValues.put("statusOnUpdate", - * instrumentTypePropertySearchEntity.getStatusOnUpdateId()); } if - * (instrumentTypePropertySearchEntity.getStatusOnReconcileId() != null) { if (params.length() > 0) params.append(" and "); - * params.append( "statusOnReconcile =:statusOnReconcile"); paramValues.put("statusOnReconcile", - * instrumentTypePropertySearchEntity.getStatusOnReconcileId()); } Pagination page = new - * Pagination<>(); if (instrumentTypePropertySearchEntity.getOffset() != null) - * page.setOffset(instrumentTypePropertySearchEntity.getOffset()); if (instrumentTypePropertySearchEntity.getPageSize() != - * null) page.setPageSize(instrumentTypePropertySearchEntity.getPageSize()); if (params.length() > 0) { searchQuery = - * searchQuery.replace(":condition", " where " + params.toString()); } else { searchQuery = searchQuery.replace(":condition", - * ""); } searchQuery = searchQuery.replace(":orderby", orderBy); page = (Pagination) - * getPagination(searchQuery, page, paramValues); searchQuery = searchQuery + " :pagination"; searchQuery = - * searchQuery.replace(":pagination", "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - * BeanPropertyRowMapper row = new BeanPropertyRowMapper(InstrumentTypePropertyEntity.class); - * List instrumentTypePropertyEntities = namedParameterJdbcTemplate - * .query(searchQuery.toString(), paramValues, row); page.setTotalResults(instrumentTypePropertyEntities.size()); - * List instrumenttypeproperties = new ArrayList<>(); for (InstrumentTypePropertyEntity - * instrumentTypePropertyEntity : instrumentTypePropertyEntities) { - * instrumenttypeproperties.add(instrumentTypePropertyEntity.toDomain()); } page.setPagedData(instrumenttypeproperties); - * return page; } - */ - - public InstrumentTypePropertyEntity findById(InstrumentTypePropertyEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) - paramValues.put(s, getValue(getField(entity, s), entity)); - - List instrumenttypeproperties = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(InstrumentTypePropertyEntity.class)); - if (instrumenttypeproperties.isEmpty()) - return null; - else - return instrumenttypeproperties.get(0); - - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentVoucherJdbcRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentVoucherJdbcRepository.java deleted file mode 100644 index 8160e491567..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/InstrumentVoucherJdbcRepository.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.domain.model.InstrumentVoucherSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentVoucherEntity; -import org.egov.egf.instrument.persistence.entity.InstrumentVoucherSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class InstrumentVoucherJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(InstrumentVoucherJdbcRepository.class); - - static { - LOG.debug("init instrumentVoucher"); - init(InstrumentVoucherEntity.class); - LOG.debug("end init instrumentVoucher"); - } - - public InstrumentVoucherJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - @Override - public void delete(final String tenantId, final String instrumentId) { - super.delete(InstrumentVoucherEntity.TABLE_NAME, tenantId, "instrumentId", instrumentId); - } - - public InstrumentVoucherEntity create(InstrumentVoucherEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public InstrumentVoucherEntity update(InstrumentVoucherEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(InstrumentVoucherSearch domain) { - InstrumentVoucherSearchEntity instrumentVoucherSearchEntity = new InstrumentVoucherSearchEntity(); - instrumentVoucherSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (instrumentVoucherSearchEntity.getSortBy() != null && !instrumentVoucherSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(instrumentVoucherSearchEntity.getSortBy()); - validateEntityFieldName(instrumentVoucherSearchEntity.getSortBy(), InstrumentVoucherEntity.class); - } - - String orderBy = "order by id"; - if (instrumentVoucherSearchEntity.getSortBy() != null && !instrumentVoucherSearchEntity.getSortBy().isEmpty()) - orderBy = "order by " + instrumentVoucherSearchEntity.getSortBy(); - - searchQuery = searchQuery.replace(":tablename", InstrumentVoucherEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (instrumentVoucherSearchEntity.getTenantId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", instrumentVoucherSearchEntity.getTenantId()); - } - - if (instrumentVoucherSearchEntity.getInstruments() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("instrumentId in (:instruments)"); - paramValues.put("instruments", - new ArrayList(Arrays.asList(instrumentVoucherSearchEntity.getInstruments().split(",")))); - } - - if (instrumentVoucherSearchEntity.getReceiptIds() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("receiptHeaderId in (:receiptIds)"); - paramValues.put("receiptIds", - new ArrayList(Arrays.asList(instrumentVoucherSearchEntity.getReceiptIds().split(",")))); - } - - Pagination page = new Pagination<>(); - if (instrumentVoucherSearchEntity.getOffset() != null) - page.setOffset(instrumentVoucherSearchEntity.getOffset()); - if (instrumentVoucherSearchEntity.getPageSize() != null) - page.setPageSize(instrumentVoucherSearchEntity.getPageSize()); - - if (params.length() > 0) - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(InstrumentVoucherEntity.class); - - List instrumentVoucherEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(instrumentVoucherEntities.size()); - - List instrumentVouchers = new ArrayList<>(); - for (InstrumentVoucherEntity instrumentVoucherEntity : instrumentVoucherEntities) { - instrumentVouchers.add(instrumentVoucherEntity.toDomain()); - } - page.setPagedData(instrumentVouchers); - - return page; - } - - public InstrumentVoucherEntity findById(InstrumentVoucherEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) - paramValues.put(s, getValue(getField(entity, s), entity)); - - List instrumentvouchers = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(InstrumentVoucherEntity.class)); - if (instrumentvouchers.isEmpty()) - return null; - else - return instrumentvouchers.get(0); - - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/SurrenderReasonJdbcRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/SurrenderReasonJdbcRepository.java deleted file mode 100644 index eeffb9128a2..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/persistence/repository/SurrenderReasonJdbcRepository.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.persistence.entity.SurrenderReasonEntity; -import org.egov.egf.instrument.persistence.entity.SurrenderReasonSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class SurrenderReasonJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(SurrenderReasonJdbcRepository.class); - - static { - LOG.debug("init surrenderReason"); - init(SurrenderReasonEntity.class); - LOG.debug("end init surrenderReason"); - } - - public SurrenderReasonJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, JdbcTemplate jdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - this.jdbcTemplate = jdbcTemplate; - } - - public SurrenderReasonEntity create(SurrenderReasonEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public SurrenderReasonEntity update(SurrenderReasonEntity entity) { - super.update(entity); - return entity; - - } - - public SurrenderReasonEntity delete(SurrenderReasonEntity entity) { - super.delete(SurrenderReasonEntity.TABLE_NAME, entity.getId()); - return entity; - } - - public Pagination search(SurrenderReasonSearch domain) { - SurrenderReasonSearchEntity surrenderReasonSearchEntity = new SurrenderReasonSearchEntity(); - surrenderReasonSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (surrenderReasonSearchEntity.getSortBy() != null && !surrenderReasonSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(surrenderReasonSearchEntity.getSortBy()); - validateEntityFieldName(surrenderReasonSearchEntity.getSortBy(), SurrenderReasonEntity.class); - } - - String orderBy = "order by id"; - if (surrenderReasonSearchEntity.getSortBy() != null && !surrenderReasonSearchEntity.getSortBy().isEmpty()) - orderBy = "order by " + surrenderReasonSearchEntity.getSortBy(); - - searchQuery = searchQuery.replace(":tablename", SurrenderReasonEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (surrenderReasonSearchEntity.getTenantId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", surrenderReasonSearchEntity.getTenantId()); - } - if (surrenderReasonSearchEntity.getId() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id =:id"); - paramValues.put("id", surrenderReasonSearchEntity.getId()); - } - if (surrenderReasonSearchEntity.getName() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("name =:name"); - paramValues.put("name", surrenderReasonSearchEntity.getName()); - } - if (surrenderReasonSearchEntity.getDescription() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("description =:description"); - paramValues.put("description", surrenderReasonSearchEntity.getDescription()); - } - if (surrenderReasonSearchEntity.getIds() != null) { - if (params.length() > 0) - params.append(" and "); - params.append("id in (:ids)"); - paramValues.put("ids", surrenderReasonSearchEntity.getIds()); - } - - Pagination page = new Pagination<>(); - if (surrenderReasonSearchEntity.getOffset() != null) - page.setOffset(surrenderReasonSearchEntity.getOffset()); - if (surrenderReasonSearchEntity.getPageSize() != null) - page.setPageSize(surrenderReasonSearchEntity.getPageSize()); - - if (params.length() > 0) - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(SurrenderReasonEntity.class); - - List surrenderReasonEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(surrenderReasonEntities.size()); - - List surrenderreasons = new ArrayList<>(); - for (SurrenderReasonEntity surrenderReasonEntity : surrenderReasonEntities) - surrenderreasons.add(surrenderReasonEntity.toDomain()); - page.setPagedData(surrenderreasons); - - return page; - } - - public SurrenderReasonEntity findById(SurrenderReasonEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) - paramValues.put(s, getValue(getField(entity, s), entity)); - - List surrenderreasons = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(SurrenderReasonEntity.class)); - if (surrenderreasons.isEmpty()) - return null; - else - return surrenderreasons.get(0); - - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/advice/CustomControllerAdvice.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/advice/CustomControllerAdvice.java deleted file mode 100644 index ec134139001..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/advice/CustomControllerAdvice.java +++ /dev/null @@ -1,129 +0,0 @@ -package org.egov.egf.instrument.web.advice; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.response.Error; -import org.egov.common.contract.response.ErrorField; -import org.egov.common.contract.response.ErrorResponse; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.exception.UnauthorizedAccessException; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.MissingServletRequestParameterException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@ControllerAdvice -@RestController -public class CustomControllerAdvice { - - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ExceptionHandler(MissingServletRequestParameterException.class) - public String handleMissingParamsError(Exception ex) { - return ex.getMessage(); - } - - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ExceptionHandler(CustomBindException.class) - public ErrorResponse handleBindingErrors(CustomBindException ex) { - ErrorResponse errRes = new ErrorResponse(); - BindingResult errors = ex.getErrors(); - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.BAD_REQUEST.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - - if (errors.getGlobalError() != null) { - error.setCode(Integer.valueOf(errors.getGlobalError().getCode())); - error.setMessage(errors.getGlobalError().getObjectName()); - error.setDescription(errors.getGlobalError().getDefaultMessage()); - } else if (errors.getFieldErrorCount() > 0) - error.setDescription("Missing fields"); - if (errors.hasFieldErrors()) { - error.setFields(new ArrayList()); - List fieldErrors = errors.getFieldErrors(); - for (org.springframework.validation.FieldError errs : fieldErrors) { - ErrorField f = new ErrorField(errs.getCode(), errs.getDefaultMessage(), errs.getField()); - error.getFields().add(f); - - } - } - errRes.setError(error); - return errRes; - } - - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ExceptionHandler(InvalidDataException.class) - public ErrorResponse handleBindingErrors(InvalidDataException ex) { - ErrorResponse errRes = new ErrorResponse(); - - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.BAD_REQUEST.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - error.setCode(Integer.valueOf(InvalidDataException.code)); - error.setMessage(ex.getFieldName()); - error.setDescription(ex.getMessage()); - errRes.setError(error); - - return errRes; - } - - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ExceptionHandler(Throwable.class) - public ErrorResponse handleThrowable(Exception ex) { - ErrorResponse errRes = new ErrorResponse(); - ex.printStackTrace(); - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.BAD_REQUEST.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - - error.setCode(500); - error.setMessage("Internal Server Error"); - error.setDescription(ex.getMessage()); - return errRes; - } - - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ExceptionHandler(Exception.class) - public ErrorResponse handleServerError(Exception ex) { - ex.printStackTrace(); - ErrorResponse errRes = new ErrorResponse(); - - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - - error.setCode(500); - error.setMessage("Internal Server Error"); - error.setDescription(ex.getMessage()); - errRes.setError(error); - return errRes; - } - - @ResponseStatus(HttpStatus.UNAUTHORIZED) - @ExceptionHandler(UnauthorizedAccessException.class) - public ErrorResponse handleAuthenticationError(UnauthorizedAccessException ex) { - ex.printStackTrace(); - ErrorResponse errRes = new ErrorResponse(); - - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.UNAUTHORIZED.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - - error.setCode(404); - error.setMessage("Un Authorized Access"); - error.setDescription(ex.getMessage()); - errRes.setError(error); - return errRes; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/DishonorReasonContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/DishonorReasonContract.java deleted file mode 100644 index 0042d0d2613..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/DishonorReasonContract.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; -import org.egov.egf.instrument.domain.model.Instrument; -import org.hibernate.validator.constraints.NotBlank; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "reason", "remarks", "instrument", "reversalVoucherId", "dishonorDate" }) -public class DishonorReasonContract extends AuditableContract { - /** - * id is the unique Identifier of the reason - */ - private String id; - /** - * name is the reason of instrument surrender. Example "Damaged cheque","Cheque to be scrapped" etc - */ - @NotBlank - @Size(max = 100, min = 5) - private String reason; - /** - * description is detailed description of the surrender of a instrument - */ - @NotBlank - @Size(max = 250) - private String remarks; - @NotBlank - @Size(max = 250) - private String instrument; - private String reversalVoucherId; - @NotNull - private Long dishonorDate; - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/DishonorReasonSearchContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/DishonorReasonSearchContract.java deleted file mode 100644 index 02c7d100f5c..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/DishonorReasonSearchContract.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class DishonorReasonSearchContract extends DishonorReasonContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentAccountCodeContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentAccountCodeContract.java deleted file mode 100644 index 3cdaa4d45df..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentAccountCodeContract.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.web.contract; - -import org.egov.common.web.contract.AuditableContract; -import org.egov.egf.master.web.contract.ChartOfAccountContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "instrumentType", "accountCode" }) -public class InstrumentAccountCodeContract extends AuditableContract { - - /* - * id is the unique reference to Instrument AccountCodes entered in the system. - */ - private String id; - - /* - * instrumentType specifies the mode/type of transaction that can be made - i.e Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS - */ - private InstrumentTypeContract instrumentType; - - /* - * accountCode is the COA that is tagged to a instrument type used in ledger posting. - */ - private ChartOfAccountContract accountCode; - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentAccountCodeSearchContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentAccountCodeSearchContract.java deleted file mode 100644 index dcdca88040b..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentAccountCodeSearchContract.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentAccountCodeSearchContract extends InstrumentAccountCodeContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentContract.java deleted file mode 100644 index ab13ae24d02..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentContract.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.web.contract; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.hibernate.validator.constraints.NotBlank; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "transactionNumber", "transactionDate", "amount", "instrumentType", "bank", "branchName", - "bankAccount", "financialStatus", "remittanceVoucherId", "transactionType", "payee", "drawer", "surrendarReason", - "serialNo", - "instrumentVouchers" }) -public class InstrumentContract extends AuditableContract { - - /* - * id is the unique reference to InstrumentContract Header entered in the system. - */ - private String id; - - /* - * transactionNumber unique number of the instrument. For cheque type this is cheque date. For DD type it is DD number - */ - @NotBlank - @Size(max = 50, min = 6) - private String transactionNumber; - - /* - * transactionDate is the date of instrument . For cheque type it is cheque date. for DD it is DD date - */ - @NotNull - private Date transactionDate; - - /* - * amount is the instrument amount. For cheque type it is cheque amount. - */ - @NotNull - @Min(value = 1) - @Max(value = 999999999) - private BigDecimal amount; - - /* - * instrumentType specifies the type of the instrument - The folowing are the different types Cash,Cheque,DD,POC - */ - private InstrumentTypeContract instrumentType; - - /* - * bank references to the bank from which the payment/Receipt is made. - */ - private BankContract bank; - - /* - * branchName is the branch name entered in the collection Receipt. - */ - - @Size(max = 50) - private String branchName; - - /* - * bankAccount is the reference of the Bank account from which the payment instrument is assigned - */ - private BankAccountContract bankAccount; - - /* - * instrumentStatus gives the current status of the instrument. - */ - private FinancialStatusContract financialStatus; - - private String remittanceVoucherId; - - /* - * transactionType are of two kinds -Debit and Credit. When its a receipt instrument it is Debit and in case of payment - * instrument its credit. - */ - @NotNull - private TransactionTypeContract transactionType; - - /* - * payee is the entity who is making the payment via instrument - */ - @Size(max = 50) - private String payee; - - /* - * drawer is the entity to which the payment is made. - */ - @Size(max = 100) - private String drawer; - - /* - * surrenderReason is the reason from the defined list seleted while surrendering a payment cheque. Depending on the reason, - * the cheque can be re-used or not is decided. - */ - private SurrenderReasonContract surrenderReason; - - private DishonorReasonContract dishonor; - - /* - * serialNo is the series of the cheque numbers from which the instrument is assigned from. The cheque numbers in an account - * is defined based on Year, Bank account and tagged to a department. - */ - @NotBlank - @Size(max = 50, min = 2) - private String serialNo; - - private String payinSlipId; - - @Min(value = 1) - @Max(value = 999999999) - private BigDecimal reconciledAmount; - - private Date reconciledOn; - - /* - * instrumentVouchers is the reference to the payment vouchers for which the instrument is attached. - */ - private List instrumentVouchers = new ArrayList<>(); - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentSearchContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentSearchContract.java deleted file mode 100644 index 976d3af9a88..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentSearchContract.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentSearchContract extends InstrumentContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String instrumentTypes; - private String receiptIds; - private String financialStatuses; - private Date transactionFromDate; - private Date transactionToDate; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypeContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypeContract.java deleted file mode 100644 index 1804330ad71..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypeContract.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.web.contract; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.NotBlank; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "description", "active", "instrumentTypeProperties" }) -public class InstrumentTypeContract extends AuditableContract { - - /* - * id is the unique reference to instrument type entered in the system. - */ - private String id; - - /* - * type specifies the mode/type of transaction that can be made - i.e Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS - */ - @NotNull - @NotBlank - @Size(max = 50, min = 2) - private String name; - - /* - * description specifies details of the instrument type . For example type DD description may be Demand Draft - */ - - @Size(max = 100) - private String description; - - /* - * active specifies whether the type is active for transacting. - */ - @NotNull - private Boolean active; - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypePropertyContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypePropertyContract.java deleted file mode 100644 index ad15f1c3389..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypePropertyContract.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.egov.egf.master.web.contract.FinancialStatusContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "transactionType", "reconciledOncreate", "statusOnCreate", "statusOnUpdate", "statusOnReconcile" }) -public class InstrumentTypePropertyContract extends AuditableContract { - - private String id; - @NotNull - private TransactionTypeContract transactionType; - @NotNull - private Boolean reconciledOncreate; - @NotNull - private FinancialStatusContract statusOnCreate; - @NotNull - private FinancialStatusContract statusOnUpdate; - @NotNull - private FinancialStatusContract statusOnReconcile; - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypeSearchContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypeSearchContract.java deleted file mode 100644 index 2be4f7eac68..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentTypeSearchContract.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentTypeSearchContract extends InstrumentTypeContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentVoucherContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentVoucherContract.java deleted file mode 100644 index 2199ed62e9c..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/InstrumentVoucherContract.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.instrument.web.contract; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "instrument", "voucherHeaderId", "receiptHeaderId" }) -public class InstrumentVoucherContract extends AuditableContract { - - /* - * instrumentHeaderId is the reference of the instrument attached to a voucher - */ - private String instrument; - - /* - * voucherHeaderId is the reference of the voucher attached to a instrument. - */ - private String voucherHeaderId; - - /* - * receiptHeaderId is the reference of the receipt attached to a instrument. - */ - private String receiptHeaderId; - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/SurrenderReasonContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/SurrenderReasonContract.java deleted file mode 100644 index 89d8ae6aeaf..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/SurrenderReasonContract.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.NotBlank; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "description" }) -public class SurrenderReasonContract extends AuditableContract { - /** - * id is the unique Identifier of the reason - */ - private String id; - /** - * name is the reason of instrument surrender. Example "Damaged cheque","Cheque to be scrapped" etc - */ - @NotBlank - @Size(max = 50, min = 5) - private String name; - /** - * description is detailed description of the surrender of a instrument - */ - @NotBlank - @Size(max = 250) - private String description; - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/SurrenderReasonSearchContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/SurrenderReasonSearchContract.java deleted file mode 100644 index 3ec169340ee..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/SurrenderReasonSearchContract.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SurrenderReasonSearchContract extends SurrenderReasonContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/TransactionTypeContract.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/TransactionTypeContract.java deleted file mode 100644 index f0dc8098dd3..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/contract/TransactionTypeContract.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.egov.egf.instrument.web.contract; - -public enum TransactionTypeContract { - Debit, Credit -} diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentAccountCodeController.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentAccountCodeController.java deleted file mode 100644 index 2f0ff88912b..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentAccountCodeController.java +++ /dev/null @@ -1,182 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.domain.service.InstrumentAccountCodeService; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeSearchContract; -import org.egov.egf.instrument.web.mapper.InstrumentAccountCodeMapper; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeRequest; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/instrumentaccountcodes") -public class InstrumentAccountCodeController { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String PLACEHOLDER = "placeholder"; - - @Autowired - private InstrumentAccountCodeService instrumentAccountCodeService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentAccountCodeResponse create(@RequestBody InstrumentAccountCodeRequest instrumentAccountCodeRequest, - BindingResult errors) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - InstrumentAccountCodeResponse instrumentAccountCodeResponse = new InstrumentAccountCodeResponse(); - instrumentAccountCodeResponse.setResponseInfo(getResponseInfo(instrumentAccountCodeRequest.getRequestInfo())); - List instrumentaccountcodes = new ArrayList<>(); - InstrumentAccountCode instrumentAccountCode; - List instrumentAccountCodeContracts = new ArrayList<>(); - InstrumentAccountCodeContract contract; - - instrumentAccountCodeRequest.getRequestInfo().setAction(ACTION_CREATE); - - for (InstrumentAccountCodeContract instrumentAccountCodeContract : instrumentAccountCodeRequest - .getInstrumentAccountCodes()) { - instrumentAccountCode = mapper.toDomain(instrumentAccountCodeContract); - instrumentAccountCode.setCreatedDate(new Date()); - instrumentAccountCode.setCreatedBy(instrumentAccountCodeRequest.getRequestInfo().getUserInfo()); - instrumentAccountCode.setLastModifiedBy(instrumentAccountCodeRequest.getRequestInfo().getUserInfo()); - instrumentaccountcodes.add(instrumentAccountCode); - } - - instrumentaccountcodes = instrumentAccountCodeService.create(instrumentaccountcodes, errors, - instrumentAccountCodeRequest.getRequestInfo()); - - for (InstrumentAccountCode iac : instrumentaccountcodes) { - contract = mapper.toContract(iac); - instrumentAccountCodeContracts.add(contract); - } - - instrumentAccountCodeResponse.setInstrumentAccountCodes(instrumentAccountCodeContracts); - - return instrumentAccountCodeResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentAccountCodeResponse update(@RequestBody InstrumentAccountCodeRequest instrumentAccountCodeRequest, - BindingResult errors) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - instrumentAccountCodeRequest.getRequestInfo().setAction(ACTION_UPDATE); - InstrumentAccountCodeResponse instrumentAccountCodeResponse = new InstrumentAccountCodeResponse(); - List instrumentaccountcodes = new ArrayList<>(); - instrumentAccountCodeResponse.setResponseInfo(getResponseInfo(instrumentAccountCodeRequest.getRequestInfo())); - InstrumentAccountCode instrumentAccountCode; - InstrumentAccountCodeContract contract; - List instrumentAccountCodeContracts = new ArrayList<>(); - - for (InstrumentAccountCodeContract instrumentAccountCodeContract : instrumentAccountCodeRequest - .getInstrumentAccountCodes()) { - instrumentAccountCode = mapper.toDomain(instrumentAccountCodeContract); - instrumentAccountCode.setLastModifiedBy(instrumentAccountCodeRequest.getRequestInfo().getUserInfo()); - instrumentAccountCode.setLastModifiedDate(new Date()); - instrumentaccountcodes.add(instrumentAccountCode); - } - - instrumentaccountcodes = instrumentAccountCodeService.update(instrumentaccountcodes, errors, - instrumentAccountCodeRequest.getRequestInfo()); - - for (InstrumentAccountCode iac : instrumentaccountcodes) { - contract = mapper.toContract(iac); - instrumentAccountCodeContracts.add(contract); - } - - instrumentAccountCodeResponse.setInstrumentAccountCodes(instrumentAccountCodeContracts); - - return instrumentAccountCodeResponse; - } - - @PostMapping("/_delete") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentAccountCodeResponse delete(@RequestBody InstrumentAccountCodeRequest instrumentAccountCodeRequest, - BindingResult errors) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - instrumentAccountCodeRequest.getRequestInfo().setAction(ACTION_DELETE); - InstrumentAccountCodeResponse instrumentAccountCodeResponse = new InstrumentAccountCodeResponse(); - List instrumentaccountcodes = new ArrayList<>(); - instrumentAccountCodeResponse.setResponseInfo(getResponseInfo(instrumentAccountCodeRequest.getRequestInfo())); - InstrumentAccountCode instrumentAccountCode; - InstrumentAccountCodeContract contract; - List instrumentAccountCodeContracts = new ArrayList<>(); - - for (InstrumentAccountCodeContract instrumentAccountCodeContract : instrumentAccountCodeRequest - .getInstrumentAccountCodes()) { - instrumentAccountCode = mapper.toDomain(instrumentAccountCodeContract); - instrumentaccountcodes.add(instrumentAccountCode); - } - - instrumentaccountcodes = instrumentAccountCodeService.delete(instrumentaccountcodes, errors, - instrumentAccountCodeRequest.getRequestInfo()); - - for (InstrumentAccountCode iac : instrumentaccountcodes) { - contract = mapper.toContract(iac); - instrumentAccountCodeContracts.add(contract); - } - - instrumentAccountCodeResponse.setInstrumentAccountCodes(instrumentAccountCodeContracts); - - return instrumentAccountCodeResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public InstrumentAccountCodeResponse search( - @ModelAttribute InstrumentAccountCodeSearchContract instrumentAccountCodeSearchContract, - RequestInfo requestInfo, BindingResult errors) { - - InstrumentAccountCodeMapper mapper = new InstrumentAccountCodeMapper(); - InstrumentAccountCodeSearch domain = mapper.toSearchDomain(instrumentAccountCodeSearchContract); - InstrumentAccountCodeContract contract; - List instrumentAccountCodeContracts = new ArrayList<>(); - Pagination instrumentaccountcodes = instrumentAccountCodeService.search(domain); - - if (instrumentaccountcodes.getPagedData() != null) - for (InstrumentAccountCode instrumentAccountCode : instrumentaccountcodes.getPagedData()) { - contract = mapper.toContract(instrumentAccountCode); - instrumentAccountCodeContracts.add(contract); - } - - InstrumentAccountCodeResponse response = new InstrumentAccountCodeResponse(); - response.setInstrumentAccountCodes(instrumentAccountCodeContracts); - response.setPage(new PaginationContract(instrumentaccountcodes)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .ts(new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").format(new Date())).resMsgId(requestInfo.getMsgId()) - .resMsgId(PLACEHOLDER).status(PLACEHOLDER).build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentController.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentController.java deleted file mode 100644 index 3c0f4785a02..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentController.java +++ /dev/null @@ -1,220 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.service.InstrumentService; -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.egov.egf.instrument.web.contract.InstrumentSearchContract; -import org.egov.egf.instrument.web.mapper.InstrumentMapper; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.egf.instrument.web.requests.InstrumentResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/instruments") -public class InstrumentController { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String PLACEHOLDER = "placeholder"; - - @Autowired - private InstrumentService instrumentService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentResponse create(@RequestBody InstrumentRequest instrumentRequest, BindingResult errors) { - - InstrumentMapper mapper = new InstrumentMapper(); - InstrumentResponse instrumentResponse = new InstrumentResponse(); - instrumentResponse.setResponseInfo(getResponseInfo(instrumentRequest.getRequestInfo())); - List instruments = new ArrayList<>(); - Instrument instrument; - List instrumentContracts = new ArrayList<>(); - InstrumentContract contract; - - instrumentRequest.getRequestInfo().setAction(ACTION_CREATE); - - for (InstrumentContract instrumentContract : instrumentRequest.getInstruments()) { - instrument = mapper.toDomain(instrumentContract); - instrument.setCreatedDate(new Date()); - instrument.setCreatedBy(instrumentRequest.getRequestInfo().getUserInfo()); - instrument.setLastModifiedBy(instrumentRequest.getRequestInfo().getUserInfo()); - instruments.add(instrument); - } - - instruments = instrumentService.create(instruments, errors, instrumentRequest.getRequestInfo()); - - for (Instrument i : instruments) { - contract = mapper.toContract(i); - instrumentContracts.add(contract); - } - - instrumentResponse.setInstruments(instrumentContracts); - - return instrumentResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentResponse update(@RequestBody InstrumentRequest instrumentRequest, BindingResult errors) { - - InstrumentMapper mapper = new InstrumentMapper(); - instrumentRequest.getRequestInfo().setAction(ACTION_UPDATE); - InstrumentResponse instrumentResponse = new InstrumentResponse(); - List instruments = new ArrayList<>(); - instrumentResponse.setResponseInfo(getResponseInfo(instrumentRequest.getRequestInfo())); - Instrument instrument; - InstrumentContract contract; - List instrumentContracts = new ArrayList<>(); - - for (InstrumentContract instrumentContract : instrumentRequest.getInstruments()) { - instrument = mapper.toDomain(instrumentContract); - instrument.setLastModifiedBy(instrumentRequest.getRequestInfo().getUserInfo()); - instrument.setLastModifiedDate(new Date()); - instruments.add(instrument); - } - - instruments = instrumentService.update(instruments, errors, instrumentRequest.getRequestInfo()); - - for (Instrument i : instruments) { - contract = mapper.toContract(i); - instrumentContracts.add(contract); - } - - instrumentResponse.setInstruments(instrumentContracts); - - return instrumentResponse; - } - - @PostMapping("/_delete") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentResponse delete(@RequestBody InstrumentRequest instrumentRequest, BindingResult errors) { - - InstrumentMapper mapper = new InstrumentMapper(); - instrumentRequest.getRequestInfo().setAction(ACTION_DELETE); - InstrumentResponse instrumentResponse = new InstrumentResponse(); - List instruments = new ArrayList<>(); - instrumentResponse.setResponseInfo(getResponseInfo(instrumentRequest.getRequestInfo())); - Instrument instrument; - InstrumentContract contract; - List instrumentContracts = new ArrayList<>(); - - for (InstrumentContract instrumentContract : instrumentRequest.getInstruments()) { - instrument = mapper.toDomain(instrumentContract); - instruments.add(instrument); - } - - instruments = instrumentService.delete(instruments, errors, instrumentRequest.getRequestInfo()); - - for (Instrument i : instruments) { - contract = mapper.toContract(i); - instrumentContracts.add(contract); - } - - instrumentResponse.setInstruments(instrumentContracts); - - return instrumentResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public InstrumentResponse search(@ModelAttribute InstrumentSearchContract instrumentSearchContract, - RequestInfo requestInfo, BindingResult errors) { - - InstrumentMapper mapper = new InstrumentMapper(); - InstrumentSearch domain = mapper.toSearchDomain(instrumentSearchContract); - InstrumentContract contract; - List instrumentContracts = new ArrayList<>(); - Pagination instruments = instrumentService.search(domain); - - if (instruments.getPagedData() != null) - for (Instrument instrument : instruments.getPagedData()) { - contract = mapper.toContract(instrument); - instrumentContracts.add(contract); - } - - InstrumentResponse response = new InstrumentResponse(); - response.setInstruments(instrumentContracts); - response.setPage(new PaginationContract(instruments)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - @PostMapping("/_deposit") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentResponse depositInstrument(@RequestBody InstrumentRequest instrumentDepositRequest, BindingResult errors) { - - InstrumentMapper mapper = new InstrumentMapper(); - InstrumentResponse instrumentResponse = new InstrumentResponse(); - instrumentResponse.setResponseInfo(getResponseInfo(instrumentDepositRequest.getRequestInfo())); - List instruments = new ArrayList<>(); - List instrumentContracts = new ArrayList<>(); - InstrumentContract contract; - - instrumentDepositRequest.getRequestInfo().setAction(ACTION_UPDATE); - - instruments = instrumentService.deposit(instrumentDepositRequest, errors, instrumentDepositRequest.getRequestInfo()); - - for (Instrument i : instruments) { - contract = mapper.toContract(i); - instrumentContracts.add(contract); - } - - instrumentResponse.setInstruments(instrumentContracts); - - return instrumentResponse; - } - - @PostMapping("/_dishonor") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentResponse dishonorInstrument(@RequestBody InstrumentRequest instrumentDepositRequest, BindingResult errors) { - - InstrumentMapper mapper = new InstrumentMapper(); - InstrumentResponse instrumentResponse = new InstrumentResponse(); - instrumentResponse.setResponseInfo(getResponseInfo(instrumentDepositRequest.getRequestInfo())); - List instruments = new ArrayList<>(); - List instrumentContracts = new ArrayList<>(); - InstrumentContract contract; - - instrumentDepositRequest.getRequestInfo().setAction(ACTION_UPDATE); - - instruments = instrumentService.dishonor(instrumentDepositRequest, errors, instrumentDepositRequest.getRequestInfo()); - - for (Instrument i : instruments) { - contract = mapper.toContract(i); - instrumentContracts.add(contract); - } - - instrumentResponse.setInstruments(instrumentContracts); - - return instrumentResponse; - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId(PLACEHOLDER).status(PLACEHOLDER).build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentTypeController.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentTypeController.java deleted file mode 100644 index b1caacd7f12..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/InstrumentTypeController.java +++ /dev/null @@ -1,173 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.domain.service.InstrumentTypeService; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeSearchContract; -import org.egov.egf.instrument.web.mapper.InstrumentTypeMapper; -import org.egov.egf.instrument.web.requests.InstrumentTypeRequest; -import org.egov.egf.instrument.web.requests.InstrumentTypeResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/instrumenttypes") -public class InstrumentTypeController { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String PLACEHOLDER = "placeholder"; - - @Autowired - private InstrumentTypeService instrumentTypeService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentTypeResponse create(@RequestBody InstrumentTypeRequest instrumentTypeRequest, - BindingResult errors) { - - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - InstrumentTypeResponse instrumentTypeResponse = new InstrumentTypeResponse(); - instrumentTypeResponse.setResponseInfo(getResponseInfo(instrumentTypeRequest.getRequestInfo())); - List instrumenttypes = new ArrayList<>(); - InstrumentType instrumentType; - List instrumentTypeContracts = new ArrayList<>(); - InstrumentTypeContract contract; - - instrumentTypeRequest.getRequestInfo().setAction(ACTION_CREATE); - - for (InstrumentTypeContract instrumentTypeContract : instrumentTypeRequest.getInstrumentTypes()) { - instrumentType = mapper.toDomain(instrumentTypeContract); - instrumentType.setCreatedDate(new Date()); - instrumentType.setCreatedBy(instrumentTypeRequest.getRequestInfo().getUserInfo()); - instrumentType.setLastModifiedBy(instrumentTypeRequest.getRequestInfo().getUserInfo()); - instrumenttypes.add(instrumentType); - } - - instrumenttypes = instrumentTypeService.create(instrumenttypes, errors, instrumentTypeRequest.getRequestInfo()); - - for (InstrumentType it : instrumenttypes) { - contract = mapper.toContract(it); - instrumentTypeContracts.add(contract); - } - - instrumentTypeResponse.setInstrumentTypes(instrumentTypeContracts); - - return instrumentTypeResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentTypeResponse update(@RequestBody InstrumentTypeRequest instrumentTypeRequest, - BindingResult errors) { - - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - instrumentTypeRequest.getRequestInfo().setAction(ACTION_UPDATE); - InstrumentTypeResponse instrumentTypeResponse = new InstrumentTypeResponse(); - List instrumenttypes = new ArrayList<>(); - instrumentTypeResponse.setResponseInfo(getResponseInfo(instrumentTypeRequest.getRequestInfo())); - InstrumentType instrumentType; - InstrumentTypeContract contract; - List instrumentTypeContracts = new ArrayList<>(); - - for (InstrumentTypeContract instrumentTypeContract : instrumentTypeRequest.getInstrumentTypes()) { - instrumentType = mapper.toDomain(instrumentTypeContract); - instrumentType.setLastModifiedBy(instrumentTypeRequest.getRequestInfo().getUserInfo()); - instrumentType.setLastModifiedDate(new Date()); - instrumenttypes.add(instrumentType); - } - - instrumenttypes = instrumentTypeService.update(instrumenttypes, errors, instrumentTypeRequest.getRequestInfo()); - - for (InstrumentType it : instrumenttypes) { - contract = mapper.toContract(it); - instrumentTypeContracts.add(contract); - } - - instrumentTypeResponse.setInstrumentTypes(instrumentTypeContracts); - - return instrumentTypeResponse; - } - - @PostMapping("/_delete") - @ResponseStatus(HttpStatus.CREATED) - public InstrumentTypeResponse delete(@RequestBody InstrumentTypeRequest instrumentTypeRequest, - BindingResult errors) { - - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - instrumentTypeRequest.getRequestInfo().setAction(ACTION_DELETE); - InstrumentTypeResponse instrumentTypeResponse = new InstrumentTypeResponse(); - List instrumenttypes = new ArrayList<>(); - instrumentTypeResponse.setResponseInfo(getResponseInfo(instrumentTypeRequest.getRequestInfo())); - InstrumentType instrumentType; - InstrumentTypeContract contract; - List instrumentTypeContracts = new ArrayList<>(); - - for (InstrumentTypeContract instrumentTypeContract : instrumentTypeRequest.getInstrumentTypes()) { - instrumentType = mapper.toDomain(instrumentTypeContract); - instrumenttypes.add(instrumentType); - } - - instrumenttypes = instrumentTypeService.delete(instrumenttypes, errors, instrumentTypeRequest.getRequestInfo()); - - for (InstrumentType it : instrumenttypes) { - contract = mapper.toContract(it); - instrumentTypeContracts.add(contract); - } - - instrumentTypeResponse.setInstrumentTypes(instrumentTypeContracts); - - return instrumentTypeResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public InstrumentTypeResponse search(@ModelAttribute InstrumentTypeSearchContract instrumentTypeSearchContract, - RequestInfo requestInfo, BindingResult errors) { - - InstrumentTypeMapper mapper = new InstrumentTypeMapper(); - InstrumentTypeSearch domain = mapper.toSearchDomain(instrumentTypeSearchContract); - InstrumentTypeContract contract; - List instrumentTypeContracts = new ArrayList<>(); - Pagination instrumenttypes = instrumentTypeService.search(domain); - - if (instrumenttypes.getPagedData() != null) - for (InstrumentType instrumentType : instrumenttypes.getPagedData()) { - contract = mapper.toContract(instrumentType); - instrumentTypeContracts.add(contract); - } - - InstrumentTypeResponse response = new InstrumentTypeResponse(); - response.setInstrumentTypes(instrumentTypeContracts); - response.setPage(new PaginationContract(instrumenttypes)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId(PLACEHOLDER).status(PLACEHOLDER).build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/SurrenderReasonController.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/SurrenderReasonController.java deleted file mode 100644 index 25773b72a9a..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/controller/SurrenderReasonController.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.domain.service.SurrenderReasonService; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonSearchContract; -import org.egov.egf.instrument.web.mapper.SurrenderReasonMapper; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.egov.egf.instrument.web.requests.SurrenderReasonResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/surrenderreasons") -public class SurrenderReasonController { - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_DELETE = "delete"; - public static final String PLACEHOLDER = "placeholder"; - - @Autowired - private SurrenderReasonService surrenderReasonService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public SurrenderReasonResponse create(@RequestBody SurrenderReasonRequest surrenderReasonRequest, - BindingResult errors) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - SurrenderReasonResponse surrenderReasonResponse = new SurrenderReasonResponse(); - surrenderReasonResponse.setResponseInfo(getResponseInfo(surrenderReasonRequest.getRequestInfo())); - List surrenderreasons = new ArrayList<>(); - SurrenderReason surrenderReason; - List surrenderReasonContracts = new ArrayList<>(); - SurrenderReasonContract contract; - - surrenderReasonRequest.getRequestInfo().setAction(ACTION_CREATE); - - for (SurrenderReasonContract surrenderReasonContract : surrenderReasonRequest.getSurrenderReasons()) { - surrenderReason = mapper.toDomain(surrenderReasonContract); - surrenderReason.setCreatedDate(new Date()); - surrenderReason.setCreatedBy(surrenderReasonRequest.getRequestInfo().getUserInfo()); - surrenderReason.setLastModifiedBy(surrenderReasonRequest.getRequestInfo().getUserInfo()); - surrenderreasons.add(surrenderReason); - } - - surrenderreasons = surrenderReasonService.create(surrenderreasons, errors, - surrenderReasonRequest.getRequestInfo()); - - for (SurrenderReason sr : surrenderreasons) { - contract = mapper.toContract(sr); - surrenderReasonContracts.add(contract); - } - - surrenderReasonResponse.setSurrenderReasons(surrenderReasonContracts); - - return surrenderReasonResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public SurrenderReasonResponse update(@RequestBody SurrenderReasonRequest surrenderReasonRequest, - BindingResult errors) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - surrenderReasonRequest.getRequestInfo().setAction(ACTION_UPDATE); - SurrenderReasonResponse surrenderReasonResponse = new SurrenderReasonResponse(); - List surrenderreasons = new ArrayList<>(); - surrenderReasonResponse.setResponseInfo(getResponseInfo(surrenderReasonRequest.getRequestInfo())); - SurrenderReason surrenderReason; - SurrenderReasonContract contract; - List surrenderReasonContracts = new ArrayList<>(); - - for (SurrenderReasonContract surrenderReasonContract : surrenderReasonRequest.getSurrenderReasons()) { - surrenderReason = mapper.toDomain(surrenderReasonContract); - surrenderReason.setLastModifiedBy(surrenderReasonRequest.getRequestInfo().getUserInfo()); - surrenderReason.setLastModifiedDate(new Date()); - surrenderreasons.add(surrenderReason); - } - - surrenderreasons = surrenderReasonService.update(surrenderreasons, errors, - surrenderReasonRequest.getRequestInfo()); - - for (SurrenderReason sr : surrenderreasons) { - contract = mapper.toContract(sr); - surrenderReasonContracts.add(contract); - } - surrenderReasonResponse.setSurrenderReasons(surrenderReasonContracts); - - return surrenderReasonResponse; - } - - @PostMapping("/_delete") - @ResponseStatus(HttpStatus.CREATED) - public SurrenderReasonResponse delete(@RequestBody SurrenderReasonRequest surrenderReasonRequest, - BindingResult errors) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - surrenderReasonRequest.getRequestInfo().setAction(ACTION_DELETE); - SurrenderReasonResponse surrenderReasonResponse = new SurrenderReasonResponse(); - List surrenderreasons = new ArrayList<>(); - surrenderReasonResponse.setResponseInfo(getResponseInfo(surrenderReasonRequest.getRequestInfo())); - SurrenderReason surrenderReason; - SurrenderReasonContract contract; - List surrenderReasonContracts = new ArrayList<>(); - - for (SurrenderReasonContract surrenderReasonContract : surrenderReasonRequest.getSurrenderReasons()) { - surrenderReason = mapper.toDomain(surrenderReasonContract); - surrenderreasons.add(surrenderReason); - } - - surrenderreasons = surrenderReasonService.delete(surrenderreasons, errors, - surrenderReasonRequest.getRequestInfo()); - - for (SurrenderReason sr : surrenderreasons) { - contract = mapper.toContract(sr); - surrenderReasonContracts.add(contract); - } - surrenderReasonResponse.setSurrenderReasons(surrenderReasonContracts); - - return surrenderReasonResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public SurrenderReasonResponse search(@ModelAttribute SurrenderReasonSearchContract surrenderReasonSearchContract, - RequestInfo requestInfo, BindingResult errors) { - - SurrenderReasonMapper mapper = new SurrenderReasonMapper(); - SurrenderReasonSearch domain = mapper.toSearchDomain(surrenderReasonSearchContract); - SurrenderReasonContract contract; - List surrenderReasonContracts = new ArrayList<>(); - Pagination surrenderreasons = surrenderReasonService.search(domain); - - if (surrenderreasons.getPagedData() != null) - for (SurrenderReason surrenderReason : surrenderreasons.getPagedData()) { - contract = mapper.toContract(surrenderReason); - surrenderReasonContracts.add(contract); - } - - SurrenderReasonResponse response = new SurrenderReasonResponse(); - response.setSurrenderReasons(surrenderReasonContracts); - response.setPage(new PaginationContract(surrenderreasons)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId(PLACEHOLDER).status(PLACEHOLDER).build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/DishonorReasonMapper.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/DishonorReasonMapper.java deleted file mode 100644 index 23c6be37c8b..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/DishonorReasonMapper.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import org.egov.egf.instrument.domain.model.DishonorReason; -import org.egov.egf.instrument.domain.model.DishonorReasonSearch; -import org.egov.egf.instrument.web.contract.DishonorReasonContract; -import org.egov.egf.instrument.web.contract.DishonorReasonSearchContract; - -public class DishonorReasonMapper { - - public DishonorReason toDomain(DishonorReasonContract contract) { - - DishonorReason dishonorReason = new DishonorReason(); - - dishonorReason.setId(contract.getId()); - dishonorReason.setReason(contract.getReason()); - dishonorReason.setRemarks(contract.getRemarks()); - dishonorReason.setCreatedBy(contract.getCreatedBy()); - dishonorReason.setCreatedDate(contract.getCreatedDate()); - dishonorReason.setLastModifiedBy(contract.getLastModifiedBy()); - dishonorReason.setLastModifiedDate(contract.getLastModifiedDate()); - dishonorReason.setTenantId(contract.getTenantId()); - - return dishonorReason; - } - - public DishonorReasonContract toContract(DishonorReason dishonorReason) { - - DishonorReasonContract contract = new DishonorReasonContract(); - - contract.setId(dishonorReason.getId()); - contract.setReason(dishonorReason.getReason()); - contract.setRemarks(dishonorReason.getRemarks()); - contract.setCreatedBy(dishonorReason.getCreatedBy()); - contract.setCreatedDate(dishonorReason.getCreatedDate()); - contract.setLastModifiedBy(dishonorReason.getLastModifiedBy()); - contract.setLastModifiedDate(dishonorReason.getLastModifiedDate()); - contract.setTenantId(dishonorReason.getTenantId()); - - return contract; - } - - public DishonorReasonSearch toSearchDomain(DishonorReasonSearchContract contract) { - - DishonorReasonSearch dishonorReasonSearch = new DishonorReasonSearch(); - - dishonorReasonSearch.setId(contract.getId()); - dishonorReasonSearch.setReason(contract.getReason()); - dishonorReasonSearch.setRemarks(contract.getRemarks()); - dishonorReasonSearch.setCreatedBy(contract.getCreatedBy()); - dishonorReasonSearch.setCreatedDate(contract.getCreatedDate()); - dishonorReasonSearch.setLastModifiedBy(contract.getLastModifiedBy()); - dishonorReasonSearch.setLastModifiedDate(contract.getLastModifiedDate()); - dishonorReasonSearch.setTenantId(contract.getTenantId()); - dishonorReasonSearch.setPageSize(contract.getPageSize()); - dishonorReasonSearch.setOffset(contract.getOffset()); - dishonorReasonSearch.setSortBy(contract.getSortBy()); - dishonorReasonSearch.setIds(contract.getIds()); - - return dishonorReasonSearch; - } - - public DishonorReasonSearchContract toSearchContract(DishonorReasonSearch dishonorReasonSearch) { - - DishonorReasonSearchContract contract = new DishonorReasonSearchContract(); - - contract.setId(dishonorReasonSearch.getId()); - contract.setReason(dishonorReasonSearch.getReason()); - contract.setRemarks(dishonorReasonSearch.getRemarks()); - contract.setCreatedBy(dishonorReasonSearch.getCreatedBy()); - contract.setCreatedDate(dishonorReasonSearch.getCreatedDate()); - contract.setLastModifiedBy(dishonorReasonSearch.getLastModifiedBy()); - contract.setLastModifiedDate(dishonorReasonSearch.getLastModifiedDate()); - contract.setTenantId(dishonorReasonSearch.getTenantId()); - contract.setPageSize(dishonorReasonSearch.getPageSize()); - contract.setOffset(dishonorReasonSearch.getOffset()); - contract.setSortBy(dishonorReasonSearch.getSortBy()); - contract.setIds(dishonorReasonSearch.getIds()); - - return contract; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentAccountCodeMapper.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentAccountCodeMapper.java deleted file mode 100644 index d55e96cd5f8..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentAccountCodeMapper.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeSearchContract; - -public class InstrumentAccountCodeMapper { - - private InstrumentTypeMapper typeMapper = new InstrumentTypeMapper(); - - public InstrumentAccountCode toDomain(InstrumentAccountCodeContract contract) { - - InstrumentAccountCode instrumentAccountCode = new InstrumentAccountCode(); - - instrumentAccountCode.setId(contract.getId()); - - if (contract.getInstrumentType() != null) - instrumentAccountCode.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); - - if (contract.getAccountCode() != null) - instrumentAccountCode.setAccountCode(contract.getAccountCode()); - - instrumentAccountCode.setCreatedBy(contract.getCreatedBy()); - instrumentAccountCode.setCreatedDate(contract.getCreatedDate()); - instrumentAccountCode.setLastModifiedBy(contract.getLastModifiedBy()); - instrumentAccountCode.setLastModifiedDate(contract.getLastModifiedDate()); - instrumentAccountCode.setTenantId(contract.getTenantId()); - - return instrumentAccountCode; - } - - public InstrumentAccountCodeContract toContract(InstrumentAccountCode instrumentAccountCode) { - - InstrumentAccountCodeContract contract = new InstrumentAccountCodeContract(); - - contract.setId(instrumentAccountCode.getId()); - - if (instrumentAccountCode.getInstrumentType() != null) - contract.setInstrumentType(typeMapper.toContract(instrumentAccountCode.getInstrumentType())); - - if (instrumentAccountCode.getAccountCode() != null) - contract.setAccountCode(instrumentAccountCode.getAccountCode()); - - contract.setCreatedBy(instrumentAccountCode.getCreatedBy()); - contract.setCreatedDate(instrumentAccountCode.getCreatedDate()); - contract.setLastModifiedBy(instrumentAccountCode.getLastModifiedBy()); - contract.setLastModifiedDate(instrumentAccountCode.getLastModifiedDate()); - contract.setTenantId(instrumentAccountCode.getTenantId()); - - return contract; - } - - public InstrumentAccountCodeSearch toSearchDomain(InstrumentAccountCodeSearchContract contract) { - - InstrumentAccountCodeSearch instrumentAccountCodeSearch = new InstrumentAccountCodeSearch(); - - instrumentAccountCodeSearch.setId(contract.getId()); - - if (contract.getInstrumentType() != null) - instrumentAccountCodeSearch.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); - - if (contract.getAccountCode() != null) - instrumentAccountCodeSearch.setAccountCode(contract.getAccountCode()); - - instrumentAccountCodeSearch.setCreatedBy(contract.getCreatedBy()); - instrumentAccountCodeSearch.setCreatedDate(contract.getCreatedDate()); - instrumentAccountCodeSearch.setLastModifiedBy(contract.getLastModifiedBy()); - instrumentAccountCodeSearch.setLastModifiedDate(contract.getLastModifiedDate()); - instrumentAccountCodeSearch.setTenantId(contract.getTenantId()); - instrumentAccountCodeSearch.setPageSize(contract.getPageSize()); - instrumentAccountCodeSearch.setOffset(contract.getOffset()); - instrumentAccountCodeSearch.setSortBy(contract.getSortBy()); - instrumentAccountCodeSearch.setIds(contract.getIds()); - - return instrumentAccountCodeSearch; - } - - public InstrumentAccountCodeSearchContract toSearchContract( - InstrumentAccountCodeSearch instrumentAccountCodeSearch) { - - InstrumentAccountCodeSearchContract contract = new InstrumentAccountCodeSearchContract(); - - contract.setId(instrumentAccountCodeSearch.getId()); - - if (instrumentAccountCodeSearch.getInstrumentType() != null) - contract.setInstrumentType(typeMapper.toContract(instrumentAccountCodeSearch.getInstrumentType())); - - if (instrumentAccountCodeSearch.getAccountCode() != null) - contract.setAccountCode(instrumentAccountCodeSearch.getAccountCode()); - - contract.setCreatedBy(instrumentAccountCodeSearch.getCreatedBy()); - contract.setCreatedDate(instrumentAccountCodeSearch.getCreatedDate()); - contract.setLastModifiedBy(instrumentAccountCodeSearch.getLastModifiedBy()); - contract.setLastModifiedDate(instrumentAccountCodeSearch.getLastModifiedDate()); - contract.setTenantId(instrumentAccountCodeSearch.getTenantId()); - contract.setPageSize(instrumentAccountCodeSearch.getPageSize()); - contract.setOffset(instrumentAccountCodeSearch.getOffset()); - contract.setSortBy(instrumentAccountCodeSearch.getSortBy()); - contract.setIds(instrumentAccountCodeSearch.getIds()); - - return contract; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentMapper.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentMapper.java deleted file mode 100644 index b6f07add540..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentMapper.java +++ /dev/null @@ -1,271 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.egf.instrument.domain.model.DishonorReason; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.instrument.web.contract.DishonorReasonContract; -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.egov.egf.instrument.web.contract.InstrumentSearchContract; -import org.egov.egf.instrument.web.contract.InstrumentVoucherContract; -import org.egov.egf.instrument.web.contract.TransactionTypeContract; - -public class InstrumentMapper { - - private InstrumentTypeMapper typeMapper = new InstrumentTypeMapper(); - private SurrenderReasonMapper srMapper = new SurrenderReasonMapper(); - private DishonorReasonMapper drMapper = new DishonorReasonMapper(); - - public Instrument toDomain(InstrumentContract contract) { - - Instrument instrument = new Instrument(); - - instrument.setId(contract.getId()); - instrument.setAmount(contract.getAmount()); - instrument.setBank(contract.getBank()); - instrument.setBankAccount(contract.getBankAccount()); - instrument.setBranchName(contract.getBranchName()); - instrument.setDrawer(contract.getDrawer()); - instrument.setFinancialStatus(contract.getFinancialStatus()); - instrument.setRemittanceVoucherId(contract.getRemittanceVoucherId()); - - if (contract.getInstrumentType() != null) - instrument.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); - - if (contract.getSurrenderReason() != null) - instrument.setSurrenderReason(srMapper.toDomain(contract.getSurrenderReason())); - - if (contract.getDishonor() != null){ - DishonorReasonContract dishonor = contract.getDishonor(); -// instrument.setDishonorReason(drMapper.toDomain(contract.getDishonor())); - DishonorReason dishonorReason = new DishonorReason().builder().reason(dishonor.getReason()) - .dishonorDate(dishonor.getDishonorDate()) - .remarks(dishonor.getRemarks()) - .instrument(dishonor.getInstrument()) - .reversalVoucherId(dishonor.getReversalVoucherId()) - .build(); - dishonorReason.setTenantId(contract.getTenantId()); - instrument.setDishonorReason(dishonorReason); - } - - if (contract.getInstrumentVouchers() != null) { - - List instrumentVouchers = new ArrayList<>(); - - if (contract.getInstrumentVouchers() != null) - for (InstrumentVoucherContract ivc : contract.getInstrumentVouchers()) - instrumentVouchers.add(InstrumentVoucher.builder().voucherHeaderId(ivc.getVoucherHeaderId()) - .receiptHeaderId(ivc.getReceiptHeaderId()).build()); - - instrument.setInstrumentVouchers(instrumentVouchers); - - } - - instrument.setPayee(contract.getPayee()); - instrument.setSerialNo(contract.getSerialNo()); - instrument.setTransactionDate(contract.getTransactionDate()); - instrument.setTransactionNumber(contract.getTransactionNumber()); - instrument.setTransactionType(contract.getTransactionType() != null - ? TransactionType.valueOf(contract.getTransactionType().name()) : null); - instrument.setPayinSlipId(contract.getPayinSlipId()); - instrument.setReconciledAmount(contract.getReconciledAmount()); - instrument.setReconciledOn(contract.getReconciledOn()); - instrument.setCreatedBy(contract.getCreatedBy()); - instrument.setCreatedDate(contract.getCreatedDate()); - instrument.setLastModifiedBy(contract.getLastModifiedBy()); - instrument.setLastModifiedDate(contract.getLastModifiedDate()); - instrument.setTenantId(contract.getTenantId()); - instrument.setDeleteReason(contract.getDeleteReason()); - for (InstrumentVoucher iv : instrument.getInstrumentVouchers()) { - iv.setInstrument(instrument); - iv.setTenantId(instrument.getTenantId()); - } - return instrument; - } - - public InstrumentContract toContract(Instrument instrument) { - - InstrumentContract contract = new InstrumentContract(); - - contract.setId(instrument.getId()); - contract.setAmount(instrument.getAmount()); - contract.setBank(instrument.getBank()); - contract.setBankAccount(instrument.getBankAccount()); - contract.setBranchName(instrument.getBranchName()); - contract.setDrawer(instrument.getDrawer()); - contract.setFinancialStatus(instrument.getFinancialStatus()); - contract.setRemittanceVoucherId(instrument.getRemittanceVoucherId()); - - if (instrument.getInstrumentType() != null) - contract.setInstrumentType(typeMapper.toContract(instrument.getInstrumentType())); - - if (instrument.getSurrenderReason() != null) - contract.setSurrenderReason(srMapper.toContract(instrument.getSurrenderReason())); - - if (instrument.getDishonorReason() != null){ - DishonorReason dishonorReason = instrument.getDishonorReason(); - DishonorReasonContract dishonorReasonContract = new DishonorReasonContract().builder() - .id(dishonorReason.getId()) - .reason(dishonorReason.getReason()) - .remarks(dishonorReason.getRemarks()) - .instrument(dishonorReason.getInstrument()) - .dishonorDate(dishonorReason.getDishonorDate()) - .reversalVoucherId(dishonorReason.getReversalVoucherId()) - .build(); - dishonorReasonContract.setTenantId(instrument.getTenantId()); - contract.setDishonor(dishonorReasonContract); - } - - if (instrument.getInstrumentVouchers() != null) { - - List instrumentVouchers = new ArrayList<>(); - - if (instrument.getInstrumentVouchers() != null) - for (InstrumentVoucher iv : instrument.getInstrumentVouchers()) - instrumentVouchers - .add(InstrumentVoucherContract.builder().instrument(contract.getId()) - .voucherHeaderId(iv.getVoucherHeaderId()).receiptHeaderId(iv.getReceiptHeaderId()).build()); - - contract.setInstrumentVouchers(instrumentVouchers); - - } - - contract.setPayee(instrument.getPayee()); - contract.setSerialNo(instrument.getSerialNo()); - contract.setTransactionDate(instrument.getTransactionDate()); - contract.setTransactionNumber(instrument.getTransactionNumber()); - contract.setTransactionType(instrument.getTransactionType() != null - ? TransactionTypeContract.valueOf(instrument.getTransactionType().name()) : null); - contract.setPayinSlipId(instrument.getPayinSlipId()); - contract.setReconciledAmount(instrument.getReconciledAmount()); - contract.setReconciledOn(instrument.getReconciledOn()); - contract.setCreatedBy(instrument.getCreatedBy()); - contract.setCreatedDate(instrument.getCreatedDate()); - contract.setLastModifiedBy(instrument.getLastModifiedBy()); - contract.setLastModifiedDate(instrument.getLastModifiedDate()); - contract.setTenantId(instrument.getTenantId()); - contract.setDeleteReason(instrument.getDeleteReason()); - return contract; - } - - public InstrumentSearch toSearchDomain(InstrumentSearchContract contract) { - - InstrumentSearch instrumentSearch = new InstrumentSearch(); - - instrumentSearch.setId(contract.getId()); - instrumentSearch.setAmount(contract.getAmount()); - instrumentSearch.setBank(contract.getBank()); - instrumentSearch.setBankAccount(contract.getBankAccount()); - instrumentSearch.setBranchName(contract.getBranchName()); - instrumentSearch.setDrawer(contract.getDrawer()); - instrumentSearch.setFinancialStatus(contract.getFinancialStatus()); - instrumentSearch.setRemittanceVoucherId(contract.getRemittanceVoucherId()); - - if (contract.getInstrumentType() != null) - instrumentSearch.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); - - if (contract.getSurrenderReason() != null) - instrumentSearch.setSurrenderReason(srMapper.toDomain(contract.getSurrenderReason())); - - if (contract.getInstrumentVouchers() != null) { - - List instrumentVouchers = new ArrayList<>(); - if (contract.getInstrumentVouchers() != null) - for (InstrumentVoucherContract ivc : contract.getInstrumentVouchers()) - instrumentVouchers.add(InstrumentVoucher.builder().voucherHeaderId(ivc.getVoucherHeaderId()) - .receiptHeaderId(ivc.getReceiptHeaderId()).build()); - - instrumentSearch.setInstrumentVouchers(instrumentVouchers); - - } - instrumentSearch.setPayee(contract.getPayee()); - instrumentSearch.setSerialNo(contract.getSerialNo()); - instrumentSearch.setTransactionDate(contract.getTransactionDate()); - instrumentSearch.setTransactionNumber(contract.getTransactionNumber()); - instrumentSearch.setTransactionType(contract.getTransactionType() != null - ? TransactionType.valueOf(contract.getTransactionType().name()) : null); - instrumentSearch.setPayinSlipId(contract.getPayinSlipId()); - instrumentSearch.setReconciledAmount(contract.getReconciledAmount()); - instrumentSearch.setReconciledOn(contract.getReconciledOn()); - instrumentSearch.setCreatedBy(contract.getCreatedBy()); - instrumentSearch.setCreatedDate(contract.getCreatedDate()); - instrumentSearch.setLastModifiedBy(contract.getLastModifiedBy()); - instrumentSearch.setLastModifiedDate(contract.getLastModifiedDate()); - instrumentSearch.setTenantId(contract.getTenantId()); - instrumentSearch.setPageSize(contract.getPageSize()); - instrumentSearch.setOffset(contract.getOffset()); - instrumentSearch.setSortBy(contract.getSortBy()); - instrumentSearch.setIds(contract.getIds()); - instrumentSearch.setInstrumentTypes(contract.getInstrumentTypes()); - instrumentSearch.setFinancialStatuses(contract.getFinancialStatuses()); - instrumentSearch.setTransactionFromDate(contract.getTransactionFromDate()); - instrumentSearch.setTransactionToDate(contract.getTransactionToDate()); - instrumentSearch.setDeleteReason(contract.getDeleteReason()); - instrumentSearch.setReceiptIds(contract.getReceiptIds()); - return instrumentSearch; - } - - public InstrumentSearchContract toSearchContract(InstrumentSearch instrumentSearch) { - - InstrumentSearchContract contract = new InstrumentSearchContract(); - - contract.setId(instrumentSearch.getId()); - contract.setAmount(instrumentSearch.getAmount()); - contract.setBank(instrumentSearch.getBank()); - contract.setBankAccount(instrumentSearch.getBankAccount()); - contract.setBranchName(instrumentSearch.getBranchName()); - contract.setDrawer(instrumentSearch.getDrawer()); - contract.setFinancialStatus(instrumentSearch.getFinancialStatus()); - contract.setRemittanceVoucherId(instrumentSearch.getRemittanceVoucherId()); - - if (instrumentSearch.getInstrumentType() != null) - contract.setInstrumentType(typeMapper.toContract(instrumentSearch.getInstrumentType())); - - if (instrumentSearch.getSurrenderReason() != null) - contract.setSurrenderReason(srMapper.toContract(instrumentSearch.getSurrenderReason())); - - if (instrumentSearch.getInstrumentVouchers() != null) { - - List instrumentVouchers = new ArrayList<>(); - - if (instrumentSearch.getInstrumentVouchers() != null) - for (InstrumentVoucher iv : instrumentSearch.getInstrumentVouchers()) - instrumentVouchers - .add(InstrumentVoucherContract.builder().instrument(contract.getId()) - .voucherHeaderId(iv.getVoucherHeaderId()).receiptHeaderId(iv.getReceiptHeaderId()).build()); - - contract.setInstrumentVouchers(instrumentVouchers); - - } - - contract.setPayee(instrumentSearch.getPayee()); - contract.setSerialNo(instrumentSearch.getSerialNo()); - contract.setTransactionDate(instrumentSearch.getTransactionDate()); - contract.setTransactionNumber(instrumentSearch.getTransactionNumber()); - contract.setTransactionType(instrumentSearch.getTransactionType() != null - ? TransactionTypeContract.valueOf(instrumentSearch.getTransactionType().name()) : null); - contract.setPayinSlipId(instrumentSearch.getPayinSlipId()); - contract.setReconciledAmount(instrumentSearch.getReconciledAmount()); - contract.setReconciledOn(instrumentSearch.getReconciledOn()); - contract.setCreatedBy(instrumentSearch.getCreatedBy()); - contract.setCreatedDate(instrumentSearch.getCreatedDate()); - contract.setLastModifiedBy(instrumentSearch.getLastModifiedBy()); - contract.setLastModifiedDate(instrumentSearch.getLastModifiedDate()); - contract.setTenantId(instrumentSearch.getTenantId()); - contract.setPageSize(instrumentSearch.getPageSize()); - contract.setOffset(instrumentSearch.getOffset()); - contract.setSortBy(instrumentSearch.getSortBy()); - contract.setIds(instrumentSearch.getIds()); - contract.setFinancialStatuses(instrumentSearch.getFinancialStatuses()); - contract.setInstrumentTypes(instrumentSearch.getInstrumentTypes()); - contract.setTransactionFromDate(instrumentSearch.getTransactionFromDate()); - contract.setTransactionToDate(instrumentSearch.getTransactionToDate()); - contract.setDeleteReason(instrumentSearch.getDeleteReason()); - return contract; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentTypeMapper.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentTypeMapper.java deleted file mode 100644 index 7f6a5b2c5b0..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/InstrumentTypeMapper.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeSearchContract; - -public class InstrumentTypeMapper { - - public InstrumentType toDomain(InstrumentTypeContract contract) { - - InstrumentType instrumentType = new InstrumentType(); - - instrumentType.setId(contract.getId()); - - instrumentType.setActive(contract.getActive()); - instrumentType.setDescription(contract.getDescription()); - instrumentType.setName(contract.getName()); - instrumentType.setCreatedBy(contract.getCreatedBy()); - instrumentType.setCreatedDate(contract.getCreatedDate()); - instrumentType.setLastModifiedBy(contract.getLastModifiedBy()); - instrumentType.setLastModifiedDate(contract.getLastModifiedDate()); - instrumentType.setTenantId(contract.getTenantId()); - - return instrumentType; - } - - public InstrumentTypeContract toContract(InstrumentType instrumentType) { - - InstrumentTypeContract contract = new InstrumentTypeContract(); - - contract.setId(instrumentType.getId()); - - contract.setActive(instrumentType.getActive()); - contract.setDescription(instrumentType.getDescription()); - contract.setName(instrumentType.getName()); - - contract.setCreatedBy(instrumentType.getCreatedBy()); - contract.setCreatedDate(instrumentType.getCreatedDate()); - contract.setLastModifiedBy(instrumentType.getLastModifiedBy()); - contract.setLastModifiedDate(instrumentType.getLastModifiedDate()); - contract.setTenantId(instrumentType.getTenantId()); - - return contract; - } - - public InstrumentTypeSearch toSearchDomain(InstrumentTypeSearchContract contract) { - - InstrumentTypeSearch instrumentTypeSearch = new InstrumentTypeSearch(); - - instrumentTypeSearch.setId(contract.getId()); - - instrumentTypeSearch.setActive(contract.getActive()); - instrumentTypeSearch.setDescription(contract.getDescription()); - instrumentTypeSearch.setName(contract.getName()); - instrumentTypeSearch.setCreatedBy(contract.getCreatedBy()); - instrumentTypeSearch.setCreatedDate(contract.getCreatedDate()); - instrumentTypeSearch.setLastModifiedBy(contract.getLastModifiedBy()); - instrumentTypeSearch.setLastModifiedDate(contract.getLastModifiedDate()); - instrumentTypeSearch.setTenantId(contract.getTenantId()); - instrumentTypeSearch.setPageSize(contract.getPageSize()); - instrumentTypeSearch.setOffset(contract.getOffset()); - instrumentTypeSearch.setSortBy(contract.getSortBy()); - instrumentTypeSearch.setIds(contract.getIds()); - - return instrumentTypeSearch; - } - - public InstrumentTypeSearchContract toSearchContract(InstrumentTypeSearch instrumentTypeSearch) { - - InstrumentTypeSearchContract contract = new InstrumentTypeSearchContract(); - - contract.setId(instrumentTypeSearch.getId()); - - contract.setActive(instrumentTypeSearch.getActive()); - contract.setDescription(instrumentTypeSearch.getDescription()); - contract.setName(instrumentTypeSearch.getName()); - contract.setCreatedBy(instrumentTypeSearch.getCreatedBy()); - contract.setCreatedDate(instrumentTypeSearch.getCreatedDate()); - contract.setLastModifiedBy(instrumentTypeSearch.getLastModifiedBy()); - contract.setLastModifiedDate(instrumentTypeSearch.getLastModifiedDate()); - contract.setTenantId(instrumentTypeSearch.getTenantId()); - contract.setPageSize(instrumentTypeSearch.getPageSize()); - contract.setOffset(instrumentTypeSearch.getOffset()); - contract.setSortBy(instrumentTypeSearch.getSortBy()); - contract.setIds(instrumentTypeSearch.getIds()); - return contract; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/SurrenderReasonMapper.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/SurrenderReasonMapper.java deleted file mode 100644 index 8dcf9efcbb3..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/mapper/SurrenderReasonMapper.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonSearchContract; - -public class SurrenderReasonMapper { - - public SurrenderReason toDomain(SurrenderReasonContract contract) { - - SurrenderReason surrenderReason = new SurrenderReason(); - - surrenderReason.setId(contract.getId()); - surrenderReason.setName(contract.getName()); - surrenderReason.setDescription(contract.getDescription()); - surrenderReason.setCreatedBy(contract.getCreatedBy()); - surrenderReason.setCreatedDate(contract.getCreatedDate()); - surrenderReason.setLastModifiedBy(contract.getLastModifiedBy()); - surrenderReason.setLastModifiedDate(contract.getLastModifiedDate()); - surrenderReason.setTenantId(contract.getTenantId()); - - return surrenderReason; - } - - public SurrenderReasonContract toContract(SurrenderReason surrenderReason) { - - SurrenderReasonContract contract = new SurrenderReasonContract(); - - contract.setId(surrenderReason.getId()); - contract.setName(surrenderReason.getName()); - contract.setDescription(surrenderReason.getDescription()); - contract.setCreatedBy(surrenderReason.getCreatedBy()); - contract.setCreatedDate(surrenderReason.getCreatedDate()); - contract.setLastModifiedBy(surrenderReason.getLastModifiedBy()); - contract.setLastModifiedDate(surrenderReason.getLastModifiedDate()); - contract.setTenantId(surrenderReason.getTenantId()); - - return contract; - } - - public SurrenderReasonSearch toSearchDomain(SurrenderReasonSearchContract contract) { - - SurrenderReasonSearch surrenderReasonSearch = new SurrenderReasonSearch(); - - surrenderReasonSearch.setId(contract.getId()); - surrenderReasonSearch.setName(contract.getName()); - surrenderReasonSearch.setDescription(contract.getDescription()); - surrenderReasonSearch.setCreatedBy(contract.getCreatedBy()); - surrenderReasonSearch.setCreatedDate(contract.getCreatedDate()); - surrenderReasonSearch.setLastModifiedBy(contract.getLastModifiedBy()); - surrenderReasonSearch.setLastModifiedDate(contract.getLastModifiedDate()); - surrenderReasonSearch.setTenantId(contract.getTenantId()); - surrenderReasonSearch.setPageSize(contract.getPageSize()); - surrenderReasonSearch.setOffset(contract.getOffset()); - surrenderReasonSearch.setSortBy(contract.getSortBy()); - surrenderReasonSearch.setIds(contract.getIds()); - - return surrenderReasonSearch; - } - - public SurrenderReasonSearchContract toSearchContract(SurrenderReasonSearch surrenderReasonSearch) { - - SurrenderReasonSearchContract contract = new SurrenderReasonSearchContract(); - - contract.setId(surrenderReasonSearch.getId()); - contract.setName(surrenderReasonSearch.getName()); - contract.setDescription(surrenderReasonSearch.getDescription()); - contract.setCreatedBy(surrenderReasonSearch.getCreatedBy()); - contract.setCreatedDate(surrenderReasonSearch.getCreatedDate()); - contract.setLastModifiedBy(surrenderReasonSearch.getLastModifiedBy()); - contract.setLastModifiedDate(surrenderReasonSearch.getLastModifiedDate()); - contract.setTenantId(surrenderReasonSearch.getTenantId()); - contract.setPageSize(surrenderReasonSearch.getPageSize()); - contract.setOffset(surrenderReasonSearch.getOffset()); - contract.setSortBy(surrenderReasonSearch.getSortBy()); - contract.setIds(surrenderReasonSearch.getIds()); - - return contract; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentAccountCodeContractRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentAccountCodeContractRepository.java deleted file mode 100644 index dee2aa3897a..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentAccountCodeContractRepository.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class InstrumentAccountCodeContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-instrument/instrumentaccountcodes/_search?"; - - public InstrumentAccountCodeContractRepository(@Value("${egf.instrument.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public InstrumentAccountCodeContract findById(InstrumentAccountCodeContract instrumentAccountCodeContract) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (instrumentAccountCodeContract.getId() != null) - content.append("id=" + instrumentAccountCodeContract.getId()); - - if (instrumentAccountCodeContract.getTenantId() != null) - content.append("&tenantId=" + instrumentAccountCodeContract.getTenantId()); - url = url + content.toString(); - InstrumentAccountCodeResponse result = restTemplate.postForObject(url, null, - InstrumentAccountCodeResponse.class); - - if (result.getInstrumentAccountCodes() != null && result.getInstrumentAccountCodes().size() == 1) - return result.getInstrumentAccountCodes().get(0); - else - return null; - - } -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentContractRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentContractRepository.java deleted file mode 100644 index 03e0c6fa3e9..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentContractRepository.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.egov.egf.instrument.web.requests.InstrumentResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class InstrumentContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-instrument/instruments/_search?"; - - public InstrumentContractRepository(@Value("${egf.instrument.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public InstrumentContract findById(InstrumentContract instrumentContract) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (instrumentContract.getId() != null) - content.append("id=" + instrumentContract.getId()); - - if (instrumentContract.getTenantId() != null) - content.append("&tenantId=" + instrumentContract.getTenantId()); - url = url + content.toString(); - InstrumentResponse result = restTemplate.postForObject(url, null, InstrumentResponse.class); - - if (result.getInstruments() != null && result.getInstruments().size() == 1) - return result.getInstruments().get(0); - else - return null; - - } -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentTypeContractRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentTypeContractRepository.java deleted file mode 100644 index 09af5490808..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/InstrumentTypeContractRepository.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.requests.InstrumentTypeResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class InstrumentTypeContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-instrument/instrumenttypes/_search?"; - - public InstrumentTypeContractRepository(@Value("${egf.instrument.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public InstrumentTypeContract findById(InstrumentTypeContract instrumentTypeContract) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (instrumentTypeContract.getId() != null) - content.append("id=" + instrumentTypeContract.getId()); - - if (instrumentTypeContract.getTenantId() != null) - content.append("&tenantId=" + instrumentTypeContract.getTenantId()); - url = url + content.toString(); - InstrumentTypeResponse result = restTemplate.postForObject(url, null, InstrumentTypeResponse.class); - - if (result.getInstrumentTypes() != null && result.getInstrumentTypes().size() == 1) - return result.getInstrumentTypes().get(0); - else - return null; - - } -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/SurrenderReasonContractRepository.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/SurrenderReasonContractRepository.java deleted file mode 100644 index 79403a0de3f..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/repository/SurrenderReasonContractRepository.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.egov.egf.instrument.web.requests.SurrenderReasonResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class SurrenderReasonContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-instrument/surrenderreasons/_search?"; - - public SurrenderReasonContractRepository(@Value("${egf.instrument.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public SurrenderReasonContract findById(SurrenderReasonContract surrenderReasonContract) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (surrenderReasonContract.getId() != null) - content.append("id=" + surrenderReasonContract.getId()); - - if (surrenderReasonContract.getTenantId() != null) - content.append("&tenantId=" + surrenderReasonContract.getTenantId()); - url = url + content.toString(); - SurrenderReasonResponse result = restTemplate.postForObject(url, null, SurrenderReasonResponse.class); - - if (result.getSurrenderReasons() != null && result.getSurrenderReasons().size() == 1) - return result.getSurrenderReasons().get(0); - else - return null; - - } -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/DishonorReasonRequest.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/DishonorReasonRequest.java deleted file mode 100644 index 3e8fa70c828..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/DishonorReasonRequest.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.web.contract.DishonorReasonContract; - -import lombok.Data; - -public @Data class DishonorReasonRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List surrenderReasons = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentAccountCodeRequest.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentAccountCodeRequest.java deleted file mode 100644 index d18f9ac3648..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentAccountCodeRequest.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; - -import lombok.Data; - -public @Data class InstrumentAccountCodeRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List instrumentAccountCodes = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentAccountCodeResponse.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentAccountCodeResponse.java deleted file mode 100644 index b8f39e6793e..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentAccountCodeResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class InstrumentAccountCodeResponse { - private ResponseInfo responseInfo; - private List instrumentAccountCodes; - private PaginationContract page; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentRequest.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentRequest.java deleted file mode 100644 index 2ddda97c888..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentRequest.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.web.contract.InstrumentContract; - -import lombok.Data; - -public @Data class InstrumentRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List instruments = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentResponse.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentResponse.java deleted file mode 100644 index 433291b7cc6..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.web.contract.InstrumentContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class InstrumentResponse { - private ResponseInfo responseInfo; - private List instruments; - private PaginationContract page; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentTypeRequest.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentTypeRequest.java deleted file mode 100644 index bfbdb08c6bb..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentTypeRequest.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; - -import lombok.Data; - -public @Data class InstrumentTypeRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List instrumentTypes = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentTypeResponse.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentTypeResponse.java deleted file mode 100644 index 057ef4e1b55..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/InstrumentTypeResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class InstrumentTypeResponse { - private ResponseInfo responseInfo; - private List instrumentTypes; - private PaginationContract page; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/SurrenderReasonRequest.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/SurrenderReasonRequest.java deleted file mode 100644 index 7e90c7a2e0e..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/SurrenderReasonRequest.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; - -import lombok.Data; - -public @Data class SurrenderReasonRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List surrenderReasons = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/SurrenderReasonResponse.java b/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/SurrenderReasonResponse.java deleted file mode 100644 index 82e8aded7ab..00000000000 --- a/business-services/egf-instrument/src/main/java/org/egov/egf/instrument/web/requests/SurrenderReasonResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.instrument.web.requests; - -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class SurrenderReasonResponse { - private ResponseInfo responseInfo; - private List surrenderReasons; - private PaginationContract page; -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/application.properties b/business-services/egf-instrument/src/main/resources/application.properties deleted file mode 100644 index af67d585095..00000000000 --- a/business-services/egf-instrument/src/main/resources/application.properties +++ /dev/null @@ -1,74 +0,0 @@ -server.context-path=/egf-instrument -server.servlet.context-path=/egf-instrument -server.port=8480 - -persist.through.kafka=yes - -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://localhost:5432/egf-instrument -spring.datasource.username=postgres -spring.datasource.password=psql -management.endpoints.web.base-path=/ - -spring.flyway.enabled=true -spring.flyway.user=postgres -spring.flyway.password=psql -spring.flyway.outOfOrder=true -spring.flyway.table=egf_instrument_schema_version -spring.flyway.baseline-on-migrate=true -spring.flyway.url=jdbc:postgresql://localhost:5432/egf-instrument -spring.flyway.locations=classpath:/db/migration/main,db/migration/seed - -spring.jpa.showSql=true -spring.jpa.database=POSTGRESQL -spring.data.jpa.repositories.enabled=true -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl -spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl -spring.jpa.open-in-view=true - -app.timezone=UTC - -fetch_data_from=db - -es.host=localhost -es.transport.port=9300 -es.cluster.name=docker-cluster -es.fund.index.name=fund -es.fund.document.type=fund - -#Kafka Topic config -spring.kafka.consumer.properties.spring.json.use.type.headers=false -management.endpoints.web.base-path=/ - -spring.kafka.listener.missing-topics-fatal=false -#Kafka Topic config -kafka.topics.egf.instrument.validated.topic=egov.egf.instrument.validated.topic -kafka.topics.egf.instrument.validated.group=egov.egf.instrument.validated.group -kafka.topics.egf.instrument.validated.id=egov.egf.instrument.validated.id - -kafka.topics.egf.instrument.completed.topic=egov.egf.instrument.completed -kafka.topics.egf.instrument.completed.group=egov.egf.instrument.completed.group - -kafka.topics.egf.instrument.instrument.accountcode.validated.key=egov.egf.instrument.instrument.accountcode.validated.key -kafka.topics.egf.instrument.instrument.validated.key=egov.egf.instrument.budgetdetail.validated.key -kafka.topics.egf.instrument.instrument.type.validated.key=egov.egf.instrument.budgetreapp.validated.key -kafka.topics.egf.instrument.surrender.reason.validated.key=egov.egf.instrument.surrender.reason.validated.key - -kafka.topics.egf.instrument.instrument.accountcode.completed.key=egov.egf.instrument.instrument.accountcode.completed.key -kafka.topics.egf.instrument.instrument.completed.key=egov.egf.instrument.instrument.completed.key -kafka.topics.egf.instrument.instrument.type.completed.key=egov.egf.instrument.instrument.type.completed.key -kafka.topics.egf.instrument.surrender.reason.completed.key=egov.egf.instrument.surrender.reason.completed.key - - -egf.instrument.host.url=http://localhost:8480 - -egf.master.host.url=https://dev.digit.org - -logging.pattern.console=%clr(%X{CORRELATION_ID:-}) %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} - - -spring.kafka.consumer.value-deserializer=org.egov.common.queue.HashMapDeserializer -spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.group-id=egf-instrument -spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer diff --git a/business-services/egf-instrument/src/main/resources/db/Dockerfile b/business-services/egf-instrument/src/main/resources/db/Dockerfile deleted file mode 100644 index aa911735f99..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM egovio/flyway:4.1.2 - -COPY ./migration/main /flyway/sql - -COPY ./migration/seed /flyway/seed - -COPY migrate.sh /usr/bin/migrate.sh - -RUN chmod +x /usr/bin/migrate.sh - -CMD ["/usr/bin/migrate.sh"] diff --git a/business-services/egf-instrument/src/main/resources/db/migrate.sh b/business-services/egf-instrument/src/main/resources/db/migrate.sh deleted file mode 100644 index 5593a173eba..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migrate.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true migrate \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150656__egf-instrument_InstrumentStatus_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150656__egf-instrument_InstrumentStatus_ddl.sql deleted file mode 100644 index 1f8f13de0bd..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150656__egf-instrument_InstrumentStatus_ddl.sql +++ /dev/null @@ -1,16 +0,0 @@ - -Create table egf_instrumentstatus -( - id varchar(50) NOT NULL, - moduleType varchar(50) NOT NULL, - name varchar(20) NOT NULL, - description varchar(250) NOT NULL, - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_instrumentstatus add constraint pk_egf_instrumentstatus primary key (id); -create sequence seq_egf_instrumentstatus; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150657__egf-instrument_InstrumentType_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150657__egf-instrument_InstrumentType_ddl.sql deleted file mode 100644 index 7a2855995d9..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150657__egf-instrument_InstrumentType_ddl.sql +++ /dev/null @@ -1,16 +0,0 @@ - -Create table egf_instrumenttype -( - id varchar(50), - name varchar(50) NOT NULL, - description varchar(100), - active boolean NOT NULL, - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_instrumenttype add constraint pk_egf_instrumenttype primary key (id); -create sequence seq_egf_instrumenttype; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150658__egf-instrument_InstrumentTypeProperty_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150658__egf-instrument_InstrumentTypeProperty_ddl.sql deleted file mode 100644 index d54b4d4a6be..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150658__egf-instrument_InstrumentTypeProperty_ddl.sql +++ /dev/null @@ -1,18 +0,0 @@ - -Create table egf_instrumenttypeproperty( -id varchar(50) not null, - transactionType varchar(6) NOT NULL, - reconciledOncreate boolean NOT NULL, - statusOnCreateId varchar(50) NOT NULL, - statusOnUpdateId varchar(50) NOT NULL, - statusOnReconcileId varchar(50) NOT NULL, - InstrumentTypeId varchar(50), - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_instrumenttypeproperty add constraint pk_egf_instrumenttypeproperty primary key (id); -create sequence seq_egf_instrumenttypeproperty; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150659__egf-instrument_InstrumentAccountCode_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150659__egf-instrument_InstrumentAccountCode_ddl.sql deleted file mode 100644 index 43af38d7ba7..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150659__egf-instrument_InstrumentAccountCode_ddl.sql +++ /dev/null @@ -1,15 +0,0 @@ - -Create table egf_instrumentaccountcode -( - id varchar(50), - instrumentTypeId varchar(50), - accountCodeId varchar(50), - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_instrumentaccountcode add constraint pk_egf_instrumentaccountcode primary key (id); -create sequence seq_egf_instrumentaccountcode; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150700__egf-instrument_SurrenderReason_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150700__egf-instrument_SurrenderReason_ddl.sql deleted file mode 100644 index d452590b2fa..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150700__egf-instrument_SurrenderReason_ddl.sql +++ /dev/null @@ -1,14 +0,0 @@ - -Create table egf_surrenderreason( - id varchar(50), - name varchar(50), - description varchar(250), - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_surrenderreason add constraint pk_egf_surrenderreason primary key (id); -create sequence seq_egf_surrenderreason; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150701__egf-instrument_Instrument_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150701__egf-instrument_Instrument_ddl.sql deleted file mode 100644 index 3dfe458bf32..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150701__egf-instrument_Instrument_ddl.sql +++ /dev/null @@ -1,25 +0,0 @@ - -Create table egf_instrument( - id varchar(50), - transactionNumber varchar(50) Not null, - transactionDate date NOT NULL, - amount numeric (13,2) NOT NULL, - instrumentTypeId varchar(50) NOT NULL, - bankId varchar(50), - branchName varchar(50), - bankAccountId varchar(50), - financialStatusId varchar(50), - transactionType varchar(6), - payee varchar(50), - drawer varchar(100), - surrendarReasonId varchar(50), - serialNo varchar(50), - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_instrument add constraint pk_egf_instrument primary key (id); -create sequence seq_egf_instrument; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150702__egf-instrument_InstrumentVoucher_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150702__egf-instrument_InstrumentVoucher_ddl.sql deleted file mode 100644 index 2e4dec200e4..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170719150702__egf-instrument_InstrumentVoucher_ddl.sql +++ /dev/null @@ -1,14 +0,0 @@ - -Create table egf_instrumentvoucher( - id varchar(50), - voucherHeaderId varchar(50), - InstrumentId varchar(50), - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_instrumentvoucher add constraint pk_egf_instrumentvoucher primary key (id); -create sequence seq_egf_instrumentvoucher; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170731184801__egf-instrument_instrument_surrendarReasonId_rename.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170731184801__egf-instrument_instrument_surrendarReasonId_rename.sql deleted file mode 100644 index 1fdab4e9d43..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170731184801__egf-instrument_instrument_surrendarReasonId_rename.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE egf_instrument RENAME COLUMN surrendarReasonId TO surrenderReasonId; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170810172600__egf-instrument_instrument_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20170810172600__egf-instrument_instrument_ddl.sql deleted file mode 100644 index 9297a0ee6f9..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20170810172600__egf-instrument_instrument_ddl.sql +++ /dev/null @@ -1 +0,0 @@ -alter table egf_instrument add column remittanceVoucherId varchar(50); \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20181009162220__egf-instrument_add_new_columns.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20181009162220__egf-instrument_add_new_columns.sql deleted file mode 100644 index 05d43c42cad..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20181009162220__egf-instrument_add_new_columns.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE egf_instrument ADD COLUMN payinSlipId varchar(256); - -ALTER TABLE egf_instrument ADD COLUMN reconciledAmount numeric (13,2); - -ALTER TABLE egf_instrument ADD COLUMN reconciledOn date; \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20181010130920__egf-instrument_voucher_add_receipt_ref.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20181010130920__egf-instrument_voucher_add_receipt_ref.sql deleted file mode 100644 index 9acadc18b40..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20181010130920__egf-instrument_voucher_add_receipt_ref.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE egf_instrumentvoucher ADD COLUMN receiptHeaderId varchar(256); \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/db/migration/main/V20200424144745__egf-instrument_dishonorReason_ddl.sql b/business-services/egf-instrument/src/main/resources/db/migration/main/V20200424144745__egf-instrument_dishonorReason_ddl.sql deleted file mode 100644 index 19dfbeeb5be..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/main/V20200424144745__egf-instrument_dishonorReason_ddl.sql +++ /dev/null @@ -1,17 +0,0 @@ - -Create table egf_instrumentdishonor( - id varchar(50), - reason varchar(100), - remarks varchar(250), - instrumentid varchar(50), - reversalVoucherId varchar(50), - dishonorDate bigint NOT NULL, - createdby varchar(50), - createddate timestamp without time zone, - lastmodifiedby varchar(50), - lastmodifieddate timestamp without time zone, - tenantId varchar(250), - version bigint -); -alter table egf_instrumentdishonor add constraint pk_egf_instrumentdishonor primary key (id); -create sequence seq_egf_instrumentdishonor; diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170726210235__egf_instrument_type.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170726210235__egf_instrument_type.sql deleted file mode 100644 index ad449780321..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170726210235__egf_instrument_type.sql +++ /dev/null @@ -1,38 +0,0 @@ -INSERT INTO egf_instrumenttype( - id, name, description, active, createdby, createddate, lastmodifiedby, - lastmodifieddate, tenantid, version) - VALUES ('2ac21f85-58ab-4a0b-9fd6-9b8d155a5003', 'Cash', 'Instrument type cash', true, '1', now(), 1, - now(), 'default', 0); - - -INSERT INTO egf_instrumenttype( - id, name, description, active, createdby, createddate, lastmodifiedby, - lastmodifieddate, tenantid, version) - VALUES ('25218408-4628-4d80-95c3-fcfaa8170765', 'Cheque', 'Instrument type Cheque', true, '1', now(), 1, - now(), 'default', 0); - - -INSERT INTO egf_instrumenttype( - id, name, description, active, createdby, createddate, lastmodifiedby, - lastmodifieddate, tenantid, version) - VALUES ('f3ae954c-74b0-47d9-9c17-088362c31e35', 'DD', 'Instrument type DD', true, '1', now(), 1, - now(), 'default', 0); - - -INSERT INTO egf_instrumenttype( - id, name, description, active, createdby, createddate, lastmodifiedby, - lastmodifieddate, tenantid, version) - VALUES ('c0da4c81-62b0-4c4d-9077-b6e1110ba268', 'Card', 'Instrument type Cards', true, '1', now(), 1, - now(), 'default', 0); - - -INSERT INTO egf_instrumenttype( - id, name, description, active, createdby, createddate, lastmodifiedby, - lastmodifieddate, tenantid, version) - VALUES ('a93567f2-0cf2-467c-b0a6-acc5c4aecd25', 'BankChallan', 'Instrument type BankChallan', true, '1', now(), 1, - now(), 'default', 0); - - - - - \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170726210246__egf_instrument_type_properties.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170726210246__egf_instrument_type_properties.sql deleted file mode 100644 index 4ebbf83325e..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170726210246__egf_instrument_type_properties.sql +++ /dev/null @@ -1,13 +0,0 @@ -INSERT INTO egf_instrumenttypeproperty( - id, transactiontype, reconciledoncreate, statusoncreateid, statusonupdateid, - statusonreconcileid, instrumenttypeid, createdby, createddate, - lastmodifiedby, lastmodifieddate, tenantid, version) - VALUES ('25e9cd51-e27d-4ece-8ce2-f4da53bb3436', 'Debit', false, 'New', 'Deposited', 'Reconciled' - , 'Cheque', '1', now(),1,now(), 'default', 0); - -INSERT INTO egf_instrumenttypeproperty( - id, transactiontype, reconciledoncreate, statusoncreateid, statusonupdateid, - statusonreconcileid, instrumenttypeid, createdby, createddate, - lastmodifiedby, lastmodifieddate, tenantid, version) - VALUES ('6fc1765c-2e97-4fe6-937a-f7391384b670', 'Credit', false, 'New', 'Deposited', 'Reconciled' - , 'Cheque', '1', now(),1,now(), 'default', 0); diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170827210235__egf_instrument_type_Online.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170827210235__egf_instrument_type_Online.sql deleted file mode 100644 index 2f4dac7548b..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170827210235__egf_instrument_type_Online.sql +++ /dev/null @@ -1,9 +0,0 @@ -INSERT INTO egf_instrumenttype( - id, name, description, active, createdby, createddate, lastmodifiedby, - lastmodifieddate, tenantid, version) - VALUES ('2dfcf972-efb2-4509-99fe-5c42167b2ea7', 'Online', 'Instrument type online', true, '1', now(), 1, - now(), 'default', 0); - - - - \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170827210246__egf_instrument_type_properties_online.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170827210246__egf_instrument_type_properties_online.sql deleted file mode 100644 index 25107ad3fbb..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170827210246__egf_instrument_type_properties_online.sql +++ /dev/null @@ -1,13 +0,0 @@ -INSERT INTO egf_instrumenttypeproperty( - id, transactiontype, reconciledoncreate, statusoncreateid, statusonupdateid, - statusonreconcileid, instrumenttypeid, createdby, createddate, - lastmodifiedby, lastmodifieddate, tenantid, version) - VALUES ('0ee4059b-e056-4070-90dd-8e52747fe5be', 'Debit', false, 'New', 'Deposited', 'Reconciled' - , 'Online', '1', now(),1,now(), 'default', 0); - -INSERT INTO egf_instrumenttypeproperty( - id, transactiontype, reconciledoncreate, statusoncreateid, statusonupdateid, - statusonreconcileid, instrumenttypeid, createdby, createddate, - lastmodifiedby, lastmodifieddate, tenantid, version) - VALUES ('a4b62acb-0d1b-4bbd-902d-1b5731ec3abd', 'Credit', false, 'New', 'Deposited', 'Reconciled' - , 'Online', '1', now(),1,now(), 'default', 0); diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170829170821__collection_instrumentaccountcodes.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170829170821__collection_instrumentaccountcodes.sql deleted file mode 100644 index 0ed5a3d7d91..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20170829170821__collection_instrumentaccountcodes.sql +++ /dev/null @@ -1,6 +0,0 @@ -delete from egf_instrumentaccountcode where instrumenttypeid in ('Cash','Cheque') and tenantid='default'; - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cash', 4501001, 1, 'default'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cheque', 4501051, 1, 'default'); - diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20180928161817__egf_instrumentmapping_jal_amr.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20180928161817__egf_instrumentmapping_jal_amr.sql deleted file mode 100644 index cd564115011..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20180928161817__egf_instrumentmapping_jal_amr.sql +++ /dev/null @@ -1,20 +0,0 @@ -delete from egf_instrumentaccountcode where instrumenttypeid in ('Cash','Cheque','DD','Card') and tenantid='pb.jalandhar'; - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cash', 4501001, 1, 'pb.jalandhar'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cheque', 4501051, 1, 'pb.jalandhar'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'DD', 4501051, 1, 'pb.jalandhar'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Card', 4501091, 1, 'pb.jalandhar'); - -delete from egf_instrumentaccountcode where instrumenttypeid in ('Cash','Cheque','DD','Card') and tenantid='pb.amritsar'; - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cash', 4501001, 1, 'pb.amritsar'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cheque', 4501051, 1, 'pb.amritsar'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'DD', 4501051, 1, 'pb.amritsar'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Card', 4501091, 1, 'pb.amritsar'); - diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20181010160919__egf_instrument_type_for_punjab.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20181010160919__egf_instrument_type_for_punjab.sql deleted file mode 100644 index 772638955be..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20181010160919__egf_instrument_type_for_punjab.sql +++ /dev/null @@ -1,76 +0,0 @@ -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff0acc-cc75-11e8-a8d5-f2801f1b9fd1', 'Cash', 'Instrument type cash', true, '1', now(), 1, now(), 'pb.mohali', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff1332-cc75-11e8-a8d5-f2801f1b9fd1', 'Cheque', 'Instrument type Cheque', true, '1', now(), 1, now(), 'pb.mohali', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff14cc-cc75-11e8-a8d5-f2801f1b9fd1', 'DD', 'Instrument type DD', true, '1', now(), 1, now(), 'pb.mohali', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff160c-cc75-11e8-a8d5-f2801f1b9fd1', 'Card', 'Instrument type Cards', true, '1', now(), 1, now(), 'pb.mohali', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff1738-cc75-11e8-a8d5-f2801f1b9fd1', 'BankChallan', 'Instrument type BankChallan', true, '1', now(), 1, now(), 'pb.mohali', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff1864-cc75-11e8-a8d5-f2801f1b9fd1', 'Cash', 'Instrument type cash', true, '1', now(), 1, now(), 'pb.jalandhar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff1a1c-cc75-11e8-a8d5-f2801f1b9fd1', 'Cheque', 'Instrument type Cheque', true, '1', now(), 1, now(), 'pb.jalandhar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff1e18-cc75-11e8-a8d5-f2801f1b9fd1', 'DD', 'Instrument type DD', true, '1', now(), 1, now(), 'pb.jalandhar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff1f62-cc75-11e8-a8d5-f2801f1b9fd1', 'Card', 'Instrument type Cards', true, '1', now(), 1, now(), 'pb.jalandhar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff20ac-cc75-11e8-a8d5-f2801f1b9fd1', 'BankChallan', 'Instrument type BankChallan', true, '1', now(), 1, now(), 'pb.jalandhar', 0); - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff21d8-cc75-11e8-a8d5-f2801f1b9fd1', 'Cash', 'Instrument type cash', true, '1', now(), 1, now(), 'pb.nayagaon', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2304-cc75-11e8-a8d5-f2801f1b9fd1', 'Cheque', 'Instrument type Cheque', true, '1', now(), 1, now(), 'pb.nayagaon', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2430-cc75-11e8-a8d5-f2801f1b9fd1', 'DD', 'Instrument type DD', true, '1', now(), 1, now(), 'pb.nayagaon', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2854-cc75-11e8-a8d5-f2801f1b9fd1', 'Card', 'Instrument type Cards', true, '1', now(), 1, now(), 'pb.nayagaon', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff29bc-cc75-11e8-a8d5-f2801f1b9fd1', 'BankChallan', 'Instrument type BankChallan', true, '1', now(), 1, now(), 'pb.nayagaon', 0); - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2ae8-cc75-11e8-a8d5-f2801f1b9fd1', 'Cash', 'Instrument type cash', true, '1', now(), 1, now(), 'pb.amritsar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2c14-cc75-11e8-a8d5-f2801f1b9fd1', 'Cheque', 'Instrument type Cheque', true, '1', now(), 1, now(), 'pb.amritsar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2d40-cc75-11e8-a8d5-f2801f1b9fd1', 'DD', 'Instrument type DD', true, '1', now(), 1, now(), 'pb.amritsar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2e6c-cc75-11e8-a8d5-f2801f1b9fd1', 'Card', 'Instrument type Cards', true, '1', now(), 1, now(), 'pb.amritsar', 0); - - -INSERT INTO egf_instrumenttype(id, name, description, active, createdby, createddate, lastmodifiedby, lastmodifieddate, tenantid, version) -VALUES ('48ff2f98-cc75-11e8-a8d5-f2801f1b9fd1', 'BankChallan', 'Instrument type BankChallan', true, '1', now(), 1, now(), 'pb.amritsar', 0); \ No newline at end of file diff --git a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20181015141827__egf_instrumentmapping_mohali_nayagaon.sql b/business-services/egf-instrument/src/main/resources/db/migration/seed/V20181015141827__egf_instrumentmapping_mohali_nayagaon.sql deleted file mode 100644 index 5f0c89a6a18..00000000000 --- a/business-services/egf-instrument/src/main/resources/db/migration/seed/V20181015141827__egf_instrumentmapping_mohali_nayagaon.sql +++ /dev/null @@ -1,20 +0,0 @@ -delete from egf_instrumentaccountcode where instrumenttypeid in ('Cash','Cheque','DD','Card') and tenantid='pb.mohali'; - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cash', 4501001, 1, 'pb.mohali'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cheque', 4501051, 1, 'pb.mohali'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'DD', 4501051, 1, 'pb.mohali'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Card', 4501091, 1, 'pb.mohali'); - -delete from egf_instrumentaccountcode where instrumenttypeid in ('Cash','Cheque','DD','Card') and tenantid='pb.nayagaon'; - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cash', 4501001, 1, 'pb.nayagaon'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Cheque', 4501051, 1, 'pb.nayagaon'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'DD', 4501051, 1, 'pb.nayagaon'); - -insert into egf_instrumentaccountcode(id,instrumenttypeid, accountcodeid, createdby, tenantid) values(nextval('seq_egf_instrumentaccountcode'),'Card', 4501091, 1, 'pb.nayagaon'); - diff --git a/business-services/egf-instrument/src/postman/InstrumentAccountCodeNegative.postman_collection.json b/business-services/egf-instrument/src/postman/InstrumentAccountCodeNegative.postman_collection.json deleted file mode 100644 index b7a6843a764..00000000000 --- a/business-services/egf-instrument/src/postman/InstrumentAccountCodeNegative.postman_collection.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "variables": [], - "info": { - "name": "InstrumentAccountCodeNegative", - "_postman_id": "1574dd69-49ad-4925-49a8-fd0fd51a4474", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/instrumentaccountcodes/_update", - "request": { - "url": "localhost:8480/egf-instrument/instrumentaccountcodes/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentAccountCodes\":[\n \t\t{\n\t\t\t \"instrumentType\":{\n\t \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n\t \"name\":\"DD\"\n \t},\n \t\"accountCode\":{\n \t\t\"id\":\"1\",\n \t\t\"glcode\":\"2\",\n \t\t\"tenantId\":\"default\"\n \t},\n\t\t\t\"tenantId\":\"default\"\n \t\t}\n \t]\n}" - }, - "description": "InstrumentAccountCode update failed because no id" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instrumentaccountcodes/_create", - "request": { - "url": "localhost:8480/egf-instrument/instrumentaccountcodes/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentAccountCodes\":[\n \t\t{\n\t\t\t \"instrumentType\":{\n\t \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n\t \"name\":\"DD\"\n \t},\n \t\"accountCode\":{\n \t\t\"id\":\"1\",\n \t\t\"tenantId\":\"default\"\n \t},\n\t\t\t\"tenantId\":\"default\"\n \t\t}\n \t]\n}" - }, - "description": "InstrumentAccountCode creation failed no glcode is passed" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/postman/InstrumentAccountCodePositive.postman_collection.json b/business-services/egf-instrument/src/postman/InstrumentAccountCodePositive.postman_collection.json deleted file mode 100644 index e94eab18f18..00000000000 --- a/business-services/egf-instrument/src/postman/InstrumentAccountCodePositive.postman_collection.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "variables": [], - "info": { - "name": "InstrumentAccountCodePositive", - "_postman_id": "35f48d0d-3a3c-da79-2c00-f187e84f44e9", - "description": "InstrumentAccountCode create success\n", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/instrumentaccountcodes/_update", - "request": { - "url": "localhost:8480/egf-instrument/instrumentaccountcodes/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentAccountCodes\":[\n \t\t{\n\t\t\t \"instrumentType\":{\n\t \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n\t \"name\":\"DD\"\n \t},\n \t\"accountCode\":{\n \t\t\"id\":\"1\",\n \t\t\"glcode\":\"1\",\n \t\t\"tenantId\":\"default\"\n \t},\n\t\t\t\"tenantId\":\"default\"\n \t\t}\n \t]\n}" - }, - "description": "InstrumentAccountCode creation success" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instrumentaccountcodes/_update", - "request": { - "url": "localhost:8480/egf-instrument/instrumentaccountcodes/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentAccountCodes\":[\n \t\t{\n \t\t\t\"id\":\"e0b3c3d5715f4163b11ca7b269e95603\",\n\t\t\t \"instrumentType\":{\n\t \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n\t \"name\":\"DD\"\n \t},\n \t\"accountCode\":{\n \t\t\"id\":\"1\",\n \t\t\"glcode\":\"2\",\n \t\t\"tenantId\":\"default\"\n \t},\n\t\t\t\"tenantId\":\"default\"\n \t\t}\n \t]\n}" - }, - "description": "InstrumentAccountCode creation success" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/postman/InstrumentNegative.postman_collection.json b/business-services/egf-instrument/src/postman/InstrumentNegative.postman_collection.json deleted file mode 100644 index f77ba5b286e..00000000000 --- a/business-services/egf-instrument/src/postman/InstrumentNegative.postman_collection.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "variables": [], - "info": { - "name": "InstrumentNegative", - "_postman_id": "d2c8c9db-ea19-422c-9490-3f337330883f", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \n \"transactionDate\":\"23-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n \"bank\":{\n \"id\":10,\n \"code\":\"10\",\n \"name\":\"nameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n \"bank\":{\n \"id\":10000,\n \"code\":\"10\",\n \"name\":\"neameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"DD\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Negative : DD InstrumentType without Transaction Number" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \n \"transactionDate\":\"23-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n \"bank\":{\n \"id\":10,\n \"code\":\"10\",\n \"name\":\"nameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n \"bank\":{\n \"id\":10000,\n \"code\":\"10\",\n \"name\":\"neameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"Cheque\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Negative : Cheque InstrumentType, without Transaction Number, Instrument creation fails" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \n \"transactionDate\":\"23-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n \"bank\":{\n \"id\":10,\n \"code\":\"10\",\n \"name\":\"nameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n \"bank\":{\n \"id\":10000,\n \"code\":\"10\",\n \"name\":\"neameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"Cash\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Negative : Cash InstrumentType, without Transaction Number, Instrument creation fails" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \"transactionNumber\":\"transactionNumber\",\n \"transactionDate\":\"23-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n \"bank\":{\n \"id\":10000,\n \"code\":\"10\",\n \"name\":\"neameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"BankChallan\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Negative : BankChallan InstrumentType, without Bank Details, Instrument creation fails" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/postman/InstrumentPositive.postman_collection.json b/business-services/egf-instrument/src/postman/InstrumentPositive.postman_collection.json deleted file mode 100644 index c06fd3b5530..00000000000 --- a/business-services/egf-instrument/src/postman/InstrumentPositive.postman_collection.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "variables": [], - "info": { - "name": "InstrumentPositive", - "_postman_id": "ba7cac8b-86e4-87b3-fc4e-d3e91166cdd9", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \"transactionNumber\":\"transactionNumber\",\n \"transactionDate\":\"23-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n \"bank\":{\n \"id\":10,\n \"code\":\"10\",\n \"name\":\"nameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n \"bank\":{\n \"id\":10000,\n \"code\":\"10\",\n \"name\":\"neameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"DD\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Positive : DD Instrument Type, create Instrument success" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \"transactionNumber\":\"transactionNumber\",\n \"transactionDate\":\"23-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n \"bank\":{\n \"id\":10,\n \"code\":\"10\",\n \"name\":\"nameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n \"bank\":{\n \"id\":10000,\n \"code\":\"10\",\n \"name\":\"neameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"Cheque\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Positive : Cheque InstrumentType, Instrument Create success" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \"transactionNumber\":\"transactionNumber\",\n \"transactionDate\":\"24-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n \"bank\":{\n \"id\":10,\n \"code\":\"10\",\n \"name\":\"nameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n \"bank\":{\n \"id\":10000,\n \"code\":\"10\",\n \"name\":\"neameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"Cash\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Positive : Cash InstrumentType, Instrument Create success" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instruments/_create", - "request": { - "url": "localhost:8480/egf-instrument/instruments/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instruments\":[\n {\n \"id\":\"hello\",\n \"transactionNumber\":\"transactionNumber\",\n \"transactionDate\":\"23-08-2017\",\n \"amount\":100,\n \"payee\":\"payee\",\n \"transactionType\":\"Credit\",\n \"bank\":{\n \"id\":10,\n \"code\":\"10\",\n \"name\":\"nameupdate\",\n \"description\":\"descriptionupdate\",\n \"active\":true,\n \"type\":\"typeupdate\",\n \"tenantId\":\"default\"\n },\n \"bankAccount\":{\n \t\"id\":\"1\",\n \"bankBranch\":{\n \"id\":\"1\",\n\n \"code\":\"Rajesh\",\n \"name\":\"Rajesh\",\n \"active\":true,\n \"micr\":\"Rajesh\",\n \"tenantId\":\"default\"\n },\n \"chartOfAccount\":{\n \"id\":\"1223\",\n \"tenantId\":\"default\"\n },\n \"fund\":{\n \"id\":\"1\",\n \"tenantId\":\"default\"\n },\n \"accountNumber\":\"000000000001\",\n \"accountType\":\"OTHER SCHEDULED BANKS\",\n \"active\":true,\n \"type\":\"RECEIPTS_PAYMENTS\",\n \"tenantId\":\"default\"\n },\n \"instrumentType\":{\n \"id\":\"f3ae954c-74b0-47d9-9c17-088362c31e35\",\n \"name\":\"BankChallan\",\n \"active\":\"true\",\n \"tenantId\":\"default\"\n },\n \"serialNo\":\"serialNo\",\n \"tenantId\":\"default\"\n }\n ]\n}" - }, - "description": "Positive : BankChallan InstrumentType, Instrument create success" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/postman/InstrumentTypeNegative.postman_collection.json b/business-services/egf-instrument/src/postman/InstrumentTypeNegative.postman_collection.json deleted file mode 100644 index a634792eacf..00000000000 --- a/business-services/egf-instrument/src/postman/InstrumentTypeNegative.postman_collection.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "variables": [], - "info": { - "name": "InstrumentType Negative", - "_postman_id": "c8b42fd1-0246-6507-20ab-1fc65a08c198", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/instrumenttypes/_create", - "request": { - "url": "localhost:8480/egf-instrument/instrumenttypes/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentTypes\":[\n \t\t{\n \t\t\t\"id\":\"1\",\n \t\t\t\"description\":\"newdescription\",\n \t\t\t\"active\":true,\n \t\t\t\"tenantId\":\"default\",\n \t\t\t\"instrumentTypeProperties\":[\n \t\t\t\t{\n \t\t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Credit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Debit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t}\n \t\t\t\t]\n \t\t}\n \t]\n}" - }, - "description": "Instrumenttype create failed because name is not mentioned and it is mandatory" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instrumenttypes/_update", - "request": { - "url": "localhost:8480/egf-instrument/instrumenttypes/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentTypes\":[\n \t\t{\n \t\t\t\"id\":\"12861237\",\n \t\t\t\"name\":\"asdabarathnewn234am213e\",\n \t\t\t\"description\":\"newdescription\",\n \t\t\t\"active\":true,\n \t\t\t\"instrumentTypeProperties\":[\n \t\t\t\t{\n \t\t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Credit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Debit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t}\n \t\t\t\t]\n \t\t}\n \t]\n}" - }, - "description": "Update failed since tenantId is not mentioned" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/postman/InstrumentTypesPositive.postman_collection.json b/business-services/egf-instrument/src/postman/InstrumentTypesPositive.postman_collection.json deleted file mode 100644 index 5d55076505c..00000000000 --- a/business-services/egf-instrument/src/postman/InstrumentTypesPositive.postman_collection.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "variables": [], - "info": { - "name": "InstrumentTypesPositive", - "_postman_id": "3dbce50e-48f3-d89b-c2d8-fef8db1218c5", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/instrumenttypes/_create", - "request": { - "url": "localhost:8480/egf-instrument/instrumenttypes/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentTypes\":[\n \t\t{\n \t\t\t\"id\":\"1\",\n \t\t\t\"name\":\"newname\",\n \t\t\t\"description\":\"newdescription\",\n \t\t\t\"active\":true,\n \t\t\t\"tenantId\":\"default\",\n \t\t\t\"instrumentTypeProperties\":[\n \t\t\t\t{\n \t\t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Credit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Debit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t}\n \t\t\t\t]\n \t\t}\n \t]\n}" - }, - "description": "Instrumenttype create success" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/instrumenttypes/_update", - "request": { - "url": "localhost:8480/egf-instrument/instrumenttypes/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"instrumentTypes\":[\n \t\t{\n \t\t\t\"id\":\"12861237\",\n \t\t\t\"name\":\"barathnewn234am213e\",\n \t\t\t\"description\":\"newdescription\",\n \t\t\t\"active\":true,\n \t\t\t\"tenantId\":\"default\",\n \t\t\t\"instrumentTypeProperties\":[\n \t\t\t\t{\n \t\t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Credit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"id\":\"0ee4059b-e056-4070-90dd-8e52747fe5be\",\n \t\t\t\t\t\"transactionType\":\"Debit\",\n \t\t\t\t\t\"reconciledOncreate\":false,\n \t\t\t\t\t\"statusOnCreate\":\"New\",\n \t\t\t\t\t\"statusOnUpdate\":\"Deposited\",\n \t\t\t\t\t\"statusOnReconcile\":\"Reconciled\",\n \t\t\t\t\t\"instrumentType\":\"Online\"\n \t\t\t\t\n \t\t\t}\n \t\t\t\t]\n \t\t}\n \t]\n}" - }, - "description": "Update success" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/postman/SurrenderReasonNegative.postman_collection.json b/business-services/egf-instrument/src/postman/SurrenderReasonNegative.postman_collection.json deleted file mode 100644 index 69abd38ca20..00000000000 --- a/business-services/egf-instrument/src/postman/SurrenderReasonNegative.postman_collection.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "variables": [], - "info": { - "name": "SurrenderReasonNegative", - "_postman_id": "771f2fbe-d3cf-6bb5-120f-c1215cf7419e", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/surrenderreasons/_create", - "request": { - "url": "localhost:8480/egf-instrument/surrenderreasons/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"surrenderReasons\":[\n \t\t{\n\t\t\t\"name\":\"Reason4\",\n\t\t\t\"description\": \"Reason4 Description\"\n \t\t}\n \t]\n}" - }, - "description": "Surrender Reason create failed because no tenantId specifieds" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/surrenderreasons/_update", - "request": { - "url": "localhost:8480/egf-instrument/surrenderreasons/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"surrenderReasons\":[\n \t\t{\n \t\t\t\"id\":\"b7263b99e85b41449be5b675f286c043\",\n\t\t\t\"name\":\"Reason3\",\n\t\t\t\"description\": \"Reason3 Description Update\"\n \t\t}\n \t]\n}" - }, - "description": "SurrenderReason Update filed because no tenantId specified" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/surrenderreasons/_delete", - "request": { - "url": "localhost:8480/egf-instrument/surrenderreasons/_delete", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"surrenderReasons\":[\n \t{\n \t\t\n \t}\n \t]\n}" - }, - "description": "SurrenderReason delete fails because no ID is specified" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/postman/SurrenderReasonPositive.postman_collection.json b/business-services/egf-instrument/src/postman/SurrenderReasonPositive.postman_collection.json deleted file mode 100644 index eb776ffabcd..00000000000 --- a/business-services/egf-instrument/src/postman/SurrenderReasonPositive.postman_collection.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "variables": [], - "info": { - "name": "SurrenderReasonPositive", - "_postman_id": "859345ff-98dc-21dc-7fe8-bf235f57a4c7", - "description": "Surrender Reason postman Test cases\n", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "localhost:8480/egf-instrument/surrenderreasons/_update", - "request": { - "url": "localhost:8480/egf-instrument/surrenderreasons/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"surrenderReasons\":[\n \t\t{\n \t\t\t\"id\":\"b7263b99e85b41449be5b675f286c043\",\n\t\t\t\"name\":\"Reason3\",\n\t\t\t\"description\": \"Reason3 Description Update\",\n\t\t\t\"tenantId\":\"default\"\n \t\t}\n \t]\n}" - }, - "description": "Surrender Reason create API success" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/surrenderreasons/_create", - "request": { - "url": "localhost:8480/egf-instrument/surrenderreasons/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"surrenderReasons\":[\n \t\t{\n\t\t\t\"name\":\"Reason3\",\n\t\t\t\"description\": \"Reason3 Description\",\n\t\t\t\"tenantId\":\"default\"\n \t\t}\n \t]\n}" - }, - "description": "Surrender Reason create API success" - }, - "response": [] - }, - { - "name": "localhost:8480/egf-instrument/surrenderreasons/_delete", - "request": { - "url": "localhost:8480/egf-instrument/surrenderreasons/_delete", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"requestInfo\":{\n \"resMsgId\":\"placeholder\",\n \"status\":\"200\",\n \"apiId\":null,\n \"ver\":null,\n \"ts\":\"01-01-2017 01:01:01\",\n \"key\":null,\n \"authToken\":\"\",\n \"userInfo\":{\n \"id\":1\n }\n },\n \"surrenderReasons\":[\n \t{\n \t\t\"id\":\"b7263b99e85b41449be5b675f286c043\"\n \t}\n \t]\n}" - }, - "description": "SurrenderReason delete success" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/TestConfiguration.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/TestConfiguration.java deleted file mode 100644 index ed935721b6c..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/TestConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.instrument; - -import static org.mockito.Mockito.mock; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.kafka.core.KafkaTemplate; - -@Configuration -public class TestConfiguration { - - @Bean - @SuppressWarnings("unchecked") - public KafkaTemplate kafkaTemplate() { - return mock(KafkaTemplate.class); - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeRepositoryTest.java deleted file mode 100644 index 5079e8964af..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentAccountCodeRepositoryTest.java +++ /dev/null @@ -1,301 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.persistence.entity.InstrumentAccountCodeEntity; -import org.egov.egf.instrument.persistence.queue.repository.InstrumentAccountCodeQueueRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentAccountCodeJdbcRepository; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeRequest; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentAccountCodeRepositoryTest { - - private InstrumentAccountCodeRepository instrumentAccountCodeRepositoryWithKafka; - - private InstrumentAccountCodeRepository instrumentAccountCodeRepositoryWithOutKafka; - - @Mock - private InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository; - - @Mock - private InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository; - - @Mock - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - @Mock - private InstrumentAccountCodeESRepository instrumentAccountCodeESRepository; - - @Captor - private ArgumentCaptor captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - instrumentAccountCodeRepositoryWithKafka = new InstrumentAccountCodeRepository( - instrumentAccountCodeJdbcRepository, instrumentAccountCodeQueueRepository, "yes", - instrumentAccountCodeESRepository, financialConfigurationContractRepository); - - instrumentAccountCodeRepositoryWithOutKafka = new InstrumentAccountCodeRepository( - instrumentAccountCodeJdbcRepository, instrumentAccountCodeQueueRepository, "no", - instrumentAccountCodeESRepository, financialConfigurationContractRepository); - } - - @Test - public void test_find_by_id() { - InstrumentAccountCodeEntity entity = getInstrumentAccountCodeEntity(); - InstrumentAccountCode expectedResult = entity.toDomain(); - - when(instrumentAccountCodeJdbcRepository.findById(any(InstrumentAccountCodeEntity.class))).thenReturn(entity); - - InstrumentAccountCode actualResult = instrumentAccountCodeRepositoryWithKafka - .findById(getInstrumentAccountCodeDomin()); - - assertEquals(expectedResult.getAccountCode().getId(), actualResult.getAccountCode().getId()); - assertEquals(expectedResult.getInstrumentType().getId(), actualResult.getInstrumentType().getId()); - } - - @Test - public void test_find_by_id_return_null() { - InstrumentAccountCodeEntity entity = getInstrumentAccountCodeEntity(); - - Mockito.lenient().when(instrumentAccountCodeJdbcRepository.findById(null)).thenReturn(entity); - - InstrumentAccountCode actualResult = instrumentAccountCodeRepositoryWithKafka - .findById(getInstrumentAccountCodeDomin()); - - assertEquals(null, actualResult); - } - - @Test - public void test_save_with_kafka() { - - List expectedResult = getInstrumentAccountCodes(); - - instrumentAccountCodeRepositoryWithKafka.save(expectedResult, requestInfo); - - verify(instrumentAccountCodeQueueRepository).addToQue(captor.capture()); - - final InstrumentAccountCodeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getInstrumentType().getName(), - actualRequest.getInstrumentAccountCodes().get(0).getInstrumentType().getName()); - assertEquals(expectedResult.get(0).getAccountCode().getGlcode(), - actualRequest.getInstrumentAccountCodes().get(0).getAccountCode().getGlcode()); - assertEquals(expectedResult.get(0).getTenantId(), - actualRequest.getInstrumentAccountCodes().get(0).getTenantId()); - } - - @Test - public void test_save_with_out_kafka() { - - List expectedResult = getInstrumentAccountCodes(); - - InstrumentAccountCodeEntity entity = new InstrumentAccountCodeEntity().toEntity(expectedResult.get(0)); - - when(instrumentAccountCodeJdbcRepository.create(any(InstrumentAccountCodeEntity.class))).thenReturn(entity); - - instrumentAccountCodeRepositoryWithOutKafka.save(expectedResult, requestInfo); - - verify(instrumentAccountCodeQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentAccountCodeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getInstrumentType().getName(), - actualRequest.getInstrumentAccountCodes().get(0).getInstrumentType().getName()); - assertEquals(expectedResult.get(0).getAccountCode().getGlcode(), - actualRequest.getInstrumentAccountCodes().get(0).getAccountCode().getGlcode()); - assertEquals(expectedResult.get(0).getTenantId(), - actualRequest.getInstrumentAccountCodes().get(0).getTenantId()); - } - - @Test - public void test_update_with_kafka() { - - List expectedResult = getInstrumentAccountCodes(); - - instrumentAccountCodeRepositoryWithKafka.update(expectedResult, requestInfo); - - verify(instrumentAccountCodeQueueRepository).addToQue(captor.capture()); - - final InstrumentAccountCodeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getInstrumentType().getName(), - actualRequest.getInstrumentAccountCodes().get(0).getInstrumentType().getName()); - assertEquals(expectedResult.get(0).getAccountCode().getGlcode(), - actualRequest.getInstrumentAccountCodes().get(0).getAccountCode().getGlcode()); - assertEquals(expectedResult.get(0).getTenantId(), - actualRequest.getInstrumentAccountCodes().get(0).getTenantId()); - } - - @Test - public void test_delete_with_kafka() { - - List expectedResult = getInstrumentAccountCodes(); - - instrumentAccountCodeRepositoryWithKafka.delete(expectedResult, requestInfo); - - verify(instrumentAccountCodeQueueRepository).addToQue(captor.capture()); - - final InstrumentAccountCodeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getInstrumentType().getName(), - actualRequest.getInstrumentAccountCodes().get(0).getInstrumentType().getName()); - assertEquals(expectedResult.get(0).getAccountCode().getGlcode(), - actualRequest.getInstrumentAccountCodes().get(0).getAccountCode().getGlcode()); - assertEquals(expectedResult.get(0).getTenantId(), - actualRequest.getInstrumentAccountCodes().get(0).getTenantId()); - } - - @Test - public void test_update_with_out_kafka() { - - List expectedResult = getInstrumentAccountCodes(); - - InstrumentAccountCodeEntity entity = new InstrumentAccountCodeEntity().toEntity(expectedResult.get(0)); - - when(instrumentAccountCodeJdbcRepository.update(any(InstrumentAccountCodeEntity.class))).thenReturn(entity); - - instrumentAccountCodeRepositoryWithOutKafka.update(expectedResult, requestInfo); - - verify(instrumentAccountCodeQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentAccountCodeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getInstrumentType().getName(), - actualRequest.getInstrumentAccountCodes().get(0).getInstrumentType().getName()); - assertEquals(expectedResult.get(0).getAccountCode().getGlcode(), - actualRequest.getInstrumentAccountCodes().get(0).getAccountCode().getGlcode()); - assertEquals(expectedResult.get(0).getTenantId(), - actualRequest.getInstrumentAccountCodes().get(0).getTenantId()); - } - - @Test - public void test_delete_with_out_kafka() { - - List expectedResult = getInstrumentAccountCodes(); - - InstrumentAccountCodeEntity entity = new InstrumentAccountCodeEntity().toEntity(expectedResult.get(0)); - - when(instrumentAccountCodeJdbcRepository.delete(any(InstrumentAccountCodeEntity.class))).thenReturn(entity); - - instrumentAccountCodeRepositoryWithOutKafka.delete(expectedResult, requestInfo); - - verify(instrumentAccountCodeQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentAccountCodeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getInstrumentType().getName(), - actualRequest.getInstrumentAccountCodes().get(0).getInstrumentType().getName()); - assertEquals(expectedResult.get(0).getAccountCode().getGlcode(), - actualRequest.getInstrumentAccountCodes().get(0).getAccountCode().getGlcode()); - assertEquals(expectedResult.get(0).getTenantId(), - actualRequest.getInstrumentAccountCodes().get(0).getTenantId()); - } - - @Test - public void test_save() { - - InstrumentAccountCodeEntity entity = getInstrumentAccountCodeEntity(); - InstrumentAccountCode expectedResult = entity.toDomain(); - - when(instrumentAccountCodeJdbcRepository.create(any(InstrumentAccountCodeEntity.class))).thenReturn(entity); - - InstrumentAccountCode actualResult = instrumentAccountCodeRepositoryWithKafka - .save(getInstrumentAccountCodeDomin()); - - assertEquals(expectedResult.getAccountCode().getId(), actualResult.getAccountCode().getId()); - assertEquals(expectedResult.getInstrumentType().getId(), actualResult.getInstrumentType().getId()); - - } - - @Test - public void test_update() { - - InstrumentAccountCodeEntity entity = getInstrumentAccountCodeEntity(); - InstrumentAccountCode expectedResult = entity.toDomain(); - - when(instrumentAccountCodeJdbcRepository.update(any(InstrumentAccountCodeEntity.class))).thenReturn(entity); - - InstrumentAccountCode actualResult = instrumentAccountCodeRepositoryWithKafka - .update(getInstrumentAccountCodeDomin()); - - assertEquals(expectedResult.getAccountCode().getId(), actualResult.getAccountCode().getId()); - assertEquals(expectedResult.getInstrumentType().getId(), actualResult.getInstrumentType().getId()); - } - - @Test - public void test_search() { - - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - - when(financialConfigurationContractRepository.fetchDataFrom()).thenReturn("db"); - when(instrumentAccountCodeJdbcRepository.search(any(InstrumentAccountCodeSearch.class))) - .thenReturn(expectedResult); - - Pagination actualResult = instrumentAccountCodeRepositoryWithKafka - .search(getInstrumentAccountCodeSearch()); - - assertEquals(expectedResult, actualResult); - - } - - private InstrumentAccountCode getInstrumentAccountCodeDomin() { - InstrumentAccountCode instrumentAccountCodeDetail = new InstrumentAccountCode(); - instrumentAccountCodeDetail.setAccountCode(ChartOfAccountContract.builder().id("accountCodeId").build()); - instrumentAccountCodeDetail.setInstrumentType(InstrumentType.builder().id("instrumentTypeId").build()); - instrumentAccountCodeDetail.setTenantId("default"); - return instrumentAccountCodeDetail; - } - - private InstrumentAccountCodeEntity getInstrumentAccountCodeEntity() { - InstrumentAccountCodeEntity entity = new InstrumentAccountCodeEntity(); - entity.setAccountCodeId("accountCodeId"); - entity.setInstrumentTypeId("instrumentTypeId"); - entity.setTenantId("default"); - return entity; - } - - private InstrumentAccountCodeSearch getInstrumentAccountCodeSearch() { - InstrumentAccountCodeSearch instrumentAccountCodeSearch = new InstrumentAccountCodeSearch(); - instrumentAccountCodeSearch.setPageSize(500); - instrumentAccountCodeSearch.setOffset(0); - return instrumentAccountCodeSearch; - - } - - private List getInstrumentAccountCodes() { - List instrumentAccountCodes = new ArrayList(); - InstrumentAccountCode instrumentAccountCode = InstrumentAccountCode.builder() - .instrumentType(InstrumentType.builder().active(true).id("instrumenttypeid").build()) - .accountCode(ChartOfAccountContract.builder().id("accountcodeid").build()).build(); - instrumentAccountCode.setTenantId("default"); - instrumentAccountCodes.add(instrumentAccountCode); - return instrumentAccountCodes; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentRepositoryTest.java deleted file mode 100644 index 232d5a157fe..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentRepositoryTest.java +++ /dev/null @@ -1,330 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.instrument.persistence.entity.InstrumentEntity; -import org.egov.egf.instrument.persistence.queue.repository.InstrumentQueueRepository; -import org.egov.egf.instrument.persistence.repository.DishonorReasonJdbcRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentJdbcRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentVoucherJdbcRepository; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentRepositoryTest { - - private InstrumentRepository instrumentRepositoryWithKafka; - - private InstrumentRepository instrumentRepositoryWithOutKafka; - - @Mock - private InstrumentQueueRepository instrumentQueueRepository; - - @Mock - private InstrumentJdbcRepository instrumentJdbcRepository; - - @Mock - private InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository; - - @Mock - private InstrumentESRepository instrumentESRepository; - - @Mock - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - @Mock - private DishonorReasonJdbcRepository dishonorReasonJdbcRepository; - - @Captor - private ArgumentCaptor captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - instrumentRepositoryWithKafka = new InstrumentRepository(instrumentJdbcRepository, instrumentQueueRepository, - "yes", instrumentESRepository, financialConfigurationContractRepository, instrumentVoucherJdbcRepository, dishonorReasonJdbcRepository); - - instrumentRepositoryWithOutKafka = new InstrumentRepository(instrumentJdbcRepository, instrumentQueueRepository, - "no", instrumentESRepository, financialConfigurationContractRepository, instrumentVoucherJdbcRepository, dishonorReasonJdbcRepository); - } - - @Test - public void test_find_by_id() { - InstrumentEntity entity = getInstrumentEntity(); - Instrument expectedResult = entity.toDomain(); - - when(instrumentJdbcRepository.findById(any(InstrumentEntity.class))).thenReturn(entity); - - Instrument actualResult = instrumentRepositoryWithKafka.findById(getInstrumentDomin()); - - assertEquals(expectedResult.getAmount(), actualResult.getAmount()); - assertEquals(expectedResult.getTransactionNumber(), actualResult.getTransactionNumber()); - assertEquals(expectedResult.getSerialNo(), actualResult.getSerialNo()); - assertEquals(expectedResult.getTransactionType(), actualResult.getTransactionType()); - assertEquals(expectedResult.getInstrumentType().getId(), actualResult.getInstrumentType().getId()); - } - - @Test - public void test_find_by_id_return_null() { - InstrumentEntity entity = getInstrumentEntity(); - - Mockito.lenient().when(instrumentJdbcRepository.findById(null)).thenReturn(entity); - - Instrument actualResult = instrumentRepositoryWithKafka.findById(getInstrumentDomin()); - - assertEquals(null, actualResult); - } - - @Test - public void test_save_with_kafka() { - - List expectedResult = getInstruments(); - - instrumentRepositoryWithKafka.save(expectedResult, requestInfo); - - verify(instrumentQueueRepository).addToQue(captor.capture()); - - final InstrumentRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getAmount(), actualRequest.getInstruments().get(0).getAmount()); - assertEquals(expectedResult.get(0).getTransactionNumber(), - actualRequest.getInstruments().get(0).getTransactionNumber()); - assertEquals(expectedResult.get(0).getSerialNo(), actualRequest.getInstruments().get(0).getSerialNo()); - assertEquals(expectedResult.get(0).getTransactionType().name(), - actualRequest.getInstruments().get(0).getTransactionType().name()); - assertEquals(expectedResult.get(0).getInstrumentType().getId(), - actualRequest.getInstruments().get(0).getInstrumentType().getId()); - - } - - @Test - public void test_save_with_out_kafka() { - - List expectedResult = getInstruments(); - - InstrumentEntity entity = new InstrumentEntity().toEntity(expectedResult.get(0)); - - when(instrumentJdbcRepository.create(any(InstrumentEntity.class))).thenReturn(entity); - - instrumentRepositoryWithOutKafka.save(expectedResult, requestInfo); - - verify(instrumentQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getAmount(), actualRequest.getInstruments().get(0).getAmount()); - assertEquals(expectedResult.get(0).getTransactionNumber(), - actualRequest.getInstruments().get(0).getTransactionNumber()); - assertEquals(expectedResult.get(0).getSerialNo(), actualRequest.getInstruments().get(0).getSerialNo()); - assertEquals(expectedResult.get(0).getTransactionType().name(), - actualRequest.getInstruments().get(0).getTransactionType().name()); - assertEquals(expectedResult.get(0).getInstrumentType().getId(), - actualRequest.getInstruments().get(0).getInstrumentType().getId()); - } - - @Test - public void test_update_with_kafka() { - - List expectedResult = getInstruments(); - - instrumentRepositoryWithKafka.update(expectedResult, requestInfo); - - verify(instrumentQueueRepository).addToQue(captor.capture()); - - final InstrumentRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getAmount(), actualRequest.getInstruments().get(0).getAmount()); - assertEquals(expectedResult.get(0).getTransactionNumber(), - actualRequest.getInstruments().get(0).getTransactionNumber()); - assertEquals(expectedResult.get(0).getSerialNo(), actualRequest.getInstruments().get(0).getSerialNo()); - assertEquals(expectedResult.get(0).getTransactionType().name(), - actualRequest.getInstruments().get(0).getTransactionType().name()); - assertEquals(expectedResult.get(0).getInstrumentType().getId(), - actualRequest.getInstruments().get(0).getInstrumentType().getId()); - } - - @Test - public void test_delete_with_kafka() { - - List expectedResult = getInstruments(); - - instrumentRepositoryWithKafka.delete(expectedResult, requestInfo); - - verify(instrumentQueueRepository).addToQue(captor.capture()); - - final InstrumentRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getAmount(), actualRequest.getInstruments().get(0).getAmount()); - assertEquals(expectedResult.get(0).getTransactionNumber(), - actualRequest.getInstruments().get(0).getTransactionNumber()); - assertEquals(expectedResult.get(0).getSerialNo(), actualRequest.getInstruments().get(0).getSerialNo()); - assertEquals(expectedResult.get(0).getTransactionType().name(), - actualRequest.getInstruments().get(0).getTransactionType().name()); - assertEquals(expectedResult.get(0).getInstrumentType().getId(), - actualRequest.getInstruments().get(0).getInstrumentType().getId()); - } - - @Test - public void test_update_with_out_kafka() { - - List expectedResult = getInstruments(); - - InstrumentEntity entity = new InstrumentEntity().toEntity(expectedResult.get(0)); - - when(instrumentJdbcRepository.update(any(InstrumentEntity.class))).thenReturn(entity); - - instrumentRepositoryWithOutKafka.update(expectedResult, requestInfo); - - verify(instrumentQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getAmount(), actualRequest.getInstruments().get(0).getAmount()); - assertEquals(expectedResult.get(0).getTransactionNumber(), - actualRequest.getInstruments().get(0).getTransactionNumber()); - assertEquals(expectedResult.get(0).getSerialNo(), actualRequest.getInstruments().get(0).getSerialNo()); - assertEquals(expectedResult.get(0).getTransactionType().name(), - actualRequest.getInstruments().get(0).getTransactionType().name()); - assertEquals(expectedResult.get(0).getInstrumentType().getId(), - actualRequest.getInstruments().get(0).getInstrumentType().getId()); - } - - @Test - public void test_delete_with_out_kafka() { - - List expectedResult = getInstruments(); - - InstrumentEntity entity = new InstrumentEntity().toEntity(expectedResult.get(0)); - - when(instrumentJdbcRepository.delete(any(InstrumentEntity.class))).thenReturn(entity); - - instrumentRepositoryWithOutKafka.delete(expectedResult, requestInfo); - - verify(instrumentQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getAmount(), actualRequest.getInstruments().get(0).getAmount()); - assertEquals(expectedResult.get(0).getTransactionNumber(), - actualRequest.getInstruments().get(0).getTransactionNumber()); - assertEquals(expectedResult.get(0).getSerialNo(), actualRequest.getInstruments().get(0).getSerialNo()); - assertEquals(expectedResult.get(0).getTransactionType().name(), - actualRequest.getInstruments().get(0).getTransactionType().name()); - assertEquals(expectedResult.get(0).getInstrumentType().getId(), - actualRequest.getInstruments().get(0).getInstrumentType().getId()); - } - - @Test - public void test_save() { - - InstrumentEntity entity = getInstrumentEntity(); - Instrument expectedResult = entity.toDomain(); - - when(instrumentJdbcRepository.create(any(InstrumentEntity.class))).thenReturn(entity); - - Instrument actualResult = instrumentRepositoryWithKafka.save(getInstrumentDomin()); - - assertEquals(expectedResult.getAmount(), actualResult.getAmount()); - assertEquals(expectedResult.getTransactionNumber(), actualResult.getTransactionNumber()); - assertEquals(expectedResult.getSerialNo(), actualResult.getSerialNo()); - assertEquals(expectedResult.getTransactionType(), actualResult.getTransactionType()); - assertEquals(expectedResult.getInstrumentType().getId(), actualResult.getInstrumentType().getId()); - - } - - @Test - public void test_update() { - - InstrumentEntity entity = getInstrumentEntity(); - Instrument expectedResult = entity.toDomain(); - - when(instrumentJdbcRepository.update(any(InstrumentEntity.class))).thenReturn(entity); - - Instrument actualResult = instrumentRepositoryWithKafka.update(getInstrumentDomin()); - - assertEquals(expectedResult.getAmount(), actualResult.getAmount()); - assertEquals(expectedResult.getTransactionNumber(), actualResult.getTransactionNumber()); - assertEquals(expectedResult.getSerialNo(), actualResult.getSerialNo()); - assertEquals(expectedResult.getTransactionType(), actualResult.getTransactionType()); - assertEquals(expectedResult.getInstrumentType().getId(), actualResult.getInstrumentType().getId()); - } - - @Test - public void test_search() { - - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - - when(financialConfigurationContractRepository.fetchDataFrom()).thenReturn("db"); - when(instrumentJdbcRepository.search(any(InstrumentSearch.class))).thenReturn(expectedResult); - - Pagination actualResult = instrumentRepositoryWithKafka.search(getInstrumentSearch()); - - assertEquals(expectedResult, actualResult); - - } - - private Instrument getInstrumentDomin() { - Instrument instrumentDetail = new Instrument(); - instrumentDetail.setAmount(BigDecimal.ONE); - instrumentDetail.setTransactionNumber("transactionNumber"); - instrumentDetail.setSerialNo("serialNo"); - instrumentDetail.setTransactionType(TransactionType.Credit); - instrumentDetail.setInstrumentType(InstrumentType.builder().id("instrumentTypeId").build()); - instrumentDetail.setTenantId("default"); - return instrumentDetail; - } - - private InstrumentEntity getInstrumentEntity() { - InstrumentEntity entity = new InstrumentEntity(); - entity.setAmount(BigDecimal.ONE); - entity.setTransactionNumber("transactionNumber"); - entity.setSerialNo("serialNo"); - entity.setTransactionType(TransactionType.Credit.name()); - entity.setInstrumentTypeId("instrumentTypeId"); - entity.setTenantId("default"); - return entity; - } - - private InstrumentSearch getInstrumentSearch() { - InstrumentSearch instrumentSearch = new InstrumentSearch(); - instrumentSearch.setPageSize(500); - instrumentSearch.setOffset(0); - return instrumentSearch; - - } - - private List getInstruments() { - List instruments = new ArrayList(); - Instrument instrument = Instrument.builder().transactionNumber("transactionNumber").amount(BigDecimal.ONE) - .transactionType(TransactionType.Credit).serialNo("serialNo") - .instrumentType(InstrumentType.builder().active(true).name("instrumenttype").build()).build(); - instrument.setTenantId("default"); - instruments.add(instrument); - return instruments; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentTypePropertyRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentTypePropertyRepositoryTest.java deleted file mode 100644 index c2c9f4c826e..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentTypePropertyRepositoryTest.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import org.egov.egf.instrument.domain.model.InstrumentTypeProperty; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.instrument.persistence.entity.InstrumentTypePropertyEntity; -import org.egov.egf.instrument.persistence.repository.InstrumentTypePropertyJdbcRepository; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentTypePropertyRepositoryTest { - - @InjectMocks - private InstrumentTypePropertyRepository instrumentTypePropertyRepository; - - @Mock - private InstrumentTypePropertyJdbcRepository instrumentTypePropertyJdbcRepository; - - @Test - public void test_find_by_id() { - InstrumentTypePropertyEntity entity = getInstrumentTypePropertyEntity(); - InstrumentTypeProperty expectedResult = entity.toDomain(); - - when(instrumentTypePropertyJdbcRepository.findById(any(InstrumentTypePropertyEntity.class))).thenReturn(entity); - - InstrumentTypeProperty actualResult = instrumentTypePropertyRepository - .findById(getInstrumentTypePropertyDomin()); - - assertEquals(expectedResult.getTransactionType(), actualResult.getTransactionType()); - assertEquals(expectedResult.getReconciledOncreate(), actualResult.getReconciledOncreate()); - assertEquals(expectedResult.getStatusOnCreate().getId(), actualResult.getStatusOnCreate().getId()); - assertEquals(expectedResult.getStatusOnReconcile().getId(), actualResult.getStatusOnReconcile().getId()); - assertEquals(expectedResult.getStatusOnUpdate().getId(), actualResult.getStatusOnUpdate().getId()); - - } - - @Test - public void test_find_by_id_return_null() { - InstrumentTypePropertyEntity entity = getInstrumentTypePropertyEntity(); - - Mockito.lenient().when(instrumentTypePropertyJdbcRepository.findById(null)).thenReturn(entity); - - InstrumentTypeProperty actualResult = instrumentTypePropertyRepository - .findById(getInstrumentTypePropertyDomin()); - - assertEquals(null, actualResult); - } - - @Test - public void test_save() { - - InstrumentTypePropertyEntity entity = getInstrumentTypePropertyEntity(); - InstrumentTypeProperty expectedResult = entity.toDomain(); - - when(instrumentTypePropertyJdbcRepository.create(any(InstrumentTypePropertyEntity.class))).thenReturn(entity); - - InstrumentTypeProperty actualResult = instrumentTypePropertyRepository.save(getInstrumentTypePropertyDomin()); - - assertEquals(expectedResult.getTransactionType(), actualResult.getTransactionType()); - assertEquals(expectedResult.getReconciledOncreate(), actualResult.getReconciledOncreate()); - assertEquals(expectedResult.getStatusOnCreate().getId(), actualResult.getStatusOnCreate().getId()); - assertEquals(expectedResult.getStatusOnReconcile().getId(), actualResult.getStatusOnReconcile().getId()); - assertEquals(expectedResult.getStatusOnUpdate().getId(), actualResult.getStatusOnUpdate().getId()); - - } - - @Test - public void test_update() { - - InstrumentTypePropertyEntity entity = getInstrumentTypePropertyEntity(); - InstrumentTypeProperty expectedResult = entity.toDomain(); - - when(instrumentTypePropertyJdbcRepository.update(any(InstrumentTypePropertyEntity.class))).thenReturn(entity); - - InstrumentTypeProperty actualResult = instrumentTypePropertyRepository.update(getInstrumentTypePropertyDomin()); - - assertEquals(expectedResult.getTransactionType(), actualResult.getTransactionType()); - assertEquals(expectedResult.getReconciledOncreate(), actualResult.getReconciledOncreate()); - assertEquals(expectedResult.getStatusOnCreate().getId(), actualResult.getStatusOnCreate().getId()); - assertEquals(expectedResult.getStatusOnReconcile().getId(), actualResult.getStatusOnReconcile().getId()); - assertEquals(expectedResult.getStatusOnUpdate().getId(), actualResult.getStatusOnUpdate().getId()); - } - - private InstrumentTypeProperty getInstrumentTypePropertyDomin() { - InstrumentTypeProperty instrumentTypePropertyDetail = new InstrumentTypeProperty(); - instrumentTypePropertyDetail.setTransactionType(TransactionType.Credit); - instrumentTypePropertyDetail.setReconciledOncreate(true); - instrumentTypePropertyDetail.setStatusOnCreate(FinancialStatusContract.builder().id("statusId").build()); - instrumentTypePropertyDetail.setStatusOnReconcile(FinancialStatusContract.builder().id("statusId").build()); - instrumentTypePropertyDetail.setStatusOnUpdate(FinancialStatusContract.builder().id("statusId").build()); - instrumentTypePropertyDetail.setTenantId("default"); - return instrumentTypePropertyDetail; - } - - private InstrumentTypePropertyEntity getInstrumentTypePropertyEntity() { - InstrumentTypePropertyEntity entity = new InstrumentTypePropertyEntity(); - entity.setTransactionType(TransactionType.Credit.name()); - entity.setReconciledOncreate(true); - entity.setStatusOnCreateId("statusId"); - entity.setStatusOnReconcileId("statusId"); - entity.setStatusOnUpdateId("statusId"); - entity.setTenantId("default"); - return entity; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentTypeRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentTypeRepositoryTest.java deleted file mode 100644 index 1675199a69d..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentTypeRepositoryTest.java +++ /dev/null @@ -1,292 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentTypeEntity; -import org.egov.egf.instrument.persistence.queue.repository.InstrumentTypeQueueRepository; -import org.egov.egf.instrument.persistence.repository.InstrumentTypeJdbcRepository; -import org.egov.egf.instrument.web.requests.InstrumentTypeRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentTypeRepositoryTest { - - @Mock - private InstrumentTypeJdbcRepository instrumentTypeJdbcRepository; - - private InstrumentTypeRepository instrumentTypeRepositoryWithKafka; - - private InstrumentTypeRepository instrumentTypeRepositoryWithOutKafka; - - @Mock - private InstrumentTypeQueueRepository instrumentTypeQueueRepository; - - @Mock - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - @Captor - private ArgumentCaptor captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Mock - private InstrumentTypeESRepository instrumentTypeESRepository; - - @Before - public void setup() { - instrumentTypeRepositoryWithKafka = new InstrumentTypeRepository(instrumentTypeJdbcRepository, - instrumentTypeQueueRepository, "yes", financialConfigurationContractRepository, instrumentTypeESRepository); - - instrumentTypeRepositoryWithOutKafka = new InstrumentTypeRepository(instrumentTypeJdbcRepository, - instrumentTypeQueueRepository, "no", financialConfigurationContractRepository, instrumentTypeESRepository); - } - - @Test - public void test_find_by_id() { - InstrumentTypeEntity entity = getInstrumentTypeEntity(); - InstrumentType expectedResult = entity.toDomain(); - - when(instrumentTypeJdbcRepository.findById(any(InstrumentTypeEntity.class))).thenReturn(entity); - - InstrumentType actualResult = instrumentTypeRepositoryWithKafka.findById(getInstrumentTypeDomin()); - - assertEquals(expectedResult.getActive(), actualResult.getActive()); - assertEquals(expectedResult.getName(), actualResult.getName()); - assertEquals(expectedResult.getDescription(), actualResult.getDescription()); - assertEquals(expectedResult.getTenantId(), actualResult.getTenantId()); - } - - @Test - public void test_find_by_id_return_null() { - InstrumentTypeEntity entity = getInstrumentTypeEntity(); - - Mockito.lenient().when(instrumentTypeJdbcRepository.findById(null)).thenReturn(entity); - - InstrumentType actualResult = instrumentTypeRepositoryWithKafka.findById(getInstrumentTypeDomin()); - - assertEquals(null, actualResult); - } - - @Test - public void test_save_with_kafka() { - - List expectedResult = getInstrumentTypes(); - - instrumentTypeRepositoryWithKafka.save(expectedResult, requestInfo); - - verify(instrumentTypeQueueRepository).addToQue(captor.capture()); - - final InstrumentTypeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getActive(), actualRequest.getInstrumentTypes().get(0).getActive()); - assertEquals(expectedResult.get(0).getName(), actualRequest.getInstrumentTypes().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getInstrumentTypes().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getInstrumentTypes().get(0).getTenantId()); - - } - - @Test - public void test_save_with_out_kafka() { - - List expectedResult = getInstrumentTypes(); - - InstrumentTypeEntity entity = new InstrumentTypeEntity().toEntity(expectedResult.get(0)); - - when(instrumentTypeJdbcRepository.create(any(InstrumentTypeEntity.class))).thenReturn(entity); - - instrumentTypeRepositoryWithOutKafka.save(expectedResult, requestInfo); - - verify(instrumentTypeQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentTypeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getActive(), actualRequest.getInstrumentTypes().get(0).getActive()); - assertEquals(expectedResult.get(0).getName(), actualRequest.getInstrumentTypes().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getInstrumentTypes().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getInstrumentTypes().get(0).getTenantId()); - } - - @Test - public void test_update_with_kafka() { - - List expectedResult = getInstrumentTypes(); - - instrumentTypeRepositoryWithKafka.update(expectedResult, requestInfo); - - verify(instrumentTypeQueueRepository).addToQue(captor.capture()); - - final InstrumentTypeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getActive(), actualRequest.getInstrumentTypes().get(0).getActive()); - assertEquals(expectedResult.get(0).getName(), actualRequest.getInstrumentTypes().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getInstrumentTypes().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getInstrumentTypes().get(0).getTenantId()); - } - - @Test - public void test_delete_with_kafka() { - - List expectedResult = getInstrumentTypes(); - - instrumentTypeRepositoryWithKafka.delete(expectedResult, requestInfo); - - verify(instrumentTypeQueueRepository).addToQue(captor.capture()); - - final InstrumentTypeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getActive(), actualRequest.getInstrumentTypes().get(0).getActive()); - assertEquals(expectedResult.get(0).getName(), actualRequest.getInstrumentTypes().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getInstrumentTypes().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getInstrumentTypes().get(0).getTenantId()); - } - - @Test - public void test_update_with_out_kafka() { - - List expectedResult = getInstrumentTypes(); - - InstrumentTypeEntity entity = new InstrumentTypeEntity().toEntity(expectedResult.get(0)); - - when(instrumentTypeJdbcRepository.update(any(InstrumentTypeEntity.class))).thenReturn(entity); - - instrumentTypeRepositoryWithOutKafka.update(expectedResult, requestInfo); - - verify(instrumentTypeQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentTypeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getActive(), actualRequest.getInstrumentTypes().get(0).getActive()); - assertEquals(expectedResult.get(0).getName(), actualRequest.getInstrumentTypes().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getInstrumentTypes().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getInstrumentTypes().get(0).getTenantId()); - } - - @Test - public void test_delete_with_out_kafka() { - - List expectedResult = getInstrumentTypes(); - - InstrumentTypeEntity entity = new InstrumentTypeEntity().toEntity(expectedResult.get(0)); - - when(instrumentTypeJdbcRepository.delete(any(InstrumentTypeEntity.class))).thenReturn(entity); - - instrumentTypeRepositoryWithOutKafka.delete(expectedResult, requestInfo); - - verify(instrumentTypeQueueRepository).addToSearchQue(captor.capture()); - - final InstrumentTypeRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getActive(), actualRequest.getInstrumentTypes().get(0).getActive()); - assertEquals(expectedResult.get(0).getName(), actualRequest.getInstrumentTypes().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getInstrumentTypes().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getInstrumentTypes().get(0).getTenantId()); - } - - @Test - public void test_save() { - - InstrumentTypeEntity entity = getInstrumentTypeEntity(); - InstrumentType expectedResult = entity.toDomain(); - - when(instrumentTypeJdbcRepository.create(any(InstrumentTypeEntity.class))).thenReturn(entity); - - InstrumentType actualResult = instrumentTypeRepositoryWithKafka.save(getInstrumentTypeDomin()); - - assertEquals(expectedResult.getActive(), actualResult.getActive()); - assertEquals(expectedResult.getName(), actualResult.getName()); - assertEquals(expectedResult.getDescription(), actualResult.getDescription()); - assertEquals(expectedResult.getTenantId(), actualResult.getTenantId()); - - } - - @Test - public void test_update() { - - InstrumentTypeEntity entity = getInstrumentTypeEntity(); - InstrumentType expectedResult = entity.toDomain(); - - when(instrumentTypeJdbcRepository.update(any(InstrumentTypeEntity.class))).thenReturn(entity); - - InstrumentType actualResult = instrumentTypeRepositoryWithKafka.update(getInstrumentTypeDomin()); - - assertEquals(expectedResult.getActive(), actualResult.getActive()); - assertEquals(expectedResult.getName(), actualResult.getName()); - assertEquals(expectedResult.getDescription(), actualResult.getDescription()); - assertEquals(expectedResult.getTenantId(), actualResult.getTenantId()); - } - - @Test - public void test_search() { - - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - - when(financialConfigurationContractRepository.fetchDataFrom()).thenReturn("db"); - when(instrumentTypeJdbcRepository.search(any(InstrumentTypeSearch.class))).thenReturn(expectedResult); - - Pagination actualResult = instrumentTypeRepositoryWithKafka.search(getInstrumentTypeSearch()); - - assertEquals(expectedResult, actualResult); - - } - - private InstrumentType getInstrumentTypeDomin() { - InstrumentType instrumentTypeDetail = new InstrumentType(); - instrumentTypeDetail.setActive(true); - instrumentTypeDetail.setName("name"); - instrumentTypeDetail.setDescription("description"); - instrumentTypeDetail.setTenantId("default"); - return instrumentTypeDetail; - } - - private InstrumentTypeEntity getInstrumentTypeEntity() { - InstrumentTypeEntity entity = new InstrumentTypeEntity(); - entity.setActive(true); - entity.setName("name"); - entity.setDescription("description"); - entity.setTenantId("default"); - return entity; - } - - private InstrumentTypeSearch getInstrumentTypeSearch() { - InstrumentTypeSearch instrumentTypeSearch = new InstrumentTypeSearch(); - instrumentTypeSearch.setPageSize(500); - instrumentTypeSearch.setOffset(0); - return instrumentTypeSearch; - - } - - private List getInstrumentTypes() { - List instrumentTypes = new ArrayList(); - InstrumentType instrumentType = InstrumentType.builder().name("name").description("description").active(true) - .build(); - instrumentType.setTenantId("default"); - instrumentTypes.add(instrumentType); - return instrumentTypes; - } -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentVoucherRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentVoucherRepositoryTest.java deleted file mode 100644 index bd9ac06fe48..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/InstrumentVoucherRepositoryTest.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.persistence.entity.InstrumentVoucherEntity; -import org.egov.egf.instrument.persistence.repository.InstrumentVoucherJdbcRepository; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentVoucherRepositoryTest { - - @InjectMocks - private InstrumentVoucherRepository instrumentVoucherRepository; - - @Mock - private InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository; - - @Test - public void test_find_by_id() { - InstrumentVoucherEntity entity = getInstrumentVoucherEntity(); - InstrumentVoucher expectedResult = entity.toDomain(); - - when(instrumentVoucherJdbcRepository.findById(any(InstrumentVoucherEntity.class))).thenReturn(entity); - - InstrumentVoucher actualResult = instrumentVoucherRepository.findById(getInstrumentVoucherDomin()); - - assertEquals(expectedResult.getVoucherHeaderId(), actualResult.getVoucherHeaderId()); - assertEquals(expectedResult.getInstrument().getId(), actualResult.getInstrument().getId()); - } - - @Test - public void test_find_by_id_return_null() { - InstrumentVoucherEntity entity = getInstrumentVoucherEntity(); - - Mockito.lenient().when(instrumentVoucherJdbcRepository.findById(null)).thenReturn(entity); - - InstrumentVoucher actualResult = instrumentVoucherRepository.findById(getInstrumentVoucherDomin()); - - assertEquals(null, actualResult); - } - - @Test - public void test_save() { - - InstrumentVoucherEntity entity = getInstrumentVoucherEntity(); - InstrumentVoucher expectedResult = entity.toDomain(); - - when(instrumentVoucherJdbcRepository.create(any(InstrumentVoucherEntity.class))).thenReturn(entity); - - InstrumentVoucher actualResult = instrumentVoucherRepository.save(getInstrumentVoucherDomin()); - - assertEquals(expectedResult.getVoucherHeaderId(), actualResult.getVoucherHeaderId()); - assertEquals(expectedResult.getInstrument().getId(), actualResult.getInstrument().getId()); - - } - - @Test - public void test_update() { - - InstrumentVoucherEntity entity = getInstrumentVoucherEntity(); - InstrumentVoucher expectedResult = entity.toDomain(); - - when(instrumentVoucherJdbcRepository.update(any(InstrumentVoucherEntity.class))).thenReturn(entity); - - InstrumentVoucher actualResult = instrumentVoucherRepository.update(getInstrumentVoucherDomin()); - - assertEquals(expectedResult.getVoucherHeaderId(), actualResult.getVoucherHeaderId()); - assertEquals(expectedResult.getInstrument().getId(), actualResult.getInstrument().getId()); - } - - private InstrumentVoucher getInstrumentVoucherDomin() { - InstrumentVoucher instrumentVoucherDetail = new InstrumentVoucher(); - instrumentVoucherDetail.setVoucherHeaderId("voucherHeaderId"); - instrumentVoucherDetail.setInstrument(Instrument.builder().id("instrumentId").build()); - instrumentVoucherDetail.setTenantId("default"); - return instrumentVoucherDetail; - } - - private InstrumentVoucherEntity getInstrumentVoucherEntity() { - InstrumentVoucherEntity entity = new InstrumentVoucherEntity(); - entity.setVoucherHeaderId("voucherHeaderId"); - entity.setInstrumentId("instrumentId"); - entity.setTenantId("default"); - return entity; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/SurrenderReasonRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/SurrenderReasonRepositoryTest.java deleted file mode 100644 index 4fc07e6f27a..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/repository/SurrenderReasonRepositoryTest.java +++ /dev/null @@ -1,282 +0,0 @@ -package org.egov.egf.instrument.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.persistence.entity.SurrenderReasonEntity; -import org.egov.egf.instrument.persistence.queue.repository.SurrenderReasonQueueRepository; -import org.egov.egf.instrument.persistence.repository.SurrenderReasonJdbcRepository; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.egov.egf.master.web.repository.FinancialConfigurationContractRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class SurrenderReasonRepositoryTest { - - @Mock - private SurrenderReasonJdbcRepository surrenderReasonJdbcRepository; - - private SurrenderReasonRepository surrenderReasonRepositoryWithKafka; - - private SurrenderReasonRepository surrenderReasonRepositoryWithOutKafka; - - @Mock - private SurrenderReasonQueueRepository surrenderReasonQueueRepository; - - @Captor - private ArgumentCaptor captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Mock - private FinancialConfigurationContractRepository financialConfigurationContractRepository; - - @Mock - private SurrenderReasonESRepository surrenderReasonESRepository; - - @Before - public void setup() { - surrenderReasonRepositoryWithKafka = new SurrenderReasonRepository(surrenderReasonJdbcRepository, - surrenderReasonQueueRepository, "yes", financialConfigurationContractRepository, surrenderReasonESRepository); - - surrenderReasonRepositoryWithOutKafka = new SurrenderReasonRepository(surrenderReasonJdbcRepository, - surrenderReasonQueueRepository, "no", financialConfigurationContractRepository, surrenderReasonESRepository); - } - - @Test - public void test_find_by_id() { - SurrenderReasonEntity entity = getSurrenderReasonEntity(); - SurrenderReason expectedResult = entity.toDomain(); - - when(surrenderReasonJdbcRepository.findById(any(SurrenderReasonEntity.class))).thenReturn(entity); - - SurrenderReason actualResult = surrenderReasonRepositoryWithKafka.findById(getSurrenderReasonDomin()); - - assertEquals(expectedResult.getName(), actualResult.getName()); - assertEquals(expectedResult.getDescription(), actualResult.getDescription()); - assertEquals(expectedResult.getTenantId(), actualResult.getTenantId()); - } - - @Test - public void test_find_by_id_return_null() { - SurrenderReasonEntity entity = getSurrenderReasonEntity(); - - Mockito.lenient().when(surrenderReasonJdbcRepository.findById(null)).thenReturn(entity); - - SurrenderReason actualResult = surrenderReasonRepositoryWithKafka.findById(getSurrenderReasonDomin()); - - assertEquals(null, actualResult); - } - - @Test - public void test_save_with_kafka() { - - List expectedResult = getSurrenderReasons(); - - surrenderReasonRepositoryWithKafka.save(expectedResult, requestInfo); - - verify(surrenderReasonQueueRepository).addToQue(captor.capture()); - - final SurrenderReasonRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getName(), actualRequest.getSurrenderReasons().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getSurrenderReasons().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getSurrenderReasons().get(0).getTenantId()); - - } - - @Test - public void test_save_with_out_kafka() { - - List expectedResult = getSurrenderReasons(); - - SurrenderReasonEntity entity = new SurrenderReasonEntity().toEntity(expectedResult.get(0)); - - when(surrenderReasonJdbcRepository.create(any(SurrenderReasonEntity.class))).thenReturn(entity); - - surrenderReasonRepositoryWithOutKafka.save(expectedResult, requestInfo); - - verify(surrenderReasonQueueRepository).addToSearchQue(captor.capture()); - - final SurrenderReasonRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getName(), actualRequest.getSurrenderReasons().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getSurrenderReasons().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getSurrenderReasons().get(0).getTenantId()); - } - - @Test - public void test_update_with_kafka() { - - List expectedResult = getSurrenderReasons(); - - surrenderReasonRepositoryWithKafka.update(expectedResult, requestInfo); - - verify(surrenderReasonQueueRepository).addToQue(captor.capture()); - - final SurrenderReasonRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getName(), actualRequest.getSurrenderReasons().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getSurrenderReasons().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getSurrenderReasons().get(0).getTenantId()); - } - - @Test - public void test_delete_with_kafka() { - - List expectedResult = getSurrenderReasons(); - - surrenderReasonRepositoryWithKafka.delete(expectedResult, requestInfo); - - verify(surrenderReasonQueueRepository).addToQue(captor.capture()); - - final SurrenderReasonRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getName(), actualRequest.getSurrenderReasons().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getSurrenderReasons().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getSurrenderReasons().get(0).getTenantId()); - } - - @Test - public void test_update_with_out_kafka() { - - List expectedResult = getSurrenderReasons(); - - SurrenderReasonEntity entity = new SurrenderReasonEntity().toEntity(expectedResult.get(0)); - - when(surrenderReasonJdbcRepository.update(any(SurrenderReasonEntity.class))).thenReturn(entity); - - surrenderReasonRepositoryWithOutKafka.update(expectedResult, requestInfo); - - verify(surrenderReasonQueueRepository).addToSearchQue(captor.capture()); - - final SurrenderReasonRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getName(), actualRequest.getSurrenderReasons().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getSurrenderReasons().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getSurrenderReasons().get(0).getTenantId()); - } - - @Test - public void test_delete_with_out_kafka() { - - List expectedResult = getSurrenderReasons(); - - SurrenderReasonEntity entity = new SurrenderReasonEntity().toEntity(expectedResult.get(0)); - - when(surrenderReasonJdbcRepository.delete(any(SurrenderReasonEntity.class))).thenReturn(entity); - - surrenderReasonRepositoryWithOutKafka.delete(expectedResult, requestInfo); - - verify(surrenderReasonQueueRepository).addToSearchQue(captor.capture()); - - final SurrenderReasonRequest actualRequest = captor.getValue(); - - assertEquals(expectedResult.get(0).getName(), actualRequest.getSurrenderReasons().get(0).getName()); - assertEquals(expectedResult.get(0).getDescription(), - actualRequest.getSurrenderReasons().get(0).getDescription()); - assertEquals(expectedResult.get(0).getTenantId(), actualRequest.getSurrenderReasons().get(0).getTenantId()); - } - - @Test - public void test_save() { - - SurrenderReasonEntity entity = getSurrenderReasonEntity(); - SurrenderReason expectedResult = entity.toDomain(); - - when(surrenderReasonJdbcRepository.create(any(SurrenderReasonEntity.class))).thenReturn(entity); - - SurrenderReason actualResult = surrenderReasonRepositoryWithKafka.save(getSurrenderReasonDomin()); - - assertEquals(expectedResult.getName(), actualResult.getName()); - assertEquals(expectedResult.getDescription(), actualResult.getDescription()); - assertEquals(expectedResult.getTenantId(), actualResult.getTenantId()); - - } - - @Test - public void test_update() { - - SurrenderReasonEntity entity = getSurrenderReasonEntity(); - SurrenderReason expectedResult = entity.toDomain(); - - when(surrenderReasonJdbcRepository.update(any(SurrenderReasonEntity.class))).thenReturn(entity); - - SurrenderReason actualResult = surrenderReasonRepositoryWithKafka.update(getSurrenderReasonDomin()); - - assertEquals(expectedResult.getName(), actualResult.getName()); - assertEquals(expectedResult.getDescription(), actualResult.getDescription()); - assertEquals(expectedResult.getTenantId(), actualResult.getTenantId()); - } - - @Test - public void test_search() { - - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - - when(financialConfigurationContractRepository.fetchDataFrom()).thenReturn("db"); - when(surrenderReasonJdbcRepository.search(any(SurrenderReasonSearch.class))).thenReturn(expectedResult); - - Pagination actualResult = surrenderReasonRepositoryWithKafka - .search(getSurrenderReasonSearch()); - - assertEquals(expectedResult, actualResult); - - } - - private SurrenderReason getSurrenderReasonDomin() { - SurrenderReason surrenderReasonDetail = new SurrenderReason(); - surrenderReasonDetail.setName("name"); - surrenderReasonDetail.setDescription("description"); - surrenderReasonDetail.setTenantId("default"); - return surrenderReasonDetail; - } - - private SurrenderReasonEntity getSurrenderReasonEntity() { - SurrenderReasonEntity entity = new SurrenderReasonEntity(); - entity.setName("name"); - entity.setDescription("description"); - entity.setTenantId("default"); - return entity; - } - - private SurrenderReasonSearch getSurrenderReasonSearch() { - SurrenderReasonSearch surrenderReasonSearch = new SurrenderReasonSearch(); - surrenderReasonSearch.setPageSize(500); - surrenderReasonSearch.setOffset(0); - return surrenderReasonSearch; - - } - - private List getSurrenderReasons() { - List surrenderReasons = new ArrayList(); - SurrenderReason surrenderReason = SurrenderReason.builder().name("name").description("description").build(); - surrenderReason.setTenantId("default"); - surrenderReasons.add(surrenderReason); - return surrenderReasons; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentAccountCodeServiceTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentAccountCodeServiceTest.java deleted file mode 100644 index 4dc1f6bd0ee..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentAccountCodeServiceTest.java +++ /dev/null @@ -1,340 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.repository.InstrumentAccountCodeRepository; -import org.egov.egf.instrument.domain.repository.InstrumentTypeRepository; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.repository.ChartOfAccountContractRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Matchers; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class InstrumentAccountCodeServiceTest { - - private InstrumentAccountCodeService instrumentAccountCodeService; - - @Mock - private InstrumentAccountCodeRepository instrumentAccountCodeRepository; - - @Mock - private SmartValidator validator; - - @Mock - private ChartOfAccountContractRepository chartOfAccountContractRepository; - - @Mock - private InstrumentTypeRepository instrumentTypeRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - instrumentAccountCodeService = new InstrumentAccountCodeService(validator, instrumentAccountCodeRepository, - chartOfAccountContractRepository, instrumentTypeRepository); - } - - @Test - public final void test_create() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - when(instrumentAccountCodeRepository.uniqueCheck(any(String.class), any(InstrumentAccountCode.class))).thenReturn(true); - List actualResult = instrumentAccountCodeService.create(expextedResult, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = CustomBindException.class) - public final void test_create_unique_false() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - when(instrumentAccountCodeRepository.uniqueCheck(any(String.class), any(InstrumentAccountCode.class))).thenReturn(false); - List actualResult = instrumentAccountCodeService.create(expextedResult, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_and_with_null_req() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.create(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_update_() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.update(any(List.class), any(RequestInfo.class))) - .thenReturn(expextedResult); - when(instrumentAccountCodeRepository.uniqueCheck(any(String.class), any(InstrumentAccountCode.class))).thenReturn(true); - List actualResult = instrumentAccountCodeService.update(expextedResult, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_null_id() { - - List expextedResult = getInstrumentAccountCodes(); - expextedResult.get(0).setId(null); - - when(instrumentAccountCodeRepository.update(any(List.class), any(RequestInfo.class))) - .thenReturn(expextedResult); - when(instrumentAccountCodeRepository.uniqueCheck(any(String.class), any(InstrumentAccountCode.class))).thenReturn(true); - List actualResult = instrumentAccountCodeService.update(expextedResult, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = CustomBindException.class) - public final void test_update_unique_false() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.update(any(List.class), any(RequestInfo.class))) - .thenReturn(expextedResult); - when(instrumentAccountCodeRepository.uniqueCheck(any(String.class), any(InstrumentAccountCode.class))).thenReturn(false); - List actualResult = instrumentAccountCodeService.update(expextedResult, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_delete_() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.delete(any(List.class), any(RequestInfo.class))) - .thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.delete(expextedResult, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_null_req() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.delete(any(List.class), any(RequestInfo.class))) - .thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.delete(null, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_null_id() { - - List expextedResult = getInstrumentAccountCodes(); - expextedResult.get(0).setId(null); - - when(instrumentAccountCodeRepository.delete(any(List.class), any(RequestInfo.class))) - .thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.delete(expextedResult, errors, - requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_with_null_req() { - - List expextedResult = getInstrumentAccountCodes(); - - when(instrumentAccountCodeRepository.update(any(List.class), any(RequestInfo.class))) - .thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.update(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_search() { - - List instrumentAccountCodes = getInstrumentAccountCodes(); - InstrumentAccountCodeSearch instrumentAccountCodeSearch = new InstrumentAccountCodeSearch(); - Pagination expextedResult = new Pagination<>(); - - expextedResult.setPagedData(instrumentAccountCodes); - - when(instrumentAccountCodeRepository.search(instrumentAccountCodeSearch)).thenReturn(expextedResult); - - Pagination actualResult = instrumentAccountCodeService - .search(instrumentAccountCodeSearch); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_save() { - - InstrumentAccountCode expextedResult = getInstrumentAccountCodes().get(0); - - when(instrumentAccountCodeRepository.save(any(InstrumentAccountCode.class))).thenReturn(expextedResult); - - InstrumentAccountCode actualResult = instrumentAccountCodeService.save(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_update() { - - InstrumentAccountCode expextedResult = getInstrumentAccountCodes().get(0); - - when(instrumentAccountCodeRepository.update(any(InstrumentAccountCode.class))).thenReturn(expextedResult); - - InstrumentAccountCode actualResult = instrumentAccountCodeService.update(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_delete() { - - InstrumentAccountCode expextedResult = getInstrumentAccountCodes().get(0); - - when(instrumentAccountCodeRepository.delete(any(InstrumentAccountCode.class))).thenReturn(expextedResult); - - InstrumentAccountCode actualResult = instrumentAccountCodeService.delete(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test(expected = InvalidDataException.class) - public final void test_fetch_instrumenttype() { - - List instrumentAccountCodes = getInstrumentAccountCodes(); - - InstrumentType expextedResult = InstrumentType.builder().name("name").description("description").active(true) - .id("1").build(); - - instrumentAccountCodes.get(0).setInstrumentType(expextedResult); - - when(instrumentTypeRepository.findById(any(InstrumentType.class))).thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.fetchRelated(instrumentAccountCodes, - new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getInstrumentType()); - } - - @Test - public final void test_fetch_accountcode() { - - List instrumentAccountCodes = getInstrumentAccountCodes(); - - ChartOfAccountContract expextedResult = ChartOfAccountContract.builder().glcode("glcode").id("1").build(); - - instrumentAccountCodes.get(0).setAccountCode(expextedResult); - - when(chartOfAccountContractRepository.findByGlcode(any(ChartOfAccountContract.class), Matchers.anyObject())) - .thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.fetchRelated(instrumentAccountCodes, - new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getAccountCode()); - } - - @Test(expected = InvalidDataException.class) - public final void test_fetch_instrumenttype_null() { - - List instrumentAccountCodes = getInstrumentAccountCodes(); - - InstrumentType expextedResult = InstrumentType.builder().name("name").description("description").active(true) - .id("1").build(); - - instrumentAccountCodes.get(0).setInstrumentType(expextedResult); - - when(instrumentTypeRepository.findById(null)).thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.fetchRelated(instrumentAccountCodes, - new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getInstrumentType()); - } - - @Test(expected = InvalidDataException.class) - public final void test_fetch_accountcode_null() { - - List instrumentAccountCodes = getInstrumentAccountCodes(); - - ChartOfAccountContract expextedResult = ChartOfAccountContract.builder().glcode("glcode").id("1").build(); - - instrumentAccountCodes.get(0).setAccountCode(expextedResult); - - when(chartOfAccountContractRepository.findByGlcode(null, new RequestInfo())).thenReturn(expextedResult); - - List actualResult = instrumentAccountCodeService.fetchRelated(instrumentAccountCodes, - new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getAccountCode()); - } - - private List getInstrumentAccountCodes() { - List instrumentAccountCodes = new ArrayList(); - InstrumentAccountCode instrumentAccountCode = InstrumentAccountCode.builder().id("1").build(); - instrumentAccountCode.setTenantId("default"); - instrumentAccountCodes.add(instrumentAccountCode); - return instrumentAccountCodes; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentServiceTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentServiceTest.java deleted file mode 100644 index e565316f8b6..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentServiceTest.java +++ /dev/null @@ -1,933 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.when; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.repository.InstrumentRepository; -import org.egov.egf.instrument.domain.repository.InstrumentTypeRepository; -import org.egov.egf.instrument.domain.repository.SurrenderReasonRepository; -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.egov.egf.master.web.repository.BankAccountContractRepository; -import org.egov.egf.master.web.repository.BankContractRepository; -import org.egov.egf.master.web.repository.FinancialStatusContractRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Matchers; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class InstrumentServiceTest { - - private InstrumentService instrumentService; - - @Mock - private InstrumentRepository instrumentRepository; - - @Mock - private SmartValidator validator; - - @Mock - private SurrenderReasonRepository surrenderReasonRepository; - - @Mock - private BankContractRepository bankContractRepository; - - @Mock - private FinancialStatusContractRepository financialStatusContractRepository; - - @Mock - private BankAccountContractRepository bankAccountContractRepository; - - @Mock - private InstrumentTypeRepository instrumentTypeRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - instrumentService = new InstrumentService(validator, instrumentRepository, - bankContractRepository, financialStatusContractRepository, bankAccountContractRepository, - instrumentTypeRepository); - } - - @Test - public final void test_create_dd() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("dd"); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("dd"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_dd_null_transnumber() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("dd"); - expextedResult.get(0).setTransactionNumber(null); - expextedResult.get(0).setBank(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("dd"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(false); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_dd_null_bankdetails() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("dd"); - expextedResult.get(0).setBank(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("dd"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(false); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_create_cheque() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("cheque"); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("cheque"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), Matchers.anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_cheque_null_transnumber() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("cheque"); - expextedResult.get(0).setTransactionNumber(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("cheque"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), Matchers.anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_cheque_null_bankdetails() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("cheque"); - expextedResult.get(0).setBank(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("cheque"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), Matchers.anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_create_cash() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("cash"); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("cash"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_create_cash_zero_amount() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("cash"); - expextedResult.get(0).setAmount(new BigDecimal(0)); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("cash"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - - - @Test(expected = InvalidDataException.class) - public final void test_create_cash_null_transnumber() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("cash"); - expextedResult.get(0).setTransactionNumber(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("cash"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), Matchers.anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_create_online() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("online"); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("online"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_online_null_transnumber() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("online"); - expextedResult.get(0).setTransactionNumber(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("online"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_create_bankchallan() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("bankchallan"); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("bankchallan"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), Matchers.anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_bankchallan_null_transnumber() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("bankchallan"); - expextedResult.get(0).setTransactionNumber(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("bankchallan"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_bankchallan_null_bankdetails() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("bankchallan"); - expextedResult.get(0).setBank(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("bankchallan"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_create_bankchallan_null_bankaccountdetails() { - - List expextedResult = getInstruments(); - expextedResult.get(0).getInstrumentType().setName("bankchallan"); - expextedResult.get(0).setBankAccount(null); - - Pagination pit = getInstrumentType(); - pit.getPagedData().get(0).setName("bankchallan"); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(pit); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(getBankContract()); - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(getBankAccountContract()); - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(getFinancialStatusContract()); - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(getSurrenderReason()); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - private SurrenderReason getSurrenderReason() { - return SurrenderReason.builder().name("name").description("description").id("1") - .build(); - } - - private BankAccountContract getBankAccountContract() { - return BankAccountContract.builder().accountNumber("accountNumber") - .description("description").active(true).id("1").build(); - } - - private BankContract getBankContract() { - return BankContract.builder().code("code").description("description").active(true) - .id("1").build(); - } - - private Pagination getInstrumentType() { - Pagination page = new Pagination<>(); - page.setPagedData(getInstrumentTypes()); - return page; - } - - @Test(expected = InvalidDataException.class) - public final void test_save_with_null_req() { - - List expextedResult = getInstruments(); - - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(false); - when(instrumentRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.create(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_update_() { - - List expextedResult = getInstrumentss(); - expextedResult.get(0).setId("1"); - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - when(instrumentRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_null_id() { - - List expextedResult = getInstruments(); - expextedResult.get(0).setId(null); - - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - when(instrumentRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_delete_() { - - List expextedResult = getInstruments(); - - expextedResult.get(0).setId("1"); - - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - when(instrumentRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.delete(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_null_id() { - - List expextedResult = getInstruments(); - expextedResult.get(0).setId(null); - - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - when(instrumentRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.delete(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_with_null_req() { - - List expextedResult = getInstruments(); - - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - when(instrumentRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.update(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_without_id() { - - List expextedResult = getInstruments(); - expextedResult.get(0).setId(null); - - when(instrumentRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_with_null_req() { - - List expextedResult = getInstruments(); - - when(instrumentRepository.uniqueCheck(any(String.class), any(Instrument.class))).thenReturn(true); - when(instrumentRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.delete(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_search() { - - List instruments = getInstruments(); - InstrumentSearch instrumentSearch = new InstrumentSearch(); - Pagination expextedResult = new Pagination<>(); - - expextedResult.setPagedData(instruments); - - when(instrumentRepository.search(instrumentSearch)).thenReturn(expextedResult); - - Pagination actualResult = instrumentService.search(instrumentSearch); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_save() { - - Instrument expextedResult = getInstruments().get(0); - - when(instrumentRepository.save(any(Instrument.class))).thenReturn(expextedResult); - - Instrument actualResult = instrumentService.save(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_update() { - - Instrument expextedResult = getInstruments().get(0); - - when(instrumentRepository.update(any(Instrument.class))).thenReturn(expextedResult); - - Instrument actualResult = instrumentService.update(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_delete() { - - Instrument expextedResult = getInstruments().get(0); - - when(instrumentRepository.delete(any(Instrument.class))).thenReturn(expextedResult); - - Instrument actualResult = instrumentService.delete(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_fetch_instrumenttype() { - - List instruments = getInstrumentss(); - Pagination expextedResult = new Pagination<>(); - InstrumentType it = InstrumentType.builder().name("name").description("description").active(true).id("1") - .build(); - expextedResult.setPagedData(new ArrayList<>()); - expextedResult.getPagedData().add(it); - instruments.get(0).setInstrumentType(it); - - when(instrumentTypeRepository.search(any(InstrumentTypeSearch.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult.getPagedData().get(0), actualResult.get(0).getInstrumentType()); - } - - @Test - public final void test_fetch_bank() { - - List instruments = getInstrumentss(); - - BankContract expextedResult = BankContract.builder().id("id").description("description").active(true) - .id("1").build(); - - instruments.get(0).setBank(expextedResult); - - when(bankContractRepository.findById(any(BankContract.class), anyObject())).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getBank()); - } - - @Test - public final void test_fetch_bankaccount() { - - List instruments = getInstrumentss(); - - BankAccountContract expextedResult = BankAccountContract.builder().accountNumber("accountNumber") - .description("description").active(true).id("1").build(); - - instruments.get(0).setBankAccount(expextedResult); - - when(bankAccountContractRepository.findByAccountNumber(any(BankAccountContract.class), anyObject())) - .thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getBankAccount()); - } - - @Test - public final void test_fetch_financialstatus() { - - List instruments = getInstrumentss(); - - FinancialStatusContract expextedResult = FinancialStatusContract.builder().name("name") - .description("description").id("1").build(); - - instruments.get(0).setFinancialStatus(expextedResult); - - when(financialStatusContractRepository.findById(any(FinancialStatusContract.class), Matchers.anyObject())) - .thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getFinancialStatus()); - } - - @Test - public final void test_fetch_surrenderreason() { - - List instruments = getInstrumentss(); - - SurrenderReason expextedResult = SurrenderReason.builder().name("name").description("description").id("1") - .build(); - - instruments.get(0).setSurrenderReason(expextedResult); - - when(surrenderReasonRepository.findById(any(SurrenderReason.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getSurrenderReason()); - } - - @Test(expected = InvalidDataException.class) - public final void test_fetch_instrumenttype_null() { - - List instruments = getInstrumentss(); - Pagination expextedResult = new Pagination<>(); - InstrumentType it = InstrumentType.builder().name("name").description("description").active(true).id("1") - .build(); - expextedResult.setPagedData(new ArrayList<>()); - expextedResult.getPagedData().add(it); - instruments.get(0).setInstrumentType(it); - - when(instrumentTypeRepository.search(null)).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult.getPagedData().get(0), actualResult.get(0).getInstrumentType()); - - } - - /* @Test(expected = InvalidDataException.class) - public final void test_fetch_bank_null() { - - List instruments = getInstrumentss(); - - BankContract expextedResult = BankContract.builder().name("name").description("description").id("1").build(); - - instruments.get(0).setBank(expextedResult); - - when(bankContractRepository.findById(null, new RequestInfo())).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getBank()); - }*/ - - /* @Test(expected = InvalidDataException.class) - public final void test_fetch_bankaccount_null() { - - List instruments = getInstrumentss(); - - BankAccountContract expextedResult = BankAccountContract.builder().accountNumber("accountNumber") - .description("description").id("1").build(); - - instruments.get(0).setBankAccount(expextedResult); - - when(bankAccountContractRepository.findByAccountNumber(null, null)).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getBankAccount()); - }*/ - @Test - public final void test_fetch_financialstatus_null() { - - List instruments = getInstrumentss(); - - FinancialStatusContract expextedResult = FinancialStatusContract.builder().name("name") - .description("description").id("1").build(); - - instruments.get(0).setFinancialStatus(expextedResult); - - when(financialStatusContractRepository.findById(null, new RequestInfo())).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getFinancialStatus()); - } - - @Test - public final void test_fetch_surrenderreason_null() { - - List instruments = getInstrumentss(); - - SurrenderReason expextedResult = SurrenderReason.builder().name("name").description("description").id("1").build(); - - instruments.get(0).setSurrenderReason(expextedResult); - - when(surrenderReasonRepository.findById(null)).thenReturn(expextedResult); - - List actualResult = instrumentService.fetchRelated(instruments, new RequestInfo()); - - assertEquals(expextedResult, actualResult.get(0).getSurrenderReason()); - } - - @Test - public final void test_deposit() { - - List expextedResult = getInstruments(); - - when(instrumentRepository.findById(any(Instrument.class))).thenReturn(getInstruments().get(0)); - when(financialStatusContractRepository.findByModuleCode(any(FinancialStatusContract.class))) - .thenReturn(getFinancialStatusContract()); - when(instrumentRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.deposit(getInstrumentRequest(), errors, requestInfo); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_dishonor() { - - List expextedResult = getInstruments(); - - when(instrumentRepository.findById(any(Instrument.class))).thenReturn(getInstruments().get(0)); - when(financialStatusContractRepository.findByModuleCode(any(FinancialStatusContract.class))) - .thenReturn(getFinancialStatusContract()); - when(instrumentRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentService.dishonor(getInstrumentRequest(), errors, requestInfo); - - assertEquals(expextedResult, actualResult); - } - - private FinancialStatusContract getFinancialStatusContract() { - return FinancialStatusContract.builder().code("Deposit").moduleType("Instrument").build(); - } - - private InstrumentRequest getInstrumentRequest() { - InstrumentRequest instrumentDepositRequest = new InstrumentRequest(); - instrumentDepositRequest.setInstruments(getInstrumentContracts()); - instrumentDepositRequest.getInstruments().get(0).setId("instrumentDepositId"); - return instrumentDepositRequest; - } - - private List getInstruments() { - List instruments = new ArrayList(); - InstrumentType it = InstrumentType.builder().name("dd").build(); - it.setTenantId("default"); - Instrument instrument = Instrument.builder().amount(BigDecimal.ONE).id("1") - .payee("payee") - .bank(BankContract.builder().code("code").description("description").active(true) - .id("1").build()) - .bankAccount(BankAccountContract.builder().accountNumber("accountNumber") - .description("description").active(true).id("1").build()) - .financialStatus(FinancialStatusContract.builder().name("name") - .description("description").id("1").build()) - .surrenderReason(SurrenderReason.builder().name("name").description("description").id("1") - .build()) - .instrumentType(it) - .transactionNumber("1") - .transactionDate(new Date()).build(); - instrument.setTenantId("default"); - instruments.add(instrument); - return instruments; - } - - private List getInstrumentss() { - List instruments = new ArrayList(); - Instrument instrument = Instrument.builder().build(); - instrument.setTenantId("default"); - instruments.add(instrument); - return instruments; - } - - private List getInstrumentContracts() { - List instrumentContracts = new ArrayList(); - InstrumentContract instrumentContract = InstrumentContract.builder().build(); - instrumentContract.setTenantId("default"); - instrumentContracts.add(instrumentContract); - return instrumentContracts; - } - - private List getInstrumentTypes() { - List lits = new ArrayList<>(); - InstrumentType it = InstrumentType.builder().name("cheque").build(); - it.setTenantId("default"); - lits.add(it); - return lits; - } -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentTypeServiceTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentTypeServiceTest.java deleted file mode 100644 index ef2be78cc7d..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/InstrumentTypeServiceTest.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.domain.repository.InstrumentTypeRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class InstrumentTypeServiceTest { - - private InstrumentTypeService instrumentTypeService; - - @Mock - private SmartValidator validator; - - @Mock - private InstrumentTypeRepository instrumentTypeRepository; - - private RequestInfo requestInfo = new RequestInfo(); - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - @Before - public void setup() { - instrumentTypeService = new InstrumentTypeService(validator, instrumentTypeRepository); - } - - @Test - public final void test_save_with_out_kafka() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.uniqueCheck(any(String.class), any(InstrumentType.class))).thenReturn(true); - when(instrumentTypeRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = CustomBindException.class) - public final void test_save_with_out_kafka_unique_false() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.uniqueCheck(any(String.class), any(InstrumentType.class))).thenReturn(false); - when(instrumentTypeRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_save_with_out_kafka_and_with_null_req() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.create(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_update_with_out_kafka() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.uniqueCheck(any(String.class), any(InstrumentType.class))).thenReturn(true); - when(instrumentTypeRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_with_out_kafka_null_id() { - - List expextedResult = getInstrumentTypes(); - expextedResult.get(0).setId(null); - - when(instrumentTypeRepository.uniqueCheck(any(String.class), any(InstrumentType.class))).thenReturn(true); - when(instrumentTypeRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = CustomBindException.class) - public final void test_update_with_out_kafka_unique_false() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.uniqueCheck(any(String.class), any(InstrumentType.class))).thenReturn(false); - when(instrumentTypeRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_delete_with_out_kafka() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.delete(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_with_out_kafka_nullrequest() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.delete(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_with_out_kafka_null_id() { - - List expextedResult = getInstrumentTypes(); - expextedResult.get(0).setId(null); - - when(instrumentTypeRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.delete(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_with_out_kafka_and_with_null_req() { - - List expextedResult = getInstrumentTypes(); - - when(instrumentTypeRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = instrumentTypeService.update(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_search() { - - List instrumentTypes = getInstrumentTypes(); - InstrumentTypeSearch instrumentTypeSearch = new InstrumentTypeSearch(); - Pagination expextedResult = new Pagination<>(); - - expextedResult.setPagedData(instrumentTypes); - - when(instrumentTypeRepository.search(instrumentTypeSearch)).thenReturn(expextedResult); - - Pagination actualResult = instrumentTypeService.search(instrumentTypeSearch); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_save() { - - InstrumentType expextedResult = getInstrumentTypes().get(0); - - when(instrumentTypeRepository.save(any(InstrumentType.class))).thenReturn(expextedResult); - - InstrumentType actualResult = instrumentTypeService.save(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_update() { - - InstrumentType expextedResult = getInstrumentTypes().get(0); - - when(instrumentTypeRepository.update(any(InstrumentType.class))).thenReturn(expextedResult); - - InstrumentType actualResult = instrumentTypeService.update(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_delete() { - - InstrumentType expextedResult = getInstrumentTypes().get(0); - - when(instrumentTypeRepository.delete(any(InstrumentType.class))).thenReturn(expextedResult); - - InstrumentType actualResult = instrumentTypeService.delete(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - private List getInstrumentTypes() { - List instrumentTypes = new ArrayList(); - InstrumentType instrumentType = InstrumentType.builder().id("1").build(); - instrumentType.setTenantId("default"); - instrumentTypes.add(instrumentType); - return instrumentTypes; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/SurrenderReasonServiceTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/SurrenderReasonServiceTest.java deleted file mode 100644 index 1aaca97633b..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/domain/service/SurrenderReasonServiceTest.java +++ /dev/null @@ -1,248 +0,0 @@ -package org.egov.egf.instrument.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.domain.repository.SurrenderReasonRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class SurrenderReasonServiceTest { - - private SurrenderReasonService surrenderReasonService; - - @Mock - private SmartValidator validator; - - @Mock - private SurrenderReasonRepository surrenderReasonRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - surrenderReasonService = new SurrenderReasonService(validator, surrenderReasonRepository); - } - - @Test - public final void test_save_with_out_kafka() { - - List expextedResult = getSurrenderReasons(); - - when(surrenderReasonRepository.uniqueCheck(any(String.class), any(SurrenderReason.class))).thenReturn(true); - when(surrenderReasonRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = CustomBindException.class) - public final void test_save_with_out_kafka_unique_false() { - - List expextedResult = getSurrenderReasons(); - - when(surrenderReasonRepository.uniqueCheck(any(String.class), any(SurrenderReason.class))).thenReturn(false); - when(surrenderReasonRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.create(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_save_with_out_kafka_and_with_null_req() { - - List expextedResult = getSurrenderReasons(); - - when(surrenderReasonRepository.uniqueCheck(any(String.class), any(SurrenderReason.class))).thenReturn(false); - when(surrenderReasonRepository.save(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.create(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_update_with_out_kafka() { - - List expextedResult = getSurrenderReasons(); - - when(surrenderReasonRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - when(surrenderReasonRepository.uniqueCheck(any(String.class), any(SurrenderReason.class))).thenReturn(true); - List actualResult = surrenderReasonService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = CustomBindException.class) - public final void test_update_with_out_kafka_unique_false() { - - List expextedResult = getSurrenderReasons(); - - when(surrenderReasonRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - when(surrenderReasonRepository.uniqueCheck(any(String.class), any(SurrenderReason.class))).thenReturn(false); - List actualResult = surrenderReasonService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_delete_with_out_kafka() { - - List expextedResult = getSurrenderReasons(); - - when(surrenderReasonRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.delete(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_with_out_kafka_and_with_null_req() { - - List expextedResult = getSurrenderReasons(); - - when(surrenderReasonRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.update(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_update_without_id() { - - List expextedResult = getSurrenderReasons(); - expextedResult.get(0).setId(null); - - when(surrenderReasonRepository.update(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.update(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test - public final void test_search() { - - List surrenderReasons = getSurrenderReasons(); - SurrenderReasonSearch surrenderReasonSearch = new SurrenderReasonSearch(); - Pagination expextedResult = new Pagination<>(); - - expextedResult.setPagedData(surrenderReasons); - - when(surrenderReasonRepository.search(surrenderReasonSearch)).thenReturn(expextedResult); - - Pagination actualResult = surrenderReasonService.search(surrenderReasonSearch); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_save() { - - SurrenderReason expextedResult = getSurrenderReasons().get(0); - - when(surrenderReasonRepository.save(any(SurrenderReason.class))).thenReturn(expextedResult); - - SurrenderReason actualResult = surrenderReasonService.save(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_update() { - - SurrenderReason expextedResult = getSurrenderReasons().get(0); - - when(surrenderReasonRepository.update(any(SurrenderReason.class))).thenReturn(expextedResult); - - SurrenderReason actualResult = surrenderReasonService.update(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_delete() { - - SurrenderReason expextedResult = getSurrenderReasons().get(0); - - when(surrenderReasonRepository.delete(any(SurrenderReason.class))).thenReturn(expextedResult); - - SurrenderReason actualResult = surrenderReasonService.delete(expextedResult); - - assertEquals(expextedResult, actualResult); - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_with_out_surrenderreasons() { - - List expextedResult = getSurrenderReasons(); - expextedResult.get(0).setId(null); - - when(surrenderReasonRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.delete(null, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - @Test(expected = InvalidDataException.class) - public final void test_delete_with_out_id() { - - List expextedResult = getSurrenderReasons(); - expextedResult.get(0).setId(null); - - when(surrenderReasonRepository.delete(any(List.class), any(RequestInfo.class))).thenReturn(expextedResult); - - List actualResult = surrenderReasonService.delete(expextedResult, errors, requestInfo); - - assertEquals(expextedResult, actualResult); - - } - - private List getSurrenderReasons() { - List surrenderReasons = new ArrayList(); - SurrenderReason surrenderReason = SurrenderReason.builder().id("1").name("name").build(); - surrenderReason.setTenantId("default"); - SurrenderReason surrenderReason1 = SurrenderReason.builder().id("1").name("name").build(); - surrenderReason.setTenantId("default"); - surrenderReasons.add(surrenderReason); - surrenderReasons.add(surrenderReason1); - return surrenderReasons; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentProducerTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentProducerTest.java deleted file mode 100644 index b75709b70cc..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/FinancialInstrumentProducerTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.instrument.persistence.queue; - -import static org.mockito.Mockito.verify; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.tracer.kafka.LogAwareKafkaTemplate; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class FinancialInstrumentProducerTest { - - private static final String TOPIC_NAME = "topic"; - - private static final String KEY_NAME = "key"; - - @Mock - private LogAwareKafkaTemplate kafkaTemplate; - - @InjectMocks - private FinancialInstrumentProducer financialInstrumentProducer; - - @Before - public void setup() { - financialInstrumentProducer = new FinancialInstrumentProducer(kafkaTemplate); - } - - @Test - public void test_send_message() { - - InstrumentRequest request = new InstrumentRequest(); - - Map message = new HashMap<>(); - message.put("instrument_create", request); - - financialInstrumentProducer.sendMessage(TOPIC_NAME, KEY_NAME, message); - - verify(kafkaTemplate).send(TOPIC_NAME, KEY_NAME, message); - - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/ObjectMapperFactoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/ObjectMapperFactoryTest.java deleted file mode 100644 index 05d8dab2844..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/ObjectMapperFactoryTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.egov.egf.instrument.persistence.queue; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.verify; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -@RunWith(MockitoJUnitRunner.class) -public class ObjectMapperFactoryTest { - - @Mock - private ObjectMapper objectMapper; - - private ObjectMapperFactory objectMapperFactory; - - @Before - public void setup() { - objectMapperFactory = new ObjectMapperFactory(objectMapper); - } - - @Test - public void test_create() { - - ObjectMapper actualRequest = objectMapperFactory.create(); - - verify(objectMapper).disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - - assertEquals(objectMapper, actualRequest); - - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentAccountCodeQueueRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentAccountCodeQueueRepositoryTest.java deleted file mode 100644 index 4f75001911f..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentAccountCodeQueueRepositoryTest.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeRequest; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentAccountCodeQueueRepositoryTest { - - @Mock - private InstrumentAccountCodeQueueRepository instrumentAccountCodeQueueRepository; - - @Mock - private FinancialInstrumentProducer financialInstrumentProducer; - - private static final String TOPIC_NAME = "topic"; - - private static final String KEY_NAME = "key"; - - @Before - public void setup() { - instrumentAccountCodeQueueRepository = new InstrumentAccountCodeQueueRepository(financialInstrumentProducer, - TOPIC_NAME, KEY_NAME, TOPIC_NAME, KEY_NAME); - } - - @Test - public void test_add_to_queue_while_create() { - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - - request.setInstrumentAccountCodes(getInstrumentAccountCodes()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("create"); - - instrumentAccountCodeQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrumentaccountcode_create")); - - } - - @Test - public void test_add_to_queue_while_update() { - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - - request.setInstrumentAccountCodes(getInstrumentAccountCodes()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("update"); - - instrumentAccountCodeQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrumentaccountcode_update")); - - } - - @Test - public void test_add_to_search_queue() { - - InstrumentAccountCodeRequest request = new InstrumentAccountCodeRequest(); - - request.setInstrumentAccountCodes(getInstrumentAccountCodes()); - - instrumentAccountCodeQueueRepository.addToSearchQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrumentaccountcode_persisted")); - - } - - private List getInstrumentAccountCodes() { - - List instrumentAccountCodes = new ArrayList(); - InstrumentAccountCodeContract instrumentAccountCode = InstrumentAccountCodeContract.builder() - .instrumentType(InstrumentTypeContract.builder().active(true).name("instrumenttype").build()) - .accountCode(ChartOfAccountContract.builder().glcode("glcode").build()).build(); - instrumentAccountCode.setTenantId("default"); - instrumentAccountCodes.add(instrumentAccountCode); - - return instrumentAccountCodes; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentQueueRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentQueueRepositoryTest.java deleted file mode 100644 index 873540e9a37..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentQueueRepositoryTest.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.contract.TransactionTypeContract; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentQueueRepositoryTest { - - @Mock - private InstrumentQueueRepository instrumentQueueRepository; - - @Mock - private FinancialInstrumentProducer financialInstrumentProducer; - - private static final String TOPIC_NAME = "topic"; - - private static final String KEY_NAME = "key"; - - @Before - public void setup() { - instrumentQueueRepository = new InstrumentQueueRepository(financialInstrumentProducer, TOPIC_NAME, KEY_NAME, - TOPIC_NAME, KEY_NAME); - } - - @Test - public void test_add_to_queue_while_create() { - - InstrumentRequest request = new InstrumentRequest(); - - request.setInstruments(getInstruments()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("create"); - - instrumentQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrument_create")); - - } - - @Test - public void test_add_to_queue_while_update() { - - InstrumentRequest request = new InstrumentRequest(); - - request.setInstruments(getInstruments()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("update"); - - instrumentQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrument_update")); - - } - - @Test - public void test_add_to_search_queue() { - - InstrumentRequest request = new InstrumentRequest(); - - request.setInstruments(getInstruments()); - - instrumentQueueRepository.addToSearchQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrument_persisted")); - - } - - private List getInstruments() { - - List instruments = new ArrayList(); - - InstrumentContract instrument = InstrumentContract.builder().transactionNumber("transactionNumber") - .amount(BigDecimal.ONE).transactionType(TransactionTypeContract.Credit).serialNo("serialNo") - .instrumentType(InstrumentTypeContract.builder().active(true).name("instrumenttype").build()).build(); - instrument.setTenantId("default"); - instruments.add(instrument); - - return instruments; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentTypeQueueRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentTypeQueueRepositoryTest.java deleted file mode 100644 index 39d7fbb0ced..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/InstrumentTypeQueueRepositoryTest.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.requests.InstrumentTypeRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentTypeQueueRepositoryTest { - - @Mock - private InstrumentTypeQueueRepository instrumentTypeQueueRepository; - - @Mock - private FinancialInstrumentProducer financialInstrumentProducer; - - private static final String TOPIC_NAME = "topic"; - - private static final String KEY_NAME = "key"; - - @Before - public void setup() { - instrumentTypeQueueRepository = new InstrumentTypeQueueRepository(financialInstrumentProducer, TOPIC_NAME, - KEY_NAME, TOPIC_NAME, KEY_NAME); - } - - @Test - public void test_add_to_queue_while_create() { - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - - request.setInstrumentTypes(getInstrumentTypes()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("create"); - - instrumentTypeQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrumenttype_create")); - - } - - @Test - public void test_add_to_queue_while_update() { - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - - request.setInstrumentTypes(getInstrumentTypes()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("update"); - - instrumentTypeQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrumenttype_update")); - - } - - @Test - public void test_add_to_search_queue() { - - InstrumentTypeRequest request = new InstrumentTypeRequest(); - - request.setInstrumentTypes(getInstrumentTypes()); - - instrumentTypeQueueRepository.addToSearchQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("instrumenttype_persisted")); - - } - - private List getInstrumentTypes() { - - List instrumentTypes = new ArrayList(); - - InstrumentTypeContract instrumentType = InstrumentTypeContract.builder().name("name").description("description") - .active(true).build(); - instrumentType.setTenantId("default"); - instrumentTypes.add(instrumentType); - return instrumentTypes; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/SurrenderReasonQueueRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/SurrenderReasonQueueRepositoryTest.java deleted file mode 100644 index d1015d8875d..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/queue/repository/SurrenderReasonQueueRepositoryTest.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.egov.egf.instrument.persistence.queue.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.instrument.persistence.queue.FinancialInstrumentProducer; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class SurrenderReasonQueueRepositoryTest { - - @Mock - private SurrenderReasonQueueRepository surrenderReasonQueueRepository; - - @Mock - private FinancialInstrumentProducer financialInstrumentProducer; - - private static final String TOPIC_NAME = "topic"; - - private static final String KEY_NAME = "key"; - - @Before - public void setup() { - surrenderReasonQueueRepository = new SurrenderReasonQueueRepository(financialInstrumentProducer, TOPIC_NAME, - KEY_NAME, TOPIC_NAME, KEY_NAME); - } - - @Test - public void test_add_to_queue_while_create() { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - - request.setSurrenderReasons(getSurrenderReasons()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("create"); - - surrenderReasonQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("surrenderreason_create")); - - } - - @Test - public void test_add_to_queue_while_update() { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - - request.setSurrenderReasons(getSurrenderReasons()); - request.setRequestInfo(new RequestInfo()); - request.getRequestInfo().setAction("update"); - - surrenderReasonQueueRepository.addToQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("surrenderreason_update")); - - } - - @Test - public void test_add_to_search_queue() { - - SurrenderReasonRequest request = new SurrenderReasonRequest(); - - request.setSurrenderReasons(getSurrenderReasons()); - - surrenderReasonQueueRepository.addToSearchQue(request); - - final ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(HashMap.class); - - verify(financialInstrumentProducer).sendMessage(any(String.class), any(String.class), argumentCaptor.capture()); - - final HashMap actualRequest = argumentCaptor.getValue(); - - assertEquals(request, actualRequest.get("surrenderreason_persisted")); - - } - - private List getSurrenderReasons() { - - List surrenderReasons = new ArrayList(); - SurrenderReasonContract surrenderReason = SurrenderReasonContract.builder().name("name") - .description("description").build(); - surrenderReason.setTenantId("default"); - surrenderReasons.add(surrenderReason); - - return surrenderReasons; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentAccountCodeJdbcRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentAccountCodeJdbcRepositoryTest.java deleted file mode 100644 index b85803d777e..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentAccountCodeJdbcRepositoryTest.java +++ /dev/null @@ -1,224 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.persistence.entity.InstrumentAccountCodeEntity; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class InstrumentAccountCodeJdbcRepositoryTest { - - private InstrumentAccountCodeJdbcRepository instrumentAccountCodeJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Autowired - private JdbcTemplate jdbcTemplate; - - @Before - public void setUp() throws Exception { - instrumentAccountCodeJdbcRepository = new InstrumentAccountCodeJdbcRepository(namedParameterJdbcTemplate, jdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql" }) - public void test_create() { - - InstrumentAccountCodeEntity instrumentAccountCode = InstrumentAccountCodeEntity.builder().instrumentTypeId("1") - .accountCodeId("1").build(); - instrumentAccountCode.setTenantId("default"); - InstrumentAccountCodeEntity actualResult = instrumentAccountCodeJdbcRepository.create(instrumentAccountCode); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentAccountCode", - new InstrumentAccountCodeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("instrumentTypeId")).isEqualTo(actualResult.getInstrumentTypeId()); - assertThat(row.get("accountCodeId")).isEqualTo(actualResult.getAccountCodeId()); - - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_update() { - - InstrumentAccountCodeEntity instrumentAccountCode = InstrumentAccountCodeEntity.builder().instrumentTypeId("name") - .accountCodeId("glcode").build(); - instrumentAccountCode.setTenantId("default"); - InstrumentAccountCodeEntity actualResult = instrumentAccountCodeJdbcRepository.update(instrumentAccountCode); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentAccountCode", - new InstrumentAccountCodeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("instrumentTypeId")).isEqualTo(actualResult.getInstrumentTypeId()); - assertThat(row.get("accountCodeId")).isEqualTo(actualResult.getAccountCodeId()); - - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_delete() { - - InstrumentAccountCodeEntity instrumentAccountCode = InstrumentAccountCodeEntity.builder().id("1").instrumentTypeId("name") - .accountCodeId("glcode").build(); - instrumentAccountCode.setTenantId("default"); - InstrumentAccountCodeEntity actualResult = instrumentAccountCodeJdbcRepository.delete(instrumentAccountCode); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentAccountCode", - new InstrumentAccountCodeResultExtractor()); - assertTrue("Result set length is zero", result.size() == 0); - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_search() { - - Pagination page = (Pagination) instrumentAccountCodeJdbcRepository - .search(getInstrumentAccountCodeSearch()); - assertThat(page.getPagedData().get(0).getAccountCode().getGlcode()).isEqualTo("glcode"); - assertThat(page.getPagedData().get(0).getInstrumentType().getName()).isEqualTo("name"); - - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_invalid_search() { - - Pagination page = (Pagination) instrumentAccountCodeJdbcRepository - .search(getInstrumentAccountCodeSearch1()); - assertThat(page.getPagedData().size()).isEqualTo(0); - - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_find_by_id() { - - InstrumentAccountCodeEntity instrumentAccountCodeEntity = InstrumentAccountCodeEntity.builder().id("1").build(); - instrumentAccountCodeEntity.setTenantId("default"); - InstrumentAccountCodeEntity result = instrumentAccountCodeJdbcRepository.findById(instrumentAccountCodeEntity); - assertThat(result.getAccountCodeId()).isEqualTo("glcode"); - assertThat(result.getInstrumentTypeId()).isEqualTo("name"); - - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - InstrumentAccountCodeEntity instrumentAccountCodeEntity = InstrumentAccountCodeEntity.builder().id("5").build(); - instrumentAccountCodeEntity.setTenantId("default"); - InstrumentAccountCodeEntity result = instrumentAccountCodeJdbcRepository.findById(instrumentAccountCodeEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_search_invalid_sort_option() { - - InstrumentAccountCodeSearch search = getInstrumentAccountCodeSearch(); - search.setSortBy("desc"); - instrumentAccountCodeJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/instrumentaccountcode/clearInstrumentAccountCode.sql", - "/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - InstrumentAccountCodeSearch search = getInstrumentAccountCodeSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) instrumentAccountCodeJdbcRepository - .search(getInstrumentAccountCodeSearch()); - assertThat(page.getPagedData().get(0).getAccountCode().getGlcode()).isEqualTo("glcode"); - assertThat(page.getPagedData().get(0).getInstrumentType().getName()).isEqualTo("name"); - - } - - class InstrumentAccountCodeResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("instrumentTypeId", resultSet.getString("instrumentTypeId")); - put("accountCodeId", resultSet.getString("accountCodeId")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private InstrumentAccountCodeSearch getInstrumentAccountCodeSearch1() { - InstrumentAccountCodeSearch instrumentAccountCodeSearch = new InstrumentAccountCodeSearch(); - instrumentAccountCodeSearch.setId("id"); - instrumentAccountCodeSearch.setInstrumentType(InstrumentType.builder().id("10").build()); - instrumentAccountCodeSearch.setAccountCode(ChartOfAccountContract.builder().id("1").build()); - instrumentAccountCodeSearch.setTenantId("tenantId"); - instrumentAccountCodeSearch.setPageSize(500); - instrumentAccountCodeSearch.setOffset(0); - instrumentAccountCodeSearch.setSortBy("accountCodeId desc"); - return instrumentAccountCodeSearch; - } - - private InstrumentAccountCodeSearch getInstrumentAccountCodeSearch() { - InstrumentAccountCodeSearch instrumentAccountCodeSearch = new InstrumentAccountCodeSearch(); - instrumentAccountCodeSearch.setId("1"); - instrumentAccountCodeSearch.setIds("1"); - instrumentAccountCodeSearch.setInstrumentType(InstrumentType.builder().name("name").build()); - instrumentAccountCodeSearch.setAccountCode(ChartOfAccountContract.builder().glcode("glcode").build()); - instrumentAccountCodeSearch.setPageSize(500); - instrumentAccountCodeSearch.setOffset(0); - instrumentAccountCodeSearch.setSortBy("accountCodeId desc"); - return instrumentAccountCodeSearch; - } -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentJdbcRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentJdbcRepositoryTest.java deleted file mode 100644 index 61288604e6c..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentJdbcRepositoryTest.java +++ /dev/null @@ -1,319 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.math.BigDecimal; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.instrument.persistence.entity.InstrumentEntity; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class InstrumentJdbcRepositoryTest { - - @Autowired - private InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository; - - private InstrumentJdbcRepository instrumentJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Autowired - private JdbcTemplate jdbcTemplate; - @Autowired - private DishonorReasonJdbcRepository dishonorReasonJdbcRepository; - - @Before - public void setUp() throws Exception { - instrumentJdbcRepository = new InstrumentJdbcRepository(namedParameterJdbcTemplate, jdbcTemplate, - instrumentVoucherJdbcRepository, dishonorReasonJdbcRepository); - } - - @Test - @Sql(scripts = { "/sql/instrument/clearInstrument.sql" }) - public void test_create() { - - InstrumentEntity instrument = InstrumentEntity.builder().id("1").amount(BigDecimal.ONE) - .bankAccountId("accountNumber").bankId("code").branchName("branchName").drawer("drawer") - .financialStatusId("1").instrumentTypeId("name").payee("payee").serialNo("serialNo") - .surrenderReasonId("1").transactionNumber("transactionNumber").transactionDate(new Date()) - .transactionType("Credit").build(); - instrument.setTenantId("default"); - InstrumentEntity actualResult = instrumentJdbcRepository.create(instrument); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrument", - new InstrumentResultExtractor()); - Map row = result.get(0); - - assertThat(row.get("amount").toString()).isEqualTo("1.00"); - assertThat(row.get("bankId")).isEqualTo(actualResult.getBankId()); - assertThat(row.get("bankAccountId")).isEqualTo(actualResult.getBankAccountId()); - assertThat(row.get("branchName")).isEqualTo(actualResult.getBranchName()); - assertThat(row.get("drawer")).isEqualTo(actualResult.getDrawer()); - assertThat(row.get("financialStatusId")).isEqualTo(actualResult.getFinancialStatusId()); - assertThat(row.get("instrumentTypeId")).isEqualTo(actualResult.getInstrumentTypeId()); - assertThat(row.get("payee")).isEqualTo(actualResult.getPayee()); - assertThat(row.get("serialNo")).isEqualTo(actualResult.getSerialNo()); - assertThat(row.get("surrenderReasonId")).isEqualTo(actualResult.getSurrenderReasonId()); - assertThat(row.get("transactionNumber")).isEqualTo(actualResult.getTransactionNumber()); - assertThat(row.get("transactionType")).isEqualTo(actualResult.getTransactionType()); - - } - - @Test - @Sql(scripts = { "/sql/instrument/clearInstrument.sql", "/sql/instrument/insertInstrumentData.sql" }) - public void test_update() { - - InstrumentEntity instrument = InstrumentEntity.builder().id("1").amount(BigDecimal.ONE).bankAccountId("1") - .bankId("1").branchName("branchName").drawer("drawer").financialStatusId("1").instrumentTypeId("1") - .payee("payee").serialNo("serialNo").surrenderReasonId("1").transactionNumber("transactionNumber") - .transactionDate(new Date()).transactionType("Credit").build(); - instrument.setTenantId("default"); - InstrumentEntity actualResult = instrumentJdbcRepository.update(instrument); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrument", - new InstrumentResultExtractor()); - Map row = result.get(0); - - assertThat(row.get("amount").toString()).isEqualTo("1.00"); - assertThat(row.get("bankId")).isEqualTo(actualResult.getBankId()); - assertThat(row.get("bankAccountId")).isEqualTo(actualResult.getBankAccountId()); - assertThat(row.get("branchName")).isEqualTo(actualResult.getBranchName()); - assertThat(row.get("drawer")).isEqualTo(actualResult.getDrawer()); - assertThat(row.get("financialStatusId")).isEqualTo(actualResult.getFinancialStatusId()); - assertThat(row.get("instrumentTypeId")).isEqualTo(actualResult.getInstrumentTypeId()); - assertThat(row.get("payee")).isEqualTo(actualResult.getPayee()); - assertThat(row.get("serialNo")).isEqualTo(actualResult.getSerialNo()); - assertThat(row.get("surrenderReasonId")).isEqualTo(actualResult.getSurrenderReasonId()); - assertThat(row.get("transactionNumber")).isEqualTo(actualResult.getTransactionNumber()); - assertThat(row.get("transactionType")).isEqualTo(actualResult.getTransactionType()); - - } - - @Test - @Sql(scripts = { "/sql/instrument/clearInstrument.sql", "/sql/instrument/insertInstrumentData.sql" }) - public void test_search() { - - Pagination page = (Pagination) instrumentJdbcRepository.search(getInstrumentSearch()); - - assertThat(page.getPagedData().get(0).getAmount()).isEqualTo("1.00"); - assertThat(page.getPagedData().get(0).getBank().getId()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getBankAccount().getAccountNumber()).isEqualTo("accountNumber"); - assertThat(page.getPagedData().get(0).getBranchName()).isEqualTo("branchName"); - assertThat(page.getPagedData().get(0).getDrawer()).isEqualTo("drawer"); - assertThat(page.getPagedData().get(0).getFinancialStatus().getId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getInstrumentType().getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getPayee()).isEqualTo("payee"); - assertThat(page.getPagedData().get(0).getSerialNo()).isEqualTo("serialNo"); - assertThat(page.getPagedData().get(0).getSurrenderReason().getId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getTransactionNumber()).isEqualTo("transactionNumber"); - assertThat(page.getPagedData().get(0).getTransactionType()).isEqualTo(TransactionType.Credit); - } - - @Test - @Sql(scripts = { "/sql/instrument/clearInstrument.sql", "/sql/instrument/insertInstrumentData.sql" }) - public void test_invalid_search() { - - Pagination page = (Pagination) instrumentJdbcRepository.search(getInstrumentSearch1()); - assertThat(page.getPagedData().size()).isEqualTo(0); - - } - - @Test - @Sql(scripts = { "/sql/instrument/clearInstrument.sql", "/sql/instrument/insertInstrumentData.sql" }) - public void test_find_by_id() { - - InstrumentEntity instrumentEntity = InstrumentEntity.builder().id("1").build(); - instrumentEntity.setTenantId("default"); - InstrumentEntity result = instrumentJdbcRepository.findById(instrumentEntity); - - assertThat(result.getAmount()).isEqualTo("1.00"); - assertThat(result.getBankId()).isEqualTo("code"); - assertThat(result.getBankAccountId()).isEqualTo("accountNumber"); - assertThat(result.getBranchName()).isEqualTo("branchName"); - assertThat(result.getDrawer()).isEqualTo("drawer"); - assertThat(result.getFinancialStatusId()).isEqualTo("1"); - assertThat(result.getInstrumentTypeId()).isEqualTo("name"); - assertThat(result.getPayee()).isEqualTo("payee"); - assertThat(result.getSerialNo()).isEqualTo("serialNo"); - assertThat(result.getSurrenderReasonId()).isEqualTo("1"); - assertThat(result.getTransactionNumber()).isEqualTo("transactionNumber"); - assertThat(result.getTransactionType()).isEqualTo("Credit"); - - } - - @Test - @Sql(scripts = { "/sql/instrument/clearInstrument.sql", "/sql/instrument/insertInstrumentData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - InstrumentEntity instrumentEntity = InstrumentEntity.builder().id("5").build(); - instrumentEntity.setTenantId("default"); - InstrumentEntity result = instrumentJdbcRepository.findById(instrumentEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/instrument/clearInstrument.sql", "/sql/instrument/insertInstrumentData.sql" }) - public void test_search_invalid_sort_option() { - - InstrumentSearch search = getInstrumentSearch(); - search.setSortBy("desc"); - instrumentJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/instrument/clearInstrument.sql", "/sql/instrument/insertInstrumentData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - InstrumentSearch search = getInstrumentSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) instrumentJdbcRepository.search(getInstrumentSearch()); - - assertThat(page.getPagedData().get(0).getAmount()).isEqualTo("1.00"); - assertThat(page.getPagedData().get(0).getBank().getId()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getBankAccount().getAccountNumber()).isEqualTo("accountNumber"); - assertThat(page.getPagedData().get(0).getBranchName()).isEqualTo("branchName"); - assertThat(page.getPagedData().get(0).getDrawer()).isEqualTo("drawer"); - assertThat(page.getPagedData().get(0).getFinancialStatus().getId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getInstrumentType().getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getPayee()).isEqualTo("payee"); - assertThat(page.getPagedData().get(0).getSerialNo()).isEqualTo("serialNo"); - assertThat(page.getPagedData().get(0).getSurrenderReason().getId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getTransactionNumber()).isEqualTo("transactionNumber"); - assertThat(page.getPagedData().get(0).getTransactionType()).isEqualTo(TransactionType.Credit); - - } - - class InstrumentResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("amount", resultSet.getString("amount")); - put("bankId", resultSet.getString("bankId")); - put("bankAccountId", resultSet.getString("bankAccountId")); - put("branchName", resultSet.getString("branchName")); - put("drawer", resultSet.getString("drawer")); - put("financialStatusId", resultSet.getString("financialStatusId")); - put("instrumentTypeId", resultSet.getString("instrumentTypeId")); - put("payee", resultSet.getString("payee")); - put("serialNo", resultSet.getString("serialNo")); - put("transactionNumber", resultSet.getString("transactionNumber")); - put("transactionType", resultSet.getString("transactionType")); - put("surrenderReasonId", resultSet.getString("surrenderReasonId")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private InstrumentSearch getInstrumentSearch1() { - InstrumentSearch instrumentSearch = new InstrumentSearch(); - instrumentSearch.setId("id"); - instrumentSearch.setAmount(BigDecimal.ONE); - instrumentSearch.setBank(BankContract.builder().id("1").build()); - instrumentSearch.setBankAccount(BankAccountContract.builder().id("1").build()); - instrumentSearch.setBranchName("branchName"); - instrumentSearch.setDrawer("drawer"); - instrumentSearch.setFinancialStatus(FinancialStatusContract.builder().id("1").build()); - instrumentSearch.setRemittanceVoucherId("1"); - instrumentSearch.setInstrumentType(InstrumentType.builder().id("1").build()); - instrumentSearch.setPayee("payee"); - instrumentSearch.setSerialNo("serialNo"); - instrumentSearch.setSurrenderReason(SurrenderReason.builder().id("1").build()); - instrumentSearch.setTransactionNumber("transactionNumber"); - instrumentSearch.setTransactionType(TransactionType.Credit); - instrumentSearch.setReceiptIds("1"); - instrumentSearch.setTenantId("default"); - instrumentSearch.setPageSize(500); - instrumentSearch.setOffset(0); - instrumentSearch.setSortBy("id desc"); - return instrumentSearch; - } - - private InstrumentSearch getInstrumentSearch() { - InstrumentSearch instrumentSearch = new InstrumentSearch(); - instrumentSearch.setId("1"); - instrumentSearch.setIds("1"); - instrumentSearch.setAmount(BigDecimal.ONE); - instrumentSearch.setBank(BankContract.builder().id("code").build()); - instrumentSearch.setBankAccount(BankAccountContract.builder().accountNumber("accountNumber").build()); - instrumentSearch.setBranchName("branchName"); - instrumentSearch.setDrawer("drawer"); - instrumentSearch.setFinancialStatus(FinancialStatusContract.builder().id("1").build()); - instrumentSearch.setFinancialStatuses("1"); - instrumentSearch.setRemittanceVoucherId("1"); - instrumentSearch.setInstrumentType(InstrumentType.builder().name("name").build()); - instrumentSearch.setInstrumentTypes("name"); - instrumentSearch.setPayee("payee"); - instrumentSearch.setSerialNo("serialNo"); - instrumentSearch.setSurrenderReason(SurrenderReason.builder().id("1").build()); - instrumentSearch.setTransactionNumber("transactionNumber"); - instrumentSearch.setTransactionType(TransactionType.Credit); - instrumentSearch.setReceiptIds("1"); - try { - String startDateString = "07/27/2017"; - DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); - Date startDate; - startDate = df.parse(startDateString); - instrumentSearch.setTransactionFromDate(startDate); - instrumentSearch.setTransactionToDate(startDate); - } catch (Exception e) { - e.printStackTrace(); - } - instrumentSearch.setTenantId("default"); - instrumentSearch.setPageSize(500); - instrumentSearch.setOffset(0); - instrumentSearch.setSortBy("id desc"); - return instrumentSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentTypeJdbcRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentTypeJdbcRepositoryTest.java deleted file mode 100644 index b712b06bf93..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentTypeJdbcRepositoryTest.java +++ /dev/null @@ -1,230 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentTypeEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class InstrumentTypeJdbcRepositoryTest { - - private InstrumentTypeJdbcRepository instrumentTypeJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Autowired - private JdbcTemplate jdbcTemplate; - - @Before - public void setUp() throws Exception { - instrumentTypeJdbcRepository = new InstrumentTypeJdbcRepository(namedParameterJdbcTemplate, jdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql" }) - public void test_create() { - - InstrumentTypeEntity instrumentType = InstrumentTypeEntity.builder().id("1").name("name").description("description") - .active(true).build(); - instrumentType.setTenantId("default"); - InstrumentTypeEntity actualResult = instrumentTypeJdbcRepository.create(instrumentType); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentType", - new InstrumentTypeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("description")).isEqualTo(actualResult.getDescription()); - assertThat(row.get("active")).isEqualTo(actualResult.getActive()); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_update() { - - InstrumentTypeEntity instrumentType = InstrumentTypeEntity.builder().id("1").name("name").description("description") - .active(true).build(); - instrumentType.setTenantId("default"); - InstrumentTypeEntity actualResult = instrumentTypeJdbcRepository.update(instrumentType); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentType", - new InstrumentTypeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("description")).isEqualTo(actualResult.getDescription()); - assertThat(row.get("active")).isEqualTo(actualResult.getActive()); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_delete() { - - InstrumentTypeEntity instrumentType = InstrumentTypeEntity.builder().id("1").name("name").description("description") - .active(true).build(); - instrumentType.setTenantId("default"); - InstrumentTypeEntity actualResult = instrumentTypeJdbcRepository.delete(instrumentType); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentType", - new InstrumentTypeResultExtractor()); - assertTrue("Result set length is zero", result.size() == 0); - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_search() { - - Pagination page = (Pagination) instrumentTypeJdbcRepository - .search(getInstrumentTypeSearch()); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getDescription()).isEqualTo("description"); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_invalid_search() { - - Pagination page = (Pagination) instrumentTypeJdbcRepository - .search(getInstrumentTypeSearch1()); - assertThat(page.getPagedData().size()).isEqualTo(0); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_find_by_id() { - - InstrumentTypeEntity instrumentTypeEntity = InstrumentTypeEntity.builder().id("1").build(); - instrumentTypeEntity.setTenantId("default"); - InstrumentTypeEntity result = instrumentTypeJdbcRepository.findById(instrumentTypeEntity); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getDescription()).isEqualTo("description"); - assertThat(result.getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - InstrumentTypeEntity instrumentTypeEntity = InstrumentTypeEntity.builder().id("5").build(); - instrumentTypeEntity.setTenantId("default"); - InstrumentTypeEntity result = instrumentTypeJdbcRepository.findById(instrumentTypeEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_search_invalid_sort_option() { - - InstrumentTypeSearch search = getInstrumentTypeSearch(); - search.setSortBy("desc"); - instrumentTypeJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttype/clearInstrumentType.sql", - "/sql/instrumenttype/insertInstrumentTypeData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - InstrumentTypeSearch search = getInstrumentTypeSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) instrumentTypeJdbcRepository - .search(getInstrumentTypeSearch()); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getDescription()).isEqualTo("description"); - - } - - class InstrumentTypeResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("description", resultSet.getString("description")); - put("active", resultSet.getBoolean("active")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private InstrumentTypeSearch getInstrumentTypeSearch1() { - InstrumentTypeSearch instrumentTypeSearch = new InstrumentTypeSearch(); - instrumentTypeSearch.setId("id"); - instrumentTypeSearch.setName("name"); - instrumentTypeSearch.setDescription("description"); - instrumentTypeSearch.setActive(true); - instrumentTypeSearch.setTenantId("tenantId"); - instrumentTypeSearch.setPageSize(500); - instrumentTypeSearch.setOffset(0); - instrumentTypeSearch.setSortBy("name desc"); - return instrumentTypeSearch; - } - - private InstrumentTypeSearch getInstrumentTypeSearch() { - InstrumentTypeSearch instrumentTypeSearch = new InstrumentTypeSearch(); - instrumentTypeSearch.setId("1"); - instrumentTypeSearch.setIds("1"); - instrumentTypeSearch.setName("name"); - instrumentTypeSearch.setDescription("description"); - instrumentTypeSearch.setActive(true); - instrumentTypeSearch.setPageSize(500); - instrumentTypeSearch.setOffset(0); - instrumentTypeSearch.setSortBy("name desc"); - return instrumentTypeSearch; - } -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentTypePropertyJdbcRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentTypePropertyJdbcRepositoryTest.java deleted file mode 100644 index 03a76d5a109..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentTypePropertyJdbcRepositoryTest.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.egf.instrument.persistence.entity.InstrumentTypePropertyEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class InstrumentTypePropertyJdbcRepositoryTest { - - private InstrumentTypePropertyJdbcRepository instrumentTypePropertyJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - instrumentTypePropertyJdbcRepository = new InstrumentTypePropertyJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql" }) - public void test_create() { - - InstrumentTypePropertyEntity instrumentTypeProperty = InstrumentTypePropertyEntity.builder().id("1") - .transactionType("Credit").reconciledOncreate(true).statusOnCreateId("1").statusOnReconcileId("1") - .statusOnUpdateId("1").build(); - instrumentTypeProperty.setTenantId("default"); - InstrumentTypePropertyEntity actualResult = instrumentTypePropertyJdbcRepository.create(instrumentTypeProperty); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentTypeProperty", - new InstrumentTypePropertyResultExtractor()); - Map row = result.get(0); - - assertThat(row.get("transactionType")).isEqualTo(actualResult.getTransactionType()); - assertThat(row.get("reconciledOncreate")).isEqualTo(actualResult.getReconciledOncreate()); - assertThat(row.get("statusOnCreateId")).isEqualTo(actualResult.getStatusOnCreateId()); - assertThat(row.get("statusOnReconcileId")).isEqualTo(actualResult.getStatusOnReconcileId()); - assertThat(row.get("statusOnUpdateId")).isEqualTo(actualResult.getStatusOnUpdateId()); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql", - "/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql" }) - public void test_update() { - - InstrumentTypePropertyEntity instrumentTypeProperty = InstrumentTypePropertyEntity.builder().id("1") - .transactionType("Credit").reconciledOncreate(true).statusOnCreateId("1").statusOnReconcileId("1") - .statusOnUpdateId("1").build(); - instrumentTypeProperty.setTenantId("default"); - InstrumentTypePropertyEntity actualResult = instrumentTypePropertyJdbcRepository.update(instrumentTypeProperty); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentTypeProperty", - new InstrumentTypePropertyResultExtractor()); - Map row = result.get(0); - - assertThat(row.get("transactionType")).isEqualTo(actualResult.getTransactionType()); - assertThat(row.get("reconciledOncreate")).isEqualTo(actualResult.getReconciledOncreate()); - assertThat(row.get("statusOnCreateId")).isEqualTo(actualResult.getStatusOnCreateId()); - assertThat(row.get("statusOnReconcileId")).isEqualTo(actualResult.getStatusOnReconcileId()); - assertThat(row.get("statusOnUpdateId")).isEqualTo(actualResult.getStatusOnUpdateId()); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql", - "/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql" }) - public void test_find_by_id() { - - InstrumentTypePropertyEntity instrumentTypePropertyEntity = InstrumentTypePropertyEntity.builder().id("1") - .build(); - instrumentTypePropertyEntity.setTenantId("default"); - InstrumentTypePropertyEntity result = instrumentTypePropertyJdbcRepository - .findById(instrumentTypePropertyEntity); - - assertThat(result.getTransactionType()).isEqualTo("Credit"); - assertThat(result.getReconciledOncreate()).isEqualTo(true); - assertThat(result.getStatusOnCreateId()).isEqualTo("created"); - assertThat(result.getStatusOnReconcileId()).isEqualTo("reconciled"); - assertThat(result.getStatusOnUpdateId()).isEqualTo("updated"); - - } - - @Test - @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql", - "/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - InstrumentTypePropertyEntity instrumentTypePropertyEntity = InstrumentTypePropertyEntity.builder().id("5") - .build(); - instrumentTypePropertyEntity.setTenantId("default"); - InstrumentTypePropertyEntity result = instrumentTypePropertyJdbcRepository - .findById(instrumentTypePropertyEntity); - assertNull(result); - - } - - /* - * @Test - * @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql", - * "/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql" }) public void test_search() { - * Pagination page = (Pagination) instrumentTypePropertyJdbcRepository - * .search(getInstrumentTypePropertySearch()); assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - * assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - * assertThat(page.getPagedData().get(0).getDescription()).isEqualTo( "description"); } - */ - - /* - * @Test - * @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql", - * "/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql" }) public void test_invalid_search() { - * Pagination page = (Pagination) instrumentTypePropertyJdbcRepository - * .search(getInstrumentTypePropertySearch1()); assertThat(page.getPagedData().size()).isEqualTo(0); } - */ - - /* - * @Test(expected = InvalidDataException.class) - * @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql", - * "/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql" }) public void test_search_invalid_sort_option() { - * InstrumentTypePropertySearch search = getInstrumentTypePropertySearch(); search.setSortBy("desc"); - * instrumentTypePropertyJdbcRepository.search(search); } - * @Test - * @Sql(scripts = { "/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql", - * "/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql" }) public void - * test_search_without_pagesize_offset_sortby() { InstrumentTypePropertySearch search = getInstrumentTypePropertySearch(); - * search.setSortBy(null); search.setPageSize(null); search.setOffset(null); Pagination page = - * (Pagination) instrumentTypePropertyJdbcRepository .search(getInstrumentTypePropertySearch()); - * assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - * assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - * assertThat(page.getPagedData().get(0).getDescription()).isEqualTo( "description"); } - */ - - class InstrumentTypePropertyResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("transactionType", resultSet.getString("transactionType")); - put("reconciledOncreate", resultSet.getBoolean("reconciledOncreate")); - put("statusOnCreateId", resultSet.getString("statusOnCreateId")); - put("statusOnUpdateId", resultSet.getString("statusOnUpdateId")); - put("statusOnReconcileId", resultSet.getString("statusOnReconcileId")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - /* - * private InstrumentTypePropertySearch getInstrumentTypePropertySearch1() { InstrumentTypePropertySearch - * instrumentTypePropertySearch = new InstrumentTypePropertySearch(); instrumentTypePropertySearch.setId("id"); - * instrumentTypePropertySearch.setName("name"); instrumentTypePropertySearch.setDescription("description"); - * instrumentTypePropertySearch.setActive(true); instrumentTypePropertySearch.setTenantId("tenantId"); - * instrumentTypePropertySearch.setPageSize(500); instrumentTypePropertySearch.setOffset(0); - * instrumentTypePropertySearch.setSortBy("name desc"); return instrumentTypePropertySearch; } private - * InstrumentTypePropertySearch getInstrumentTypePropertySearch() { InstrumentTypePropertySearch instrumentTypePropertySearch - * = new InstrumentTypePropertySearch(); instrumentTypePropertySearch.setName("name"); - * instrumentTypePropertySearch.setDescription("description"); instrumentTypePropertySearch.setActive(true); - * instrumentTypePropertySearch.setPageSize(500); instrumentTypePropertySearch.setOffset(0); - * instrumentTypePropertySearch.setSortBy("name desc"); return instrumentTypePropertySearch; } - */ -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentVoucherJdbcRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentVoucherJdbcRepositoryTest.java deleted file mode 100644 index 46f7f3dff02..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/InstrumentVoucherJdbcRepositoryTest.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.domain.model.InstrumentVoucherSearch; -import org.egov.egf.instrument.persistence.entity.InstrumentVoucherEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class InstrumentVoucherJdbcRepositoryTest { - - private InstrumentVoucherJdbcRepository instrumentVoucherJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - instrumentVoucherJdbcRepository = new InstrumentVoucherJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql" }) - public void test_create() { - - InstrumentVoucherEntity instrumentVoucher = InstrumentVoucherEntity.builder().id("1").instrumentId("1") - .voucherHeaderId("1").receiptHeaderId("1").build(); - instrumentVoucher.setTenantId("default"); - InstrumentVoucherEntity actualResult = instrumentVoucherJdbcRepository.create(instrumentVoucher); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentVoucher", - new InstrumentVoucherResultExtractor()); - Map row = result.get(0); - - assertThat(row.get("instrumentId")).isEqualTo(actualResult.getInstrumentId()); - assertThat(row.get("voucherHeaderId")).isEqualTo(actualResult.getVoucherHeaderId()); - assertThat(row.get("receiptHeaderId")).isEqualTo(actualResult.getReceiptHeaderId()); - - } - - @Test - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", - "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) - public void test_update() { - - InstrumentVoucherEntity instrumentVoucher = InstrumentVoucherEntity.builder().id("1").instrumentId("1") - .voucherHeaderId("1").receiptHeaderId("1").build(); - instrumentVoucher.setTenantId("default"); - InstrumentVoucherEntity actualResult = instrumentVoucherJdbcRepository.update(instrumentVoucher); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_instrumentVoucher", - new InstrumentVoucherResultExtractor()); - Map row = result.get(0); - - assertThat(row.get("instrumentId")).isEqualTo(actualResult.getInstrumentId()); - assertThat(row.get("voucherHeaderId")).isEqualTo(actualResult.getVoucherHeaderId()); - assertThat(row.get("receiptHeaderId")).isEqualTo(actualResult.getReceiptHeaderId()); - - } - - @Test - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", - "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) - public void test_find_by_id() { - - InstrumentVoucherEntity instrumentVoucherEntity = InstrumentVoucherEntity.builder().id("1").build(); - instrumentVoucherEntity.setTenantId("default"); - InstrumentVoucherEntity result = instrumentVoucherJdbcRepository.findById(instrumentVoucherEntity); - - assertThat(result.getInstrumentId()).isEqualTo("1"); - assertThat(result.getVoucherHeaderId()).isEqualTo("1"); - assertThat(result.getReceiptHeaderId()).isEqualTo("1"); - - } - - @Test - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", - "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - InstrumentVoucherEntity instrumentVoucherEntity = InstrumentVoucherEntity.builder().id("5").build(); - instrumentVoucherEntity.setTenantId("default"); - InstrumentVoucherEntity result = instrumentVoucherJdbcRepository.findById(instrumentVoucherEntity); - assertNull(result); - - } - - @Test - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", - "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) - public void test_search() { - Pagination page = (Pagination) instrumentVoucherJdbcRepository - .search(getInstrumentVoucherSearch()); - assertThat(page.getPagedData().get(0).getReceiptHeaderId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getVoucherHeaderId()).isEqualTo("1"); - } - - @Test - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", - "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) - public void test_invalid_search() { - Pagination page = (Pagination) instrumentVoucherJdbcRepository - .search(getInstrumentVoucherSearch1()); - assertThat(page.getPagedData().size()).isEqualTo(0); - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", - "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) - public void test_search_invalid_sort_option() { - InstrumentVoucherSearch search = getInstrumentVoucherSearch(); - search.setSortBy("desc"); - instrumentVoucherJdbcRepository.search(search); - } - - @Test - @Sql(scripts = { "/sql/instrumentvoucher/clearInstrumentVoucher.sql", - "/sql/instrumentvoucher/insertInstrumentVoucherData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - InstrumentVoucherSearch search = getInstrumentVoucherSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) instrumentVoucherJdbcRepository - .search(getInstrumentVoucherSearch()); - assertThat(page.getPagedData().get(0).getInstrument().getId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getReceiptHeaderId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getVoucherHeaderId()).isEqualTo("1"); - } - - class InstrumentVoucherResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("instrumentId", resultSet.getString("instrumentId")); - put("voucherHeaderId", resultSet.getString("voucherHeaderId")); - put("receiptHeaderId", resultSet.getString("receiptHeaderId")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private InstrumentVoucherSearch getInstrumentVoucherSearch1() { - InstrumentVoucherSearch instrumentVoucherSearch = new InstrumentVoucherSearch(); - instrumentVoucherSearch.setInstrument(Instrument.builder().id("id").build()); - instrumentVoucherSearch.setReceiptHeaderId("receiptHeaderId"); - instrumentVoucherSearch.setVoucherHeaderId("voucherHeaderId"); - instrumentVoucherSearch.setTenantId("tenantId"); - instrumentVoucherSearch.setPageSize(500); - instrumentVoucherSearch.setOffset(0); - instrumentVoucherSearch.setSortBy("id desc"); - return instrumentVoucherSearch; - } - - private InstrumentVoucherSearch getInstrumentVoucherSearch() { - InstrumentVoucherSearch instrumentVoucherSearch = new InstrumentVoucherSearch(); - instrumentVoucherSearch.setReceiptHeaderId("1"); - instrumentVoucherSearch.setVoucherHeaderId("1"); - instrumentVoucherSearch.setInstruments("1"); - instrumentVoucherSearch.setReceiptIds("1"); - instrumentVoucherSearch.setPageSize(500); - instrumentVoucherSearch.setOffset(0); - instrumentVoucherSearch.setSortBy("id desc"); - return instrumentVoucherSearch; - } -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/SurrenderReasonJdbcRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/SurrenderReasonJdbcRepositoryTest.java deleted file mode 100644 index 082cc2d9847..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/persistence/repository/SurrenderReasonJdbcRepositoryTest.java +++ /dev/null @@ -1,222 +0,0 @@ -package org.egov.egf.instrument.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.persistence.entity.SurrenderReasonEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class SurrenderReasonJdbcRepositoryTest { - - private SurrenderReasonJdbcRepository surrenderReasonJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Autowired - private JdbcTemplate jdbcTemplate; - - @Before - public void setUp() throws Exception { - surrenderReasonJdbcRepository = new SurrenderReasonJdbcRepository(namedParameterJdbcTemplate, jdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql" }) - public void test_create() { - - SurrenderReasonEntity surrenderReason = SurrenderReasonEntity.builder().id("1").name("name") - .description("description").build(); - surrenderReason.setTenantId("default"); - SurrenderReasonEntity actualResult = surrenderReasonJdbcRepository.create(surrenderReason); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_surrenderReason", - new SurrenderReasonResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("description")).isEqualTo(actualResult.getDescription()); - - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_update() { - - SurrenderReasonEntity surrenderReason = SurrenderReasonEntity.builder().id("1").name("name") - .description("description").build(); - surrenderReason.setTenantId("default"); - SurrenderReasonEntity actualResult = surrenderReasonJdbcRepository.update(surrenderReason); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_surrenderReason", - new SurrenderReasonResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("description")).isEqualTo(actualResult.getDescription()); - - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_delete() { - - SurrenderReasonEntity surrenderReason = SurrenderReasonEntity.builder().id("1").name("name") - .description("description").build(); - surrenderReason.setTenantId("default"); - SurrenderReasonEntity actualResult = surrenderReasonJdbcRepository.delete(surrenderReason); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_surrenderReason", - new SurrenderReasonResultExtractor()); - assertTrue("Result set length is zero", result.size() == 0); - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_search() { - - Pagination page = (Pagination) surrenderReasonJdbcRepository - .search(getSurrenderReasonSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getDescription()).isEqualTo("description"); - - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_invalid_search() { - - Pagination page = (Pagination) surrenderReasonJdbcRepository - .search(getSurrenderReasonSearch1()); - assertThat(page.getPagedData().size()).isEqualTo(0); - - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_find_by_id() { - - SurrenderReasonEntity surrenderReasonEntity = SurrenderReasonEntity.builder().id("1").build(); - surrenderReasonEntity.setTenantId("default"); - SurrenderReasonEntity result = surrenderReasonJdbcRepository.findById(surrenderReasonEntity); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getDescription()).isEqualTo("description"); - - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - SurrenderReasonEntity surrenderReasonEntity = SurrenderReasonEntity.builder().id("5").build(); - surrenderReasonEntity.setTenantId("default"); - SurrenderReasonEntity result = surrenderReasonJdbcRepository.findById(surrenderReasonEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_search_invalid_sort_option() { - - SurrenderReasonSearch search = getSurrenderReasonSearch(); - search.setSortBy("desc"); - surrenderReasonJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/surrenderreason/clearSurrenderReason.sql", - "/sql/surrenderreason/insertSurrenderReasonData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - SurrenderReasonSearch search = getSurrenderReasonSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) surrenderReasonJdbcRepository - .search(getSurrenderReasonSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getDescription()).isEqualTo("description"); - - } - - class SurrenderReasonResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("description", resultSet.getString("description")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private SurrenderReasonSearch getSurrenderReasonSearch1() { - SurrenderReasonSearch surrenderReasonSearch = new SurrenderReasonSearch(); - surrenderReasonSearch.setId("id"); - surrenderReasonSearch.setName("name"); - surrenderReasonSearch.setDescription("description"); - surrenderReasonSearch.setTenantId("tenantId"); - surrenderReasonSearch.setPageSize(500); - surrenderReasonSearch.setOffset(0); - surrenderReasonSearch.setSortBy("name desc"); - return surrenderReasonSearch; - } - - private SurrenderReasonSearch getSurrenderReasonSearch() { - SurrenderReasonSearch surrenderReasonSearch = new SurrenderReasonSearch(); - surrenderReasonSearch.setId("1"); - surrenderReasonSearch.setIds("1"); - surrenderReasonSearch.setName("name"); - surrenderReasonSearch.setDescription("description"); - surrenderReasonSearch.setPageSize(500); - surrenderReasonSearch.setOffset(0); - surrenderReasonSearch.setSortBy("name desc"); - return surrenderReasonSearch; - } -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/utils/RequestJsonReader.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/utils/RequestJsonReader.java deleted file mode 100644 index 773f8a6b205..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/utils/RequestJsonReader.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.egov.egf.instrument.utils; - -import java.io.IOException; - -import org.apache.commons.io.IOUtils; - -public class RequestJsonReader { - - public String readRequest(String fileName) { - try { - String info = IOUtils.toString( - this.getClass().getClassLoader().getResourceAsStream("common/request_info.json"), "UTF-8"); - - String data = IOUtils.toString(this.getClass().getClassLoader().getResourceAsStream(fileName), "UTF-8"); - return "{\n" + info + "," + data + "}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public String readResponse(String fileName) { - try { - String info = IOUtils.toString( - this.getClass().getClassLoader().getResourceAsStream("common/response_info.json"), "UTF-8"); - - String data = IOUtils.toString(this.getClass().getClassLoader().getResourceAsStream(fileName), "UTF-8"); - return "{\n" + info + "," + data + "}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public String readErrorResponse(String fileName) { - try { - String info = IOUtils - .toString(this.getClass().getClassLoader().getResourceAsStream("common/error_info.json"), "UTF-8"); - - String data = IOUtils.toString(this.getClass().getClassLoader().getResourceAsStream(fileName), "UTF-8"); - return "{\n" + info + "," + data + "}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public String getRequestInfo() { - try { - String info = IOUtils.toString( - this.getClass().getClassLoader().getResourceAsStream("common/request_info.json"), "UTF-8"); - - return "{\n" + info + "}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public String getFileContents(String fileName) { - try { - return IOUtils.toString(this.getClass().getClassLoader().getResourceAsStream(fileName), "UTF-8"); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentAccountCodeControllerTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentAccountCodeControllerTest.java deleted file mode 100644 index 6db7d722cec..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentAccountCodeControllerTest.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.service.InstrumentAccountCodeService; -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.requests.InstrumentAccountCodeRequest; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(InstrumentAccountCodeController.class) -@Import(TestConfiguration.class) -public class InstrumentAccountCodeControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private InstrumentAccountCodeService instrumentAccountCodeService; - - @Captor - private ArgumentCaptor captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void test_create() throws IOException, Exception { - - when(instrumentAccountCodeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentAccountCodes()); - - mockMvc.perform(post("/instrumentaccountcodes/_create") - .content(resources.readRequest("instrumentaccountcode/instrumentaccountcode_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("instrumentaccountcode/instrumentaccountcode_create_valid_response.json"))); - } - - @Test - public void test_create_error() throws IOException, Exception { - - when(instrumentAccountCodeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentAccountCodes()); - - mockMvc.perform(post("/instrumentaccountcodes/_create") - .content(resources - .readRequest("instrumentaccountcode/instrumentaccountcode_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_update() throws IOException, Exception { - - List instrumentAccountCodes = getInstrumentAccountCodes(); - instrumentAccountCodes.get(0).setId("1"); - - when(instrumentAccountCodeService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instrumentAccountCodes); - - mockMvc.perform(post("/instrumentaccountcodes/_update") - .content(resources.readRequest("instrumentaccountcode/instrumentaccountcode_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("instrumentaccountcode/instrumentaccountcode_update_valid_response.json"))); - - } - - @Test - public void test_delete() throws IOException, Exception { - - List instrumentAccountCodes = getInstrumentAccountCodes(); - instrumentAccountCodes.get(0).setId("1"); - - when(instrumentAccountCodeService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instrumentAccountCodes); - - mockMvc.perform(post("/instrumentaccountcodes/_delete") - .content(resources.readRequest("instrumentaccountcode/instrumentaccountcode_delete_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("instrumentaccountcode/instrumentaccountcode_delete_valid_response.json"))); - - } - - @Test - public void test_update_error() throws IOException, Exception { - - when(instrumentAccountCodeService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentAccountCodes()); - - mockMvc.perform(post("/instrumentaccountcodes/_update") - .content(resources - .readRequest("instrumentaccountcode/instrumentaccountcode_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_delete_error() throws IOException, Exception { - - when(instrumentAccountCodeService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentAccountCodes()); - - mockMvc.perform(post("/instrumentaccountcodes/_delete") - .content(resources - .readRequest("instrumentaccountcode/instrumentaccountcode_delete_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getInstrumentAccountCodes()); - page.getPagedData().get(0).setId("1"); - - when(instrumentAccountCodeService.search(any(InstrumentAccountCodeSearch.class))).thenReturn(page); - - mockMvc.perform(post("/instrumentaccountcodes/_search").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("instrumentaccountcode/instrumentaccountcode_search_valid_response.json"))); - - } - - private List getInstrumentAccountCodes() { - List instrumentAccountCodes = new ArrayList(); - InstrumentAccountCode instrumentAccountCode = InstrumentAccountCode.builder() - .instrumentType(InstrumentType.builder().active(true).name("instrumenttype").build()) - .accountCode(ChartOfAccountContract.builder().glcode("glcode").build()).build(); - instrumentAccountCode.setTenantId("default"); - instrumentAccountCodes.add(instrumentAccountCode); - return instrumentAccountCodes; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentControllerTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentControllerTest.java deleted file mode 100644 index c6e27272005..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentControllerTest.java +++ /dev/null @@ -1,207 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.instrument.domain.service.InstrumentService; -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.requests.InstrumentRequest; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(InstrumentController.class) -@Import(TestConfiguration.class) -public class InstrumentControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private InstrumentService instrumentService; - - @Captor - private ArgumentCaptor captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void test_create() throws IOException, Exception { - - when(instrumentService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstruments()); - - mockMvc.perform(post("/instruments/_create") - .content(resources.readRequest("instrument/instrument_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("instrument/instrument_create_valid_response.json"))); - - } - - @Test - public void test_create_error() throws IOException, Exception { - - when(instrumentService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstruments()); - - mockMvc.perform(post("/instruments/_create") - .content(resources.readRequest("instrument/instrument_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_update() throws IOException, Exception { - - List instruments = getInstruments(); - instruments.get(0).setId("1"); - - when(instrumentService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instruments); - - mockMvc.perform(post("/instruments/_update") - .content(resources.readRequest("instrument/instrument_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("instrument/instrument_update_valid_response.json"))); - - } - - @Test - public void test_delete() throws IOException, Exception { - - List instruments = getInstruments(); - instruments.get(0).setId("1"); - - when(instrumentService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instruments); - - mockMvc.perform(post("/instruments/_delete") - .content(resources.readRequest("instrument/instrument_delete_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("instrument/instrument_delete_valid_response.json"))); - - } - - @Test - public void test_update_error() throws IOException, Exception { - - when(instrumentService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstruments()); - - mockMvc.perform(post("/instruments/_update") - .content(resources.readRequest("instrument/instrument_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_delete_error() throws IOException, Exception { - - when(instrumentService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstruments()); - - mockMvc.perform(post("/instruments/_delete") - .content(resources.readRequest("instrument/instrument_delete_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getInstruments()); - page.getPagedData().get(0).setId("1"); - - when(instrumentService.search(any(InstrumentSearch.class))).thenReturn(page); - - mockMvc.perform(post("/instruments/_search").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("instrument/instrument_search_valid_response.json"))); - - } - - @Test - public void test_deposit_instrument() throws IOException, Exception { - List instruments = getInstrumentsForDeposit(); - instruments.get(0).setId("726bb79942b24a75815fc11172cef45e"); - when(instrumentService.deposit(any(InstrumentRequest.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instruments); - - mockMvc.perform(post("/instruments/_deposit") - .content(resources.readRequest("instrument/instrument_deposit_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("instrument/instrument_deposit_valid_response.json"))); - } - - @Test - public void test_dishonor_instrument() throws IOException, Exception { - List instruments = getInstrumentsForDeposit(); - instruments.get(0).setId("726bb79942b24a75815fc11172cef45e"); - when(instrumentService.dishonor(any(InstrumentRequest.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instruments); - - mockMvc.perform(post("/instruments/_dishonor") - .content(resources.readRequest("instrument/instrument_dishonor_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("instrument/instrument_dishonor_valid_response.json"))); - } - - private List getInstruments() { - List instruments = new ArrayList(); - Instrument instrument = Instrument.builder().transactionNumber("transactionNumber").amount(BigDecimal.ONE) - .transactionType(TransactionType.Credit).serialNo("serialNo") - .instrumentType(InstrumentType.builder().active(true).name("instrumenttype").build()).build(); - instrument.setTenantId("default"); - instruments.add(instrument); - return instruments; - } - - private List getInstrumentsForDeposit() { - List instruments = new ArrayList(); - Instrument instrument = Instrument.builder().transactionNumber("transactionNumber").amount(BigDecimal.ONE) - .transactionType(TransactionType.Debit).serialNo("serialNo") - .financialStatus(FinancialStatusContract.builder().id("a167095b-5a73-4e61-b489-af31f053c4e1") - .moduleType("Instrument").code("Deposited").build()) - .build(); - instrument.setTenantId("default"); - instruments.add(instrument); - return instruments; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentTypeControllerTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentTypeControllerTest.java deleted file mode 100644 index ba982bc2e9a..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/InstrumentTypeControllerTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentTypeSearch; -import org.egov.egf.instrument.domain.service.InstrumentTypeService; -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.requests.InstrumentTypeRequest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(InstrumentTypeController.class) -@Import(TestConfiguration.class) -public class InstrumentTypeControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private InstrumentTypeService instrumentTypeService; - - @Captor - private ArgumentCaptor captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void test_create() throws IOException, Exception { - - when(instrumentTypeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentTypes()); - - mockMvc.perform(post("/instrumenttypes/_create") - .content(resources.readRequest("instrumenttype/instrumenttype_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("instrumenttype/instrumenttype_create_valid_response.json"))); - } - - @Test - public void test_create_error() throws IOException, Exception { - - when(instrumentTypeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentTypes()); - - mockMvc.perform(post("/instrumenttypes/_create") - .content(resources.readRequest("instrumenttype/instrumenttype_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_update() throws IOException, Exception { - - List instrumentTypes = getInstrumentTypes(); - instrumentTypes.get(0).setId("1"); - - when(instrumentTypeService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instrumentTypes); - - mockMvc.perform(post("/instrumenttypes/_update") - .content(resources.readRequest("instrumenttype/instrumenttype_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("instrumenttype/instrumenttype_update_valid_response.json"))); - - } - - @Test - public void test_delete() throws IOException, Exception { - - List instrumentTypes = getInstrumentTypes(); - instrumentTypes.get(0).setId("1"); - - when(instrumentTypeService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(instrumentTypes); - - mockMvc.perform(post("/instrumenttypes/_delete") - .content(resources.readRequest("instrumenttype/instrumenttype_delete_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("instrumenttype/instrumenttype_delete_valid_response.json"))); - - } - - @Test - public void test_update_error() throws IOException, Exception { - - when(instrumentTypeService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentTypes()); - - mockMvc.perform(post("/instrumenttypes/_update") - .content(resources.readRequest("instrumenttype/instrumenttype_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_delete_error() throws IOException, Exception { - - when(instrumentTypeService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getInstrumentTypes()); - - mockMvc.perform(post("/instrumenttypes/_delete") - .content(resources.readRequest("instrumenttype/instrumenttype_delete_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getInstrumentTypes()); - page.getPagedData().get(0).setId("1"); - - when(instrumentTypeService.search(any(InstrumentTypeSearch.class))).thenReturn(page); - - mockMvc.perform(post("/instrumenttypes/_search").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("instrumenttype/instrumenttype_search_valid_response.json"))); - - } - - private List getInstrumentTypes() { - List instrumentTypes = new ArrayList(); - InstrumentType instrumentType = InstrumentType.builder().name("name").description("description").active(true) - .build(); - instrumentType.setTenantId("default"); - instrumentTypes.add(instrumentType); - return instrumentTypes; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/SurrenderReasonControllerTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/SurrenderReasonControllerTest.java deleted file mode 100644 index b3f14f0c806..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/controller/SurrenderReasonControllerTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.egov.egf.instrument.web.controller; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.instrument.TestConfiguration; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.domain.service.SurrenderReasonService; -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.requests.SurrenderReasonRequest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(SurrenderReasonController.class) -@Import(TestConfiguration.class) -public class SurrenderReasonControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private SurrenderReasonService surrenderReasonService; - - @Captor - private ArgumentCaptor captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void test_create() throws IOException, Exception { - - when(surrenderReasonService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getSurrenderReasons()); - - mockMvc.perform(post("/surrenderreasons/_create") - .content(resources.readRequest("surrenderreason/surrenderreason_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("surrenderreason/surrenderreason_create_valid_response.json"))); - - } - - @Test - public void test_create_error() throws IOException, Exception { - - when(surrenderReasonService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getSurrenderReasons()); - - mockMvc.perform(post("/surrenderreasons/_create") - .content(resources.readRequest("surrenderreason/surrenderreason_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_update() throws IOException, Exception { - - List surrenderReasons = getSurrenderReasons(); - surrenderReasons.get(0).setId("1"); - - when(surrenderReasonService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(surrenderReasons); - - mockMvc.perform(post("/surrenderreasons/_update") - .content(resources.readRequest("surrenderreason/surrenderreason_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("surrenderreason/surrenderreason_update_valid_response.json"))); - - } - - @Test - public void test_delete() throws IOException, Exception { - - List surrenderReasons = getSurrenderReasons(); - surrenderReasons.get(0).setId("1"); - - when(surrenderReasonService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(surrenderReasons); - - mockMvc.perform(post("/surrenderreasons/_delete") - .content(resources.readRequest("surrenderreason/surrenderreason_delete_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("surrenderreason/surrenderreason_delete_valid_response.json"))); - - } - - @Test - public void test_update_error() throws IOException, Exception { - - when(surrenderReasonService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getSurrenderReasons()); - - mockMvc.perform(post("/surrenderreasons/_update") - .content(resources.readRequest("surrenderreason/surrenderreason_delete_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_delete_error() throws IOException, Exception { - - when(surrenderReasonService.delete(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getSurrenderReasons()); - - mockMvc.perform(post("/surrenderreasons/_delete") - .content(resources.readRequest("surrenderreason/surrenderreason_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getSurrenderReasons()); - page.getPagedData().get(0).setId("1"); - - when(surrenderReasonService.search(any(SurrenderReasonSearch.class))).thenReturn(page); - - mockMvc.perform(post("/surrenderreasons/_search").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("surrenderreason/surrenderreason_search_valid_response.json"))); - - } - - private List getSurrenderReasons() { - List surrenderReasons = new ArrayList(); - SurrenderReason surrenderReason = SurrenderReason.builder().name("name").description("description").build(); - surrenderReason.setTenantId("default"); - surrenderReasons.add(surrenderReason); - return surrenderReasons; - } - -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentAccountCodeMapperTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentAccountCodeMapperTest.java deleted file mode 100644 index 8c8fcf065cd..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentAccountCodeMapperTest.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import static org.junit.Assert.assertEquals; - -import org.egov.common.contract.request.User; -import org.egov.egf.instrument.domain.model.InstrumentAccountCode; -import org.egov.egf.instrument.domain.model.InstrumentAccountCodeSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeSearchContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentAccountCodeMapperTest { - - @InjectMocks - private InstrumentAccountCodeMapper instrumentAccountCodeMapper; - - @Before - public void setup() { - instrumentAccountCodeMapper = new InstrumentAccountCodeMapper(); - } - - @Test - public void test_to_domain() { - - InstrumentAccountCode expectedDomain = instrumentAccountCodeMapper.toDomain(contract()); - - assertEquals(expectedDomain.getId(), domain().getId()); - assertEquals(expectedDomain.getInstrumentType().getId(), domain().getInstrumentType().getId()); - assertEquals(expectedDomain.getAccountCode().getId(), domain().getAccountCode().getId()); - assertEquals(expectedDomain.getCreatedBy().getId(), domain().getCreatedBy().getId()); - assertEquals(expectedDomain.getLastModifiedBy().getId(), domain().getLastModifiedBy().getId()); - assertEquals(expectedDomain.getTenantId(), domain().getTenantId()); - - } - - @Test - public void test_to_contract() { - - InstrumentAccountCodeContract expectedContract = instrumentAccountCodeMapper.toContract(domain()); - - assertEquals(expectedContract.getId(), contract().getId()); - assertEquals(expectedContract.getInstrumentType().getId(), contract().getInstrumentType().getId()); - assertEquals(expectedContract.getAccountCode().getId(), contract().getAccountCode().getId()); - assertEquals(expectedContract.getCreatedBy().getId(), contract().getCreatedBy().getId()); - assertEquals(expectedContract.getLastModifiedBy().getId(), contract().getLastModifiedBy().getId()); - assertEquals(expectedContract.getTenantId(), contract().getTenantId()); - - } - - @Test - public void test_to_search_domain() { - - InstrumentAccountCodeSearch expectedSearchDomain = instrumentAccountCodeMapper.toSearchDomain(searchContract()); - - assertEquals(expectedSearchDomain.getId(), searchDomain().getId()); - assertEquals(expectedSearchDomain.getInstrumentType().getId(), searchDomain().getInstrumentType().getId()); - assertEquals(expectedSearchDomain.getAccountCode().getId(), searchDomain().getAccountCode().getId()); - assertEquals(expectedSearchDomain.getCreatedBy().getId(), searchDomain().getCreatedBy().getId()); - assertEquals(expectedSearchDomain.getLastModifiedBy().getId(), searchDomain().getLastModifiedBy().getId()); - assertEquals(expectedSearchDomain.getTenantId(), searchDomain().getTenantId()); - assertEquals(expectedSearchDomain.getPageSize(), searchDomain().getPageSize()); - assertEquals(expectedSearchDomain.getOffset(), searchDomain().getOffset()); - } - - @Test - public void test_to_search_contract() { - - InstrumentAccountCodeSearchContract expectedSearchContract = instrumentAccountCodeMapper - .toSearchContract(searchDomain()); - - assertEquals(expectedSearchContract.getId(), searchContract().getId()); - assertEquals(expectedSearchContract.getInstrumentType().getId(), searchContract().getInstrumentType().getId()); - assertEquals(expectedSearchContract.getAccountCode().getId(), searchContract().getAccountCode().getId()); - assertEquals(expectedSearchContract.getCreatedBy().getId(), searchContract().getCreatedBy().getId()); - assertEquals(expectedSearchContract.getLastModifiedBy().getId(), searchContract().getLastModifiedBy().getId()); - assertEquals(expectedSearchContract.getTenantId(), searchContract().getTenantId()); - assertEquals(expectedSearchContract.getPageSize(), searchContract().getPageSize()); - assertEquals(expectedSearchContract.getOffset(), searchContract().getOffset()); - - } - - public InstrumentAccountCode domain() { - - InstrumentAccountCode instrumentAccountCode = new InstrumentAccountCode(); - - instrumentAccountCode.setId("id"); - instrumentAccountCode.setInstrumentType(InstrumentType.builder().id("id").build()); - instrumentAccountCode.setAccountCode(ChartOfAccountContract.builder().id("id").build()); - instrumentAccountCode.setCreatedBy(User.builder().id(1l).build()); - instrumentAccountCode.setLastModifiedBy(User.builder().id(1l).build()); - instrumentAccountCode.setTenantId("tenantId"); - - return instrumentAccountCode; - } - - public InstrumentAccountCodeContract contract() { - - InstrumentAccountCodeContract contract = new InstrumentAccountCodeContract(); - - contract.setId("id"); - contract.setInstrumentType(InstrumentTypeContract.builder().id("id").build()); - contract.setAccountCode(ChartOfAccountContract.builder().id("id").build()); - contract.setCreatedBy(User.builder().id(1l).build()); - contract.setLastModifiedBy(User.builder().id(1l).build()); - contract.setTenantId("tenantId"); - - return contract; - } - - public InstrumentAccountCodeSearch searchDomain() { - - InstrumentAccountCodeSearch instrumentAccountCodeSearch = new InstrumentAccountCodeSearch(); - - instrumentAccountCodeSearch.setId("id"); - instrumentAccountCodeSearch.setInstrumentType(InstrumentType.builder().id("id").build()); - instrumentAccountCodeSearch.setAccountCode(ChartOfAccountContract.builder().id("id").build()); - instrumentAccountCodeSearch.setCreatedBy(User.builder().id(1l).build()); - instrumentAccountCodeSearch.setLastModifiedBy(User.builder().id(1l).build()); - instrumentAccountCodeSearch.setTenantId("tenantId"); - instrumentAccountCodeSearch.setPageSize(1); - instrumentAccountCodeSearch.setOffset(1); - - return instrumentAccountCodeSearch; - } - - public InstrumentAccountCodeSearchContract searchContract() { - - InstrumentAccountCodeSearchContract contract = new InstrumentAccountCodeSearchContract(); - - contract.setId("id"); - contract.setInstrumentType(InstrumentTypeContract.builder().id("id").build()); - contract.setAccountCode(ChartOfAccountContract.builder().id("id").build()); - contract.setCreatedBy(User.builder().id(1l).build()); - contract.setLastModifiedBy(User.builder().id(1l).build()); - contract.setTenantId("tenantId"); - contract.setPageSize(1); - contract.setOffset(1); - - return contract; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentMapperTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentMapperTest.java deleted file mode 100644 index adce021e1c0..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentMapperTest.java +++ /dev/null @@ -1,294 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import static org.junit.Assert.assertEquals; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.User; -import org.egov.egf.instrument.domain.model.Instrument; -import org.egov.egf.instrument.domain.model.InstrumentSearch; -import org.egov.egf.instrument.domain.model.InstrumentType; -import org.egov.egf.instrument.domain.model.InstrumentVoucher; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.TransactionType; -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.egov.egf.instrument.web.contract.InstrumentSearchContract; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.egov.egf.instrument.web.contract.InstrumentVoucherContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.egov.egf.instrument.web.contract.TransactionTypeContract; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentMapperTest { - - @InjectMocks - private InstrumentMapper instrumentMapper; - - @Before - public void setup() { - instrumentMapper = new InstrumentMapper(); - } - - @Test - public void test_to_domain() { - - Instrument expectedDomain = instrumentMapper.toDomain(contract()); - - assertEquals(expectedDomain.getId(), domain().getId()); - assertEquals(expectedDomain.getAmount(), domain().getAmount()); - assertEquals(expectedDomain.getBank().getId(), domain().getBank().getId()); - assertEquals(expectedDomain.getBankAccount().getId(), domain().getBankAccount().getId()); - assertEquals(expectedDomain.getBranchName(), domain().getBranchName()); - assertEquals(expectedDomain.getDrawer(), domain().getDrawer()); - assertEquals(expectedDomain.getFinancialStatus().getCode(), domain().getFinancialStatus().getCode()); - assertEquals(expectedDomain.getInstrumentType().getId(), domain().getInstrumentType().getId()); - assertEquals(expectedDomain.getSurrenderReason().getId(), domain().getSurrenderReason().getId()); - assertEquals(expectedDomain.getInstrumentVouchers().iterator().next().getInstrument().getId(), - domain().getInstrumentVouchers().iterator().next().getInstrument().getId()); - - assertEquals(expectedDomain.getInstrumentVouchers().iterator().next().getVoucherHeaderId(), - domain().getInstrumentVouchers().iterator().next().getVoucherHeaderId()); - assertEquals(expectedDomain.getPayee(), domain().getPayee()); - assertEquals(expectedDomain.getSerialNo(), domain().getSerialNo()); - assertEquals(expectedDomain.getTransactionNumber(), domain().getTransactionNumber()); - assertEquals(expectedDomain.getTransactionType(), domain().getTransactionType()); - assertEquals(expectedDomain.getCreatedBy().getId(), domain().getCreatedBy().getId()); - assertEquals(expectedDomain.getLastModifiedBy().getId(), domain().getLastModifiedBy().getId()); - assertEquals(expectedDomain.getTenantId(), domain().getTenantId()); - - } - - @Test - public void test_to_contract() { - - InstrumentContract expectedContract = instrumentMapper.toContract(domain()); - - assertEquals(expectedContract.getId(), contract().getId()); - assertEquals(expectedContract.getAmount(), contract().getAmount()); - assertEquals(expectedContract.getBank().getId(), contract().getBank().getId()); - assertEquals(expectedContract.getBankAccount().getId(), contract().getBankAccount().getId()); - assertEquals(expectedContract.getBranchName(), contract().getBranchName()); - assertEquals(expectedContract.getDrawer(), contract().getDrawer()); - assertEquals(expectedContract.getFinancialStatus().getCode(), contract().getFinancialStatus().getCode()); - assertEquals(expectedContract.getInstrumentType().getId(), contract().getInstrumentType().getId()); - assertEquals(expectedContract.getSurrenderReason().getId(), contract().getSurrenderReason().getId()); - assertEquals(expectedContract.getInstrumentVouchers().iterator().next().getInstrument(), - contract().getInstrumentVouchers().iterator().next().getInstrument()); - - assertEquals(expectedContract.getInstrumentVouchers().iterator().next().getVoucherHeaderId(), - contract().getInstrumentVouchers().iterator().next().getVoucherHeaderId()); - assertEquals(expectedContract.getPayee(), contract().getPayee()); - assertEquals(expectedContract.getSerialNo(), contract().getSerialNo()); - assertEquals(expectedContract.getTransactionNumber(), contract().getTransactionNumber()); - assertEquals(expectedContract.getTransactionType(), contract().getTransactionType()); - assertEquals(expectedContract.getCreatedBy().getId(), contract().getCreatedBy().getId()); - assertEquals(expectedContract.getLastModifiedBy().getId(), contract().getLastModifiedBy().getId()); - assertEquals(expectedContract.getTenantId(), contract().getTenantId()); - - } - - @Test - public void test_to_search_domain() { - - InstrumentSearch expectedSearchDomain = instrumentMapper.toSearchDomain(searchContract()); - - assertEquals(expectedSearchDomain.getId(), searchDomain().getId()); - assertEquals(expectedSearchDomain.getAmount(), searchDomain().getAmount()); - assertEquals(expectedSearchDomain.getBank().getId(), searchDomain().getBank().getId()); - assertEquals(expectedSearchDomain.getBankAccount().getId(), searchDomain().getBankAccount().getId()); - assertEquals(expectedSearchDomain.getBranchName(), searchDomain().getBranchName()); - assertEquals(expectedSearchDomain.getDrawer(), searchDomain().getDrawer()); - assertEquals(expectedSearchDomain.getFinancialStatus().getCode(), - searchDomain().getFinancialStatus().getCode()); - assertEquals(expectedSearchDomain.getInstrumentType().getId(), searchDomain().getInstrumentType().getId()); - assertEquals(expectedSearchDomain.getSurrenderReason().getId(), searchDomain().getSurrenderReason().getId()); - - assertEquals(expectedSearchDomain.getInstrumentVouchers().iterator().next().getVoucherHeaderId(), - searchDomain().getInstrumentVouchers().iterator().next().getVoucherHeaderId()); - assertEquals(expectedSearchDomain.getPayee(), searchDomain().getPayee()); - assertEquals(expectedSearchDomain.getSerialNo(), searchDomain().getSerialNo()); - assertEquals(expectedSearchDomain.getTransactionNumber(), searchDomain().getTransactionNumber()); - assertEquals(expectedSearchDomain.getTransactionType(), searchDomain().getTransactionType()); - assertEquals(expectedSearchDomain.getCreatedBy().getId(), searchDomain().getCreatedBy().getId()); - assertEquals(expectedSearchDomain.getLastModifiedBy().getId(), searchDomain().getLastModifiedBy().getId()); - assertEquals(expectedSearchDomain.getTenantId(), searchDomain().getTenantId()); - assertEquals(expectedSearchDomain.getPageSize(), searchDomain().getPageSize()); - assertEquals(expectedSearchDomain.getOffset(), searchDomain().getOffset()); - } - - @Test - public void test_to_search_contract() { - - InstrumentSearchContract expectedSearchContract = instrumentMapper.toSearchContract(searchDomain()); - - assertEquals(expectedSearchContract.getId(), searchContract().getId()); - assertEquals(expectedSearchContract.getAmount(), searchContract().getAmount()); - assertEquals(expectedSearchContract.getBank().getId(), searchContract().getBank().getId()); - assertEquals(expectedSearchContract.getBankAccount().getId(), searchContract().getBankAccount().getId()); - assertEquals(expectedSearchContract.getBranchName(), searchContract().getBranchName()); - assertEquals(expectedSearchContract.getDrawer(), searchContract().getDrawer()); - assertEquals(expectedSearchContract.getFinancialStatus().getCode(), - searchContract().getFinancialStatus().getCode()); - assertEquals(expectedSearchContract.getInstrumentType().getId(), searchContract().getInstrumentType().getId()); - assertEquals(expectedSearchContract.getSurrenderReason().getId(), - searchContract().getSurrenderReason().getId()); - assertEquals(expectedSearchContract.getInstrumentVouchers().iterator().next().getInstrument(), - searchContract().getInstrumentVouchers().iterator().next().getInstrument()); - - assertEquals(expectedSearchContract.getInstrumentVouchers().iterator().next().getVoucherHeaderId(), - searchContract().getInstrumentVouchers().iterator().next().getVoucherHeaderId()); - assertEquals(expectedSearchContract.getPayee(), searchContract().getPayee()); - assertEquals(expectedSearchContract.getSerialNo(), searchContract().getSerialNo()); - assertEquals(expectedSearchContract.getTransactionNumber(), searchContract().getTransactionNumber()); - assertEquals(expectedSearchContract.getTransactionType(), searchContract().getTransactionType()); - assertEquals(expectedSearchContract.getCreatedBy().getId(), searchContract().getCreatedBy().getId()); - assertEquals(expectedSearchContract.getLastModifiedBy().getId(), searchContract().getLastModifiedBy().getId()); - assertEquals(expectedSearchContract.getTenantId(), searchContract().getTenantId()); - assertEquals(expectedSearchContract.getPageSize(), searchContract().getPageSize()); - assertEquals(expectedSearchContract.getOffset(), searchContract().getOffset()); - - } - - public Instrument domain() { - - Instrument instrument = new Instrument(); - - instrument.setId("id"); - instrument.setAmount(BigDecimal.ONE); - instrument.setBank(BankContract.builder().id("id").build()); - instrument.setBankAccount(BankAccountContract.builder().id("id").build()); - instrument.setBranchName("branchName"); - instrument.setDrawer("drawer"); - instrument.setFinancialStatus(FinancialStatusContract.builder().code("code").build()); - instrument.setInstrumentType(InstrumentType.builder().id("id").build()); - instrument.setSurrenderReason(SurrenderReason.builder().id("id").build()); - - List instrumentVouchers = new ArrayList<>(); - - instrumentVouchers.add(InstrumentVoucher.builder().instrument(Instrument.builder().id("id").build()) - .voucherHeaderId("voucherHeaderId").build()); - - instrument.setInstrumentVouchers(instrumentVouchers); - - instrument.setPayee("payee"); - instrument.setSerialNo("serialNo"); - instrument.setTransactionNumber("transactionNumber"); - instrument.setTransactionType(TransactionType.Credit); - instrument.setCreatedBy(User.builder().id(1l).build()); - instrument.setLastModifiedBy(User.builder().id(1l).build()); - instrument.setTenantId("tenantId"); - - return instrument; - } - - public InstrumentContract contract() { - - InstrumentContract contract = new InstrumentContract(); - - contract.setId("id"); - contract.setAmount(BigDecimal.ONE); - contract.setBank(BankContract.builder().id("id").build()); - contract.setBankAccount(BankAccountContract.builder().id("id").build()); - contract.setBranchName("branchName"); - contract.setDrawer("drawer"); - contract.setFinancialStatus(FinancialStatusContract.builder().code("code").build()); - contract.setInstrumentType(InstrumentTypeContract.builder().id("id").build()); - contract.setSurrenderReason(SurrenderReasonContract.builder().id("id").build()); - - List instrumentVouchers = new ArrayList<>(); - - instrumentVouchers.add(InstrumentVoucherContract.builder() - .instrument("id").voucherHeaderId("voucherHeaderId").build()); - - contract.setInstrumentVouchers(instrumentVouchers); - - contract.setPayee("payee"); - contract.setSerialNo("serialNo"); - contract.setTransactionNumber("transactionNumber"); - contract.setTransactionType(TransactionTypeContract.Credit); - contract.setCreatedBy(User.builder().id(1l).build()); - contract.setLastModifiedBy(User.builder().id(1l).build()); - contract.setTenantId("tenantId"); - - return contract; - } - - public InstrumentSearch searchDomain() { - - InstrumentSearch instrumentSearch = new InstrumentSearch(); - - instrumentSearch.setId("id"); - instrumentSearch.setAmount(BigDecimal.ONE); - instrumentSearch.setBank(BankContract.builder().id("id").build()); - instrumentSearch.setBankAccount(BankAccountContract.builder().id("id").build()); - instrumentSearch.setBranchName("branchName"); - instrumentSearch.setDrawer("drawer"); - instrumentSearch.setFinancialStatus(FinancialStatusContract.builder().code("code").build()); - instrumentSearch.setInstrumentType(InstrumentType.builder().id("id").build()); - instrumentSearch.setSurrenderReason(SurrenderReason.builder().id("id").build()); - - List instrumentVouchers = new ArrayList<>(); - - instrumentVouchers.add(InstrumentVoucher.builder().instrument(Instrument.builder().id("id").build()) - .voucherHeaderId("voucherHeaderId").build()); - - instrumentSearch.setInstrumentVouchers(instrumentVouchers); - - instrumentSearch.setPayee("payee"); - instrumentSearch.setSerialNo("serialNo"); - instrumentSearch.setTransactionNumber("transactionNumber"); - instrumentSearch.setTransactionType(TransactionType.Credit); - instrumentSearch.setCreatedBy(User.builder().id(1l).build()); - instrumentSearch.setLastModifiedBy(User.builder().id(1l).build()); - instrumentSearch.setTenantId("tenantId"); - instrumentSearch.setPageSize(1); - instrumentSearch.setOffset(1); - - return instrumentSearch; - } - - public InstrumentSearchContract searchContract() { - - InstrumentSearchContract contract = new InstrumentSearchContract(); - - contract.setId("id"); - contract.setAmount(BigDecimal.ONE); - contract.setBank(BankContract.builder().id("id").build()); - contract.setBankAccount(BankAccountContract.builder().id("id").build()); - contract.setBranchName("branchName"); - contract.setDrawer("drawer"); - contract.setFinancialStatus(FinancialStatusContract.builder().code("code").build()); - contract.setInstrumentType(InstrumentTypeContract.builder().id("id").build()); - contract.setSurrenderReason(SurrenderReasonContract.builder().id("id").build()); - - List instrumentVouchers = new ArrayList<>(); - - instrumentVouchers.add(InstrumentVoucherContract.builder() - .instrument("id").voucherHeaderId("voucherHeaderId").build()); - - contract.setInstrumentVouchers(instrumentVouchers); - - contract.setPayee("payee"); - contract.setSerialNo("serialNo"); - contract.setTransactionNumber("transactionNumber"); - contract.setTransactionType(TransactionTypeContract.Credit); - contract.setCreatedBy(User.builder().id(1l).build()); - contract.setLastModifiedBy(User.builder().id(1l).build()); - contract.setTenantId("tenantId"); - contract.setPageSize(1); - contract.setOffset(1); - - return contract; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentTypeMapperTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentTypeMapperTest.java deleted file mode 100644 index b0dfd3782d1..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/InstrumentTypeMapperTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * package org.egov.egf.instrument.web.mapper; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import - * java.util.List; import org.egov.common.contract.request.User; import org.egov.egf.instrument.domain.model.InstrumentType; - * import org.egov.egf.instrument.domain.model.InstrumentTypeProperty; import - * org.egov.egf.instrument.domain.model.InstrumentTypeSearch; import org.egov.egf.instrument.domain.model.TransactionType; import - * org.egov.egf.instrument.web.contract.InstrumentTypeContract; import - * org.egov.egf.instrument.web.contract.InstrumentTypePropertyContract; import - * org.egov.egf.instrument.web.contract.InstrumentTypeSearchContract; import - * org.egov.egf.instrument.web.contract.TransactionTypeContract; import org.egov.egf.master.web.contract.FinancialStatusContract; - * import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import - * org.mockito.runners.MockitoJUnitRunner; - * @RunWith(MockitoJUnitRunner.class) public class InstrumentTypeMapperTest { - * @InjectMocks private InstrumentTypeMapper instrumentTypeMapper; - * @Before public void setup() { instrumentTypeMapper = new InstrumentTypeMapper(); } - * @Test public void test_to_domain() { InstrumentType expectedDomain = instrumentTypeMapper.toDomain(contract()); - * assertEquals(expectedDomain.getId(), domain().getId()); assertEquals(expectedDomain.getActive(), domain().getActive()); - * assertEquals(expectedDomain.getDescription(), domain().getDescription()); assertEquals(expectedDomain.getName(), - * domain().getName()); assertEquals(expectedDomain.getInstrumentTypeProperties().get(0).getId(), - * domain().getInstrumentTypeProperties().get(0).getId()); - * assertEquals(expectedDomain.getInstrumentTypeProperties().get(0).getReconciledOncreate(), - * domain().getInstrumentTypeProperties().get(0).getReconciledOncreate()); - * assertEquals(expectedDomain.getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode(), - * domain().getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode()); - * assertEquals(expectedDomain.getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode(), - * domain().getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode()); - * assertEquals(expectedDomain.getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode(), - * domain().getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode()); - * assertEquals(expectedDomain.getInstrumentTypeProperties().get(0).getTransactionType(), - * domain().getInstrumentTypeProperties().get(0).getTransactionType()); assertEquals(expectedDomain.getCreatedBy().getId(), - * domain().getCreatedBy().getId()); assertEquals(expectedDomain.getLastModifiedBy().getId(), - * domain().getLastModifiedBy().getId()); assertEquals(expectedDomain.getTenantId(), domain().getTenantId()); } - * @Test public void test_to_contract() { InstrumentTypeContract expectedContract = instrumentTypeMapper.toContract(domain()); - * assertEquals(expectedContract.getId(), contract().getId()); assertEquals(expectedContract.getActive(), contract().getActive()); - * assertEquals(expectedContract.getDescription(), contract().getDescription()); assertEquals(expectedContract.getName(), - * contract().getName()); assertEquals(expectedContract.getInstrumentTypeProperties().get(0).getId(), - * contract().getInstrumentTypeProperties().get(0).getId()); - * assertEquals(expectedContract.getInstrumentTypeProperties().get(0).getReconciledOncreate(), - * contract().getInstrumentTypeProperties().get(0).getReconciledOncreate()); - * assertEquals(expectedContract.getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode(), - * contract().getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode()); - * assertEquals(expectedContract.getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode(), - * contract().getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode()); - * assertEquals(expectedContract.getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode(), - * contract().getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode()); - * assertEquals(expectedContract.getInstrumentTypeProperties().get(0).getTransactionType(), - * contract().getInstrumentTypeProperties().get(0).getTransactionType()); assertEquals(expectedContract.getCreatedBy().getId(), - * contract().getCreatedBy().getId()); assertEquals(expectedContract.getLastModifiedBy().getId(), - * contract().getLastModifiedBy().getId()); assertEquals(expectedContract.getTenantId(), contract().getTenantId()); } - * @Test public void test_to_search_domain() { InstrumentTypeSearch expectedSearchDomain = - * instrumentTypeMapper.toSearchDomain(searchContract()); assertEquals(expectedSearchDomain.getId(), searchDomain().getId()); - * assertEquals(expectedSearchDomain.getActive(), searchDomain().getActive()); assertEquals(expectedSearchDomain.getDescription(), - * searchDomain().getDescription()); assertEquals(expectedSearchDomain.getName(), searchDomain().getName()); - * assertEquals(expectedSearchDomain.getInstrumentTypeProperties().get(0).getId(), - * searchDomain().getInstrumentTypeProperties().get(0).getId()); - * assertEquals(expectedSearchDomain.getInstrumentTypeProperties().get(0).getReconciledOncreate(), - * searchDomain().getInstrumentTypeProperties().get(0).getReconciledOncreate()); - * assertEquals(expectedSearchDomain.getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode(), - * searchDomain().getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode()); - * assertEquals(expectedSearchDomain.getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode(), - * searchDomain().getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode()); - * assertEquals(expectedSearchDomain.getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode(), - * searchDomain().getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode()); - * assertEquals(expectedSearchDomain.getInstrumentTypeProperties().get(0).getTransactionType(), - * searchDomain().getInstrumentTypeProperties().get(0).getTransactionType()); - * assertEquals(expectedSearchDomain.getCreatedBy().getId(), searchDomain().getCreatedBy().getId()); - * assertEquals(expectedSearchDomain.getLastModifiedBy().getId(), searchDomain().getLastModifiedBy().getId()); - * assertEquals(expectedSearchDomain.getTenantId(), searchDomain().getTenantId()); - * assertEquals(expectedSearchDomain.getPageSize(), searchDomain().getPageSize()); assertEquals(expectedSearchDomain.getOffset(), - * searchDomain().getOffset()); } - * @Test public void test_to_search_contract() { InstrumentTypeSearchContract expectedSearchContract = - * instrumentTypeMapper.toSearchContract(searchDomain()); assertEquals(expectedSearchContract.getId(), searchContract().getId()); - * assertEquals(expectedSearchContract.getActive(), searchContract().getActive()); - * assertEquals(expectedSearchContract.getDescription(), searchContract().getDescription()); - * assertEquals(expectedSearchContract.getName(), searchContract().getName()); - * assertEquals(expectedSearchContract.getInstrumentTypeProperties().get(0).getId(), - * searchContract().getInstrumentTypeProperties().get(0).getId()); - * assertEquals(expectedSearchContract.getInstrumentTypeProperties().get(0).getReconciledOncreate(), - * searchContract().getInstrumentTypeProperties().get(0).getReconciledOncreate()); - * assertEquals(expectedSearchContract.getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode(), - * searchContract().getInstrumentTypeProperties().get(0).getStatusOnCreate().getCode()); - * assertEquals(expectedSearchContract.getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode(), - * searchContract().getInstrumentTypeProperties().get(0).getStatusOnReconcile().getCode()); - * assertEquals(expectedSearchContract.getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode(), - * searchContract().getInstrumentTypeProperties().get(0).getStatusOnUpdate().getCode()); - * assertEquals(expectedSearchContract.getInstrumentTypeProperties().get(0).getTransactionType(), - * searchContract().getInstrumentTypeProperties().get(0).getTransactionType()); - * assertEquals(expectedSearchContract.getCreatedBy().getId(), searchContract().getCreatedBy().getId()); - * assertEquals(expectedSearchContract.getLastModifiedBy().getId(), searchContract().getLastModifiedBy().getId()); - * assertEquals(expectedSearchContract.getTenantId(), searchContract().getTenantId()); - * assertEquals(expectedSearchContract.getPageSize(), searchContract().getPageSize()); - * assertEquals(expectedSearchContract.getOffset(), searchContract().getOffset()); } public InstrumentType domain() { - * InstrumentType instrumentType = new InstrumentType(); instrumentType.setId("id"); instrumentType.setActive(true); - * instrumentType.setDescription("description"); instrumentType.setName("name"); List - * instrumentTypeProperties = new ArrayList<>(); - * instrumentTypeProperties.add(InstrumentTypeProperty.builder().id("id").reconciledOncreate(true) - * .statusOnCreate(FinancialStatusContract.builder().code("Create").build()) - * .statusOnReconcile(FinancialStatusContract.builder().code("Reconcile").build()) - * .statusOnUpdate(FinancialStatusContract.builder().code("Update").build()) .transactionType(TransactionType.Credit).build()); - * instrumentType.setInstrumentTypeProperties(instrumentTypeProperties); - * instrumentType.setCreatedBy(User.builder().id(1l).build()); instrumentType.setLastModifiedBy(User.builder().id(1l).build()); - * instrumentType.setTenantId("tenantId"); return instrumentType; } public InstrumentTypeContract contract() { - * InstrumentTypeContract contract = new InstrumentTypeContract(); contract.setId("id"); contract.setActive(true); - * contract.setDescription("description"); contract.setName("name"); List instrumentTypeProperties - * = new ArrayList<>(); instrumentTypeProperties.add(InstrumentTypePropertyContract.builder().id("id").reconciledOncreate(true) - * .statusOnCreate(FinancialStatusContract.builder().code("Create").build()) - * .statusOnReconcile(FinancialStatusContract.builder().code("Reconcile").build()) - * .statusOnUpdate(FinancialStatusContract.builder().code("Update").build()) - * .transactionType(TransactionTypeContract.Credit).build()); contract.setInstrumentTypeProperties(instrumentTypeProperties); - * contract.setCreatedBy(User.builder().id(1l).build()); contract.setLastModifiedBy(User.builder().id(1l).build()); - * contract.setTenantId("tenantId"); return contract; } public InstrumentTypeSearch searchDomain() { InstrumentTypeSearch - * instrumentTypeSearch = new InstrumentTypeSearch(); instrumentTypeSearch.setId("id"); instrumentTypeSearch.setActive(true); - * instrumentTypeSearch.setDescription("description"); instrumentTypeSearch.setName("name"); List - * instrumentTypeProperties = new ArrayList<>(); - * instrumentTypeProperties.add(InstrumentTypeProperty.builder().id("id").reconciledOncreate(true) - * .statusOnCreate(FinancialStatusContract.builder().code("Create").build()) - * .statusOnReconcile(FinancialStatusContract.builder().code("Reconcile").build()) - * .statusOnUpdate(FinancialStatusContract.builder().code("Update").build()) .transactionType(TransactionType.Credit).build()); - * instrumentTypeSearch.setInstrumentTypeProperties(instrumentTypeProperties); - * instrumentTypeSearch.setCreatedBy(User.builder().id(1l).build()); - * instrumentTypeSearch.setLastModifiedBy(User.builder().id(1l).build()); instrumentTypeSearch.setTenantId("tenantId"); - * instrumentTypeSearch.setPageSize(1); instrumentTypeSearch.setOffset(1); return instrumentTypeSearch; } public - * InstrumentTypeSearchContract searchContract() { InstrumentTypeSearchContract contract = new InstrumentTypeSearchContract(); - * contract.setId("id"); contract.setActive(true); contract.setDescription("description"); contract.setName("name"); - * List instrumentTypeProperties = new ArrayList<>(); - * instrumentTypeProperties.add(InstrumentTypePropertyContract.builder().id("id").reconciledOncreate(true) - * .statusOnCreate(FinancialStatusContract.builder().code("Create").build()) - * .statusOnReconcile(FinancialStatusContract.builder().code("Reconcile").build()) - * .statusOnUpdate(FinancialStatusContract.builder().code("Update").build()) - * .transactionType(TransactionTypeContract.Credit).build()); contract.setInstrumentTypeProperties(instrumentTypeProperties); - * contract.setCreatedBy(User.builder().id(1l).build()); contract.setLastModifiedBy(User.builder().id(1l).build()); - * contract.setTenantId("tenantId"); contract.setPageSize(1); contract.setOffset(1); return contract; } } - */ \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/SurrenderReasonMapperTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/SurrenderReasonMapperTest.java deleted file mode 100644 index 16ca711f825..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/mapper/SurrenderReasonMapperTest.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.egov.egf.instrument.web.mapper; - -import static org.junit.Assert.assertEquals; - -import org.egov.common.contract.request.User; -import org.egov.egf.instrument.domain.model.SurrenderReason; -import org.egov.egf.instrument.domain.model.SurrenderReasonSearch; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.egov.egf.instrument.web.contract.SurrenderReasonSearchContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class SurrenderReasonMapperTest { - - @InjectMocks - private SurrenderReasonMapper surrenderReasonMapper; - - @Before - public void setup() { - surrenderReasonMapper = new SurrenderReasonMapper(); - } - - @Test - public void test_to_domain() { - - SurrenderReason expectedDomain = surrenderReasonMapper.toDomain(contract()); - - assertEquals(expectedDomain.getId(), domain().getId()); - assertEquals(expectedDomain.getDescription(), domain().getDescription()); - assertEquals(expectedDomain.getName(), domain().getName()); - assertEquals(expectedDomain.getCreatedBy().getId(), domain().getCreatedBy().getId()); - assertEquals(expectedDomain.getLastModifiedBy().getId(), domain().getLastModifiedBy().getId()); - assertEquals(expectedDomain.getTenantId(), domain().getTenantId()); - - } - - @Test - public void test_to_contract() { - - SurrenderReasonContract expectedContract = surrenderReasonMapper.toContract(domain()); - - assertEquals(expectedContract.getId(), contract().getId()); - assertEquals(expectedContract.getDescription(), contract().getDescription()); - assertEquals(expectedContract.getName(), contract().getName()); - assertEquals(expectedContract.getCreatedBy().getId(), contract().getCreatedBy().getId()); - assertEquals(expectedContract.getLastModifiedBy().getId(), contract().getLastModifiedBy().getId()); - assertEquals(expectedContract.getTenantId(), contract().getTenantId()); - - } - - @Test - public void test_to_search_domain() { - - SurrenderReasonSearch expectedSearchDomain = surrenderReasonMapper.toSearchDomain(searchContract()); - - assertEquals(expectedSearchDomain.getId(), searchDomain().getId()); - assertEquals(expectedSearchDomain.getDescription(), searchDomain().getDescription()); - assertEquals(expectedSearchDomain.getName(), searchDomain().getName()); - assertEquals(expectedSearchDomain.getCreatedBy().getId(), searchDomain().getCreatedBy().getId()); - assertEquals(expectedSearchDomain.getLastModifiedBy().getId(), searchDomain().getLastModifiedBy().getId()); - assertEquals(expectedSearchDomain.getTenantId(), searchDomain().getTenantId()); - assertEquals(expectedSearchDomain.getPageSize(), searchDomain().getPageSize()); - assertEquals(expectedSearchDomain.getOffset(), searchDomain().getOffset()); - } - - @Test - public void test_to_search_contract() { - - SurrenderReasonSearchContract expectedSearchContract = surrenderReasonMapper.toSearchContract(searchDomain()); - - assertEquals(expectedSearchContract.getId(), searchContract().getId()); - assertEquals(expectedSearchContract.getDescription(), searchContract().getDescription()); - assertEquals(expectedSearchContract.getName(), searchContract().getName()); - assertEquals(expectedSearchContract.getCreatedBy().getId(), searchContract().getCreatedBy().getId()); - assertEquals(expectedSearchContract.getLastModifiedBy().getId(), searchContract().getLastModifiedBy().getId()); - assertEquals(expectedSearchContract.getTenantId(), searchContract().getTenantId()); - assertEquals(expectedSearchContract.getPageSize(), searchContract().getPageSize()); - assertEquals(expectedSearchContract.getOffset(), searchContract().getOffset()); - - } - - public SurrenderReason domain() { - - SurrenderReason surrenderReason = new SurrenderReason(); - - surrenderReason.setId("id"); - surrenderReason.setDescription("description"); - surrenderReason.setName("name"); - surrenderReason.setCreatedBy(User.builder().id(1l).build()); - surrenderReason.setLastModifiedBy(User.builder().id(1l).build()); - surrenderReason.setTenantId("tenantId"); - - return surrenderReason; - } - - public SurrenderReasonContract contract() { - - SurrenderReasonContract contract = new SurrenderReasonContract(); - - contract.setId("id"); - contract.setDescription("description"); - contract.setName("name"); - contract.setCreatedBy(User.builder().id(1l).build()); - contract.setLastModifiedBy(User.builder().id(1l).build()); - contract.setTenantId("tenantId"); - - return contract; - } - - public SurrenderReasonSearch searchDomain() { - - SurrenderReasonSearch surrenderReasonSearch = new SurrenderReasonSearch(); - - surrenderReasonSearch.setId("id"); - surrenderReasonSearch.setDescription("description"); - surrenderReasonSearch.setName("name"); - surrenderReasonSearch.setCreatedBy(User.builder().id(1l).build()); - surrenderReasonSearch.setLastModifiedBy(User.builder().id(1l).build()); - surrenderReasonSearch.setTenantId("tenantId"); - surrenderReasonSearch.setPageSize(1); - surrenderReasonSearch.setOffset(1); - - return surrenderReasonSearch; - } - - public SurrenderReasonSearchContract searchContract() { - - SurrenderReasonSearchContract contract = new SurrenderReasonSearchContract(); - - contract.setId("id"); - contract.setDescription("description"); - contract.setName("name"); - contract.setCreatedBy(User.builder().id(1l).build()); - contract.setLastModifiedBy(User.builder().id(1l).build()); - contract.setTenantId("tenantId"); - contract.setPageSize(1); - contract.setOffset(1); - - return contract; - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentAccountCodeContractRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentAccountCodeContractRepositoryTest.java deleted file mode 100644 index 386c3db6a7a..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentAccountCodeContractRepositoryTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import static org.junit.Assert.assertEquals; -import static org.springframework.test.web.client.ExpectedCount.once; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; - -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.contract.InstrumentAccountCodeContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.test.web.client.MockRestServiceServer; -import org.springframework.web.client.RestTemplate; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentAccountCodeContractRepositoryTest { - - private InstrumentAccountCodeContractRepository instrumentAccountCodeContractRepository; - - private static final String HOST = "http://host"; - - private MockRestServiceServer server; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Before - public void setup() { - final RestTemplate restTemplate = new RestTemplate(); - instrumentAccountCodeContractRepository = new InstrumentAccountCodeContractRepository(HOST, restTemplate); - server = MockRestServiceServer.bindTo(restTemplate).build(); - } - - @Test - public void test_find_by_id() throws Exception { - - server.expect(once(), - requestTo("http://host/egf-instrument/instrumentaccountcodes/_search?id=1&tenantId=default")) - .andExpect(method(HttpMethod.POST)) - .andRespond(withSuccess(resources.getFileContents("instrumentaccountcode/search_by_id_response.json"), - MediaType.APPLICATION_JSON_UTF8)); - - InstrumentAccountCodeContract instrumentAccountCodeContract = new InstrumentAccountCodeContract(); - - instrumentAccountCodeContract.setId("1"); - instrumentAccountCodeContract.setTenantId("default"); - - final InstrumentAccountCodeContract response = instrumentAccountCodeContractRepository - .findById(instrumentAccountCodeContract); - - server.verify(); - - assertEquals("1", response.getId()); - assertEquals("default", response.getTenantId()); - - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentContractRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentContractRepositoryTest.java deleted file mode 100644 index ad92c09e027..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentContractRepositoryTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import static org.junit.Assert.assertEquals; -import static org.springframework.test.web.client.ExpectedCount.once; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; - -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.contract.InstrumentContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.test.web.client.MockRestServiceServer; -import org.springframework.web.client.RestTemplate; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentContractRepositoryTest { - - private InstrumentContractRepository instrumentContractRepository; - - private static final String HOST = "http://host"; - - private MockRestServiceServer server; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Before - public void setup() { - final RestTemplate restTemplate = new RestTemplate(); - instrumentContractRepository = new InstrumentContractRepository(HOST, restTemplate); - server = MockRestServiceServer.bindTo(restTemplate).build(); - } - - @Test - public void test_find_by_id() throws Exception { - - server.expect(once(), requestTo("http://host/egf-instrument/instruments/_search?id=1&tenantId=default")) - .andExpect(method(HttpMethod.POST)) - .andRespond(withSuccess(resources.getFileContents("instrument/search_by_id_response.json"), - MediaType.APPLICATION_JSON_UTF8)); - - InstrumentContract instrumentContract = new InstrumentContract(); - - instrumentContract.setId("1"); - instrumentContract.setTenantId("default"); - - final InstrumentContract response = instrumentContractRepository.findById(instrumentContract); - - server.verify(); - - assertEquals("1", response.getId()); - assertEquals("default", response.getTenantId()); - - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentTypeContractRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentTypeContractRepositoryTest.java deleted file mode 100644 index bb3786ed078..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/InstrumentTypeContractRepositoryTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import static org.junit.Assert.assertEquals; -import static org.springframework.test.web.client.ExpectedCount.once; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; - -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.contract.InstrumentTypeContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.test.web.client.MockRestServiceServer; -import org.springframework.web.client.RestTemplate; - -@RunWith(MockitoJUnitRunner.class) -public class InstrumentTypeContractRepositoryTest { - - private InstrumentTypeContractRepository instrumentTypeContractRepository; - - private static final String HOST = "http://host"; - - private MockRestServiceServer server; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Before - public void setup() { - final RestTemplate restTemplate = new RestTemplate(); - instrumentTypeContractRepository = new InstrumentTypeContractRepository(HOST, restTemplate); - server = MockRestServiceServer.bindTo(restTemplate).build(); - } - - @Test - public void test_find_by_id() throws Exception { - - server.expect(once(), requestTo("http://host/egf-instrument/instrumenttypes/_search?id=1&tenantId=default")) - .andExpect(method(HttpMethod.POST)) - .andRespond(withSuccess(resources.getFileContents("instrumenttype/search_by_id_response.json"), - MediaType.APPLICATION_JSON_UTF8)); - - InstrumentTypeContract instrumentTypeContract = new InstrumentTypeContract(); - - instrumentTypeContract.setId("1"); - instrumentTypeContract.setTenantId("default"); - - final InstrumentTypeContract response = instrumentTypeContractRepository.findById(instrumentTypeContract); - - server.verify(); - - assertEquals("1", response.getId()); - assertEquals("default", response.getTenantId()); - - } - -} diff --git a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/SurrenderReasonContractRepositoryTest.java b/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/SurrenderReasonContractRepositoryTest.java deleted file mode 100644 index 68af73b98b7..00000000000 --- a/business-services/egf-instrument/src/test/java/org/egov/egf/instrument/web/repository/SurrenderReasonContractRepositoryTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.egov.egf.instrument.web.repository; - -import static org.junit.Assert.assertEquals; -import static org.springframework.test.web.client.ExpectedCount.once; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; -import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; - -import org.egov.egf.instrument.utils.RequestJsonReader; -import org.egov.egf.instrument.web.contract.SurrenderReasonContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.test.web.client.MockRestServiceServer; -import org.springframework.web.client.RestTemplate; - -@RunWith(MockitoJUnitRunner.class) -public class SurrenderReasonContractRepositoryTest { - - private SurrenderReasonContractRepository surrenderReasonContractRepository; - - private static final String HOST = "http://host"; - - private MockRestServiceServer server; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Before - public void setup() { - final RestTemplate restTemplate = new RestTemplate(); - surrenderReasonContractRepository = new SurrenderReasonContractRepository(HOST, restTemplate); - server = MockRestServiceServer.bindTo(restTemplate).build(); - } - - @Test - public void test_find_by_id() throws Exception { - - server.expect(once(), requestTo("http://host/egf-instrument/surrenderreasons/_search?id=1&tenantId=default")) - .andExpect(method(HttpMethod.POST)) - .andRespond(withSuccess(resources.getFileContents("surrenderreason/search_by_id_response.json"), - MediaType.APPLICATION_JSON_UTF8)); - - SurrenderReasonContract surrenderReasonContract = new SurrenderReasonContract(); - - surrenderReasonContract.setId("1"); - surrenderReasonContract.setTenantId("default"); - - final SurrenderReasonContract response = surrenderReasonContractRepository.findById(surrenderReasonContract); - - server.verify(); - - assertEquals("1", response.getId()); - assertEquals("default", response.getTenantId()); - - } - -} diff --git a/business-services/egf-instrument/src/test/resources/application.properties b/business-services/egf-instrument/src/test/resources/application.properties deleted file mode 100644 index e8c1136c21b..00000000000 --- a/business-services/egf-instrument/src/test/resources/application.properties +++ /dev/null @@ -1,67 +0,0 @@ -persist.through.kafka=yes - -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres -spring.datasource.username=postgres -spring.datasource.password=postgres - -flyway.enabled=true -flyway.user=postgres -flyway.password=postgres -flyway.outOfOrder=true -flyway.table=egf_instrument_schema_version -flyway.baseline-on-migrate=true -flyway.url=jdbc:postgresql://localhost:5432/postgres -#flyway.locations=db/migration/main,db/migration/seed - -spring.jpa.showSql=true -spring.jpa.database=POSTGRESQL -spring.data.jpa.repositories.enabled=true -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl -spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl -spring.jpa.open-in-view=true - -app.timezone=UTC - -fetch_data_from=db - -es.host=localhost -es.transport.port=9300 -es.cluster.name=docker-cluster -es.fund.index.name=fund -es.fund.document.type=fund - -#Kafka Topic config - -#Kafka Topic config - -kafka.topics.egf.instrument.validated.topic=egov.egf.instrument.validated.topic -kafka.topics.egf.instrument.validated.group=egov.egf.instrument.validated.group -kafka.topics.egf.instrument.validated.id=egov.egf.instrument.validated.id - -kafka.topics.egf.instrument.completed.topic=egov.egf.instrument.completed -kafka.topics.egf.instrument.completed.group=egov.egf.instrument.completed.group - -kafka.topics.egf.instrument.instrument.accountcode.validated.key=egov.egf.instrument.instrument.accountcode.validated.key -kafka.topics.egf.instrument.instrument.validated.key=egov.egf.instrument.budgetdetail.validated.key -kafka.topics.egf.instrument.instrument.type.validated.key=egov.egf.instrument.budgetreapp.validated.key -kafka.topics.egf.instrument.surrender.reason.validated.key=egov.egf.instrument.surrender.reason.validated.key - -kafka.topics.egf.instrument.instrument.accountcode.completed.key=egov.egf.instrument.instrument.accountcode.completed.key -kafka.topics.egf.instrument.instrument.completed.key=egov.egf.instrument.instrument.completed.key -kafka.topics.egf.instrument.instrument.type.completed.key=egov.egf.instrument.instrument.type.completed.key -kafka.topics.egf.instrument.surrender.reason.completed.key=egov.egf.instrument.surrender.reason.completed.key - - -egf.instrument.host.url=http://localhost:8480 - -egf.master.host.url=http://localhost:8280 - -logging.pattern.console=%clr(%X{CORRELATION_ID:-}) %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} - - -spring.kafka.consumer.value-deserializer=org.egov.common.queue.HashMapDeserializer -spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.group-id=egf-instrument -spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/common/error_info.json b/business-services/egf-instrument/src/test/resources/common/error_info.json deleted file mode 100644 index 4fb97d8c4f3..00000000000 --- a/business-services/egf-instrument/src/test/resources/common/error_info.json +++ /dev/null @@ -1,8 +0,0 @@ -"responseInfo": { - "resMsgId": null, - "status": 400, - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - } \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/common/error_response.json b/business-services/egf-instrument/src/test/resources/common/error_response.json deleted file mode 100644 index d7f6995f428..00000000000 --- a/business-services/egf-instrument/src/test/resources/common/error_response.json +++ /dev/null @@ -1,7 +0,0 @@ -"error": - { - "code":null, - "message":"sample", - "description":"sample", - "filelds":[] - } \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/common/request_info.json b/business-services/egf-instrument/src/test/resources/common/request_info.json deleted file mode 100644 index f01cf8c2d0d..00000000000 --- a/business-services/egf-instrument/src/test/resources/common/request_info.json +++ /dev/null @@ -1,8 +0,0 @@ -"requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - } \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/common/response_info.json b/business-services/egf-instrument/src/test/resources/common/response_info.json deleted file mode 100644 index 04cae36133a..00000000000 --- a/business-services/egf-instrument/src/test/resources/common/response_info.json +++ /dev/null @@ -1,6 +0,0 @@ -"responseInfo": { - "resMsgId": "placeholder", - "status": "placeholder", - "apiId": null, - "ver": null - } \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_create_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_create_invalid_field_value.json deleted file mode 100644 index dfd58573342..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_create_invalid_field_value.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "instruments": [ - { - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_create_valid_request.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_create_valid_request.json deleted file mode 100644 index 0be77194021..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_create_valid_request.json +++ /dev/null @@ -1,15 +0,0 @@ -"instruments": [ - { - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_create_valid_response.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_create_valid_response.json deleted file mode 100644 index caf4a37474f..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_create_valid_response.json +++ /dev/null @@ -1,16 +0,0 @@ -"instruments": [ - { - "id": null, - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_invalid_field_value.json deleted file mode 100644 index dfd58573342..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_invalid_field_value.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "instruments": [ - { - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_valid_request.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_valid_request.json deleted file mode 100644 index b9ba4ace559..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_valid_request.json +++ /dev/null @@ -1,16 +0,0 @@ -"instruments": [ - { - "id":"1", - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_valid_response.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_valid_response.json deleted file mode 100644 index b9ba4ace559..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_delete_valid_response.json +++ /dev/null @@ -1,16 +0,0 @@ -"instruments": [ - { - "id":"1", - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_deposit_valid_request.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_deposit_valid_request.json deleted file mode 100644 index 17bfe00e94c..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_deposit_valid_request.json +++ /dev/null @@ -1,8 +0,0 @@ -"instruments": [ - { - "id": "726bb79942b24a75815fc11172cef45e", - "remittanceVoucherId":"anonymousbarath", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_deposit_valid_response.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_deposit_valid_response.json deleted file mode 100644 index 9ef52065f08..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_deposit_valid_response.json +++ /dev/null @@ -1,15 +0,0 @@ - "instruments": [ - { - "id": "726bb79942b24a75815fc11172cef45e", - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType": "Debit", - "financialStatus": { - "id": "a167095b-5a73-4e61-b489-af31f053c4e1", - "moduleType": "Instrument", - "code": "Deposited" - }, - "serialNo":"serialNo", - "tenantId": "default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_dishonor_valid_request.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_dishonor_valid_request.json deleted file mode 100644 index 17bfe00e94c..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_dishonor_valid_request.json +++ /dev/null @@ -1,8 +0,0 @@ -"instruments": [ - { - "id": "726bb79942b24a75815fc11172cef45e", - "remittanceVoucherId":"anonymousbarath", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_dishonor_valid_response.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_dishonor_valid_response.json deleted file mode 100644 index 9ef52065f08..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_dishonor_valid_response.json +++ /dev/null @@ -1,15 +0,0 @@ - "instruments": [ - { - "id": "726bb79942b24a75815fc11172cef45e", - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType": "Debit", - "financialStatus": { - "id": "a167095b-5a73-4e61-b489-af31f053c4e1", - "moduleType": "Instrument", - "code": "Deposited" - }, - "serialNo":"serialNo", - "tenantId": "default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_search_valid_response.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_search_valid_response.json deleted file mode 100644 index 4e281be9e83..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_search_valid_response.json +++ /dev/null @@ -1,25 +0,0 @@ -"instruments": [ - { - "id":"1", - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } - \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_update_valid_request.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_update_valid_request.json deleted file mode 100644 index b9ba4ace559..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_update_valid_request.json +++ /dev/null @@ -1,16 +0,0 @@ -"instruments": [ - { - "id":"1", - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/instrument_update_valid_response.json b/business-services/egf-instrument/src/test/resources/instrument/instrument_update_valid_response.json deleted file mode 100644 index b9ba4ace559..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/instrument_update_valid_response.json +++ /dev/null @@ -1,16 +0,0 @@ -"instruments": [ - { - "id":"1", - "transactionNumber": "transactionNumber", - "amount": 1, - "transactionType":"Credit", - "instrumentType": - { - "name":"instrumenttype" - } - , - "serialNo":"serialNo", - "tenantId": "default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrument/search_by_id_response.json b/business-services/egf-instrument/src/test/resources/instrument/search_by_id_response.json deleted file mode 100644 index fdb245febbd..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrument/search_by_id_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "responseInfo": { - "resMsgId": "placeholder", - "status": "placeholder", - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - }, - "instruments": - [ - { - "id": "1", - "tenantId": "default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_invalid_field_value.json deleted file mode 100644 index 8f1d877025d..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_invalid_field_value.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "instrumentAccountCodes": [ - { - "instrumentType":{ - "name":"instrumenttype" - }, - "accountCode":{ - "glcode":"glcode" - }, - "tenantId":"default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_valid_request.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_valid_request.json deleted file mode 100644 index ee1743533bb..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_valid_request.json +++ /dev/null @@ -1,12 +0,0 @@ -"instrumentAccountCodes": [ - { - "instrumentType":{ - "name":"instrumenttype" - }, - "accountCode":{ - "glcode":"glcode" - }, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_valid_response.json deleted file mode 100644 index ce48cbca30a..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_create_valid_response.json +++ /dev/null @@ -1,12 +0,0 @@ -"instrumentAccountCodes": [ - { - "id": null, - "instrumentType": { - "name": "instrumenttype" - }, - "accountCode": { - "glcode":"glcode" - }, - "tenantId": "default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_invalid_field_value.json deleted file mode 100644 index 8f1d877025d..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_invalid_field_value.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "instrumentAccountCodes": [ - { - "instrumentType":{ - "name":"instrumenttype" - }, - "accountCode":{ - "glcode":"glcode" - }, - "tenantId":"default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_valid_request.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_valid_request.json deleted file mode 100644 index 5926c40d252..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_valid_request.json +++ /dev/null @@ -1,13 +0,0 @@ -"instrumentAccountCodes": [ - { - "id":"1", - "instrumentType":{ - "name":"instrumenttype" - }, - "accountCode":{ - "glcode":"glcode" - }, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_valid_response.json deleted file mode 100644 index a076804cab1..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_delete_valid_response.json +++ /dev/null @@ -1,12 +0,0 @@ -"instrumentAccountCodes": [ - { - "id":"1", - "instrumentType": { - "name": "instrumenttype" - }, - "accountCode": { - "glcode":"glcode" - }, - "tenantId": "default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_search_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_search_valid_response.json deleted file mode 100644 index 58481763a55..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_search_valid_response.json +++ /dev/null @@ -1,21 +0,0 @@ -"instrumentAccountCodes": [ - { - "instrumentType":{ - "name":"instrumenttype" - }, - "accountCode":{ - "glcode":"glcode" - }, - "tenantId":"default" - } - - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } - \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_update_valid_request.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_update_valid_request.json deleted file mode 100644 index 5926c40d252..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_update_valid_request.json +++ /dev/null @@ -1,13 +0,0 @@ -"instrumentAccountCodes": [ - { - "id":"1", - "instrumentType":{ - "name":"instrumenttype" - }, - "accountCode":{ - "glcode":"glcode" - }, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_update_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_update_valid_response.json deleted file mode 100644 index a076804cab1..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/instrumentaccountcode_update_valid_response.json +++ /dev/null @@ -1,12 +0,0 @@ -"instrumentAccountCodes": [ - { - "id":"1", - "instrumentType": { - "name": "instrumenttype" - }, - "accountCode": { - "glcode":"glcode" - }, - "tenantId": "default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/search_by_id_response.json b/business-services/egf-instrument/src/test/resources/instrumentaccountcode/search_by_id_response.json deleted file mode 100644 index f7266c05646..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumentaccountcode/search_by_id_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "responseInfo": { - "resMsgId": "placeholder", - "status": "placeholder", - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - }, - "instrumentAccountCodes": - [ - { - "id": "1", - "tenantId": "default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_invalid_field_value.json deleted file mode 100644 index 8cf8f6dc9fb..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_invalid_field_value.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "instrumentTypes": [ - { - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_valid_request.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_valid_request.json deleted file mode 100644 index b21bbe2f452..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_valid_request.json +++ /dev/null @@ -1,9 +0,0 @@ -"instrumentTypes": [ - { - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_valid_response.json deleted file mode 100644 index 351e2ce8600..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_create_valid_response.json +++ /dev/null @@ -1,10 +0,0 @@ -"instrumentTypes": [ - { - "id": null, - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_invalid_field_value.json deleted file mode 100644 index 8cf8f6dc9fb..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_invalid_field_value.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "instrumentTypes": [ - { - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_valid_request.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_valid_request.json deleted file mode 100644 index 6adf60383e1..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_valid_request.json +++ /dev/null @@ -1,10 +0,0 @@ -"instrumentTypes": [ - { - "id":"1", - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_valid_response.json deleted file mode 100644 index 6adf60383e1..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_delete_valid_response.json +++ /dev/null @@ -1,10 +0,0 @@ -"instrumentTypes": [ - { - "id":"1", - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_search_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_search_valid_response.json deleted file mode 100644 index abf060354fb..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_search_valid_response.json +++ /dev/null @@ -1,18 +0,0 @@ -"instrumentTypes": [ - { - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } - \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_update_valid_request.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_update_valid_request.json deleted file mode 100644 index 6adf60383e1..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_update_valid_request.json +++ /dev/null @@ -1,10 +0,0 @@ -"instrumentTypes": [ - { - "id":"1", - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_update_valid_response.json b/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_update_valid_response.json deleted file mode 100644 index 6adf60383e1..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/instrumenttype_update_valid_response.json +++ /dev/null @@ -1,10 +0,0 @@ -"instrumentTypes": [ - { - "id":"1", - "name":"name", - "description":"description", - "active":true, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/instrumenttype/search_by_id_response.json b/business-services/egf-instrument/src/test/resources/instrumenttype/search_by_id_response.json deleted file mode 100644 index 184fcc4ec7b..00000000000 --- a/business-services/egf-instrument/src/test/resources/instrumenttype/search_by_id_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "responseInfo": { - "resMsgId": "placeholder", - "status": "placeholder", - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - }, - "instrumentTypes": - [ - { - "id": "1", - "tenantId": "default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrument/clearInstrument.sql b/business-services/egf-instrument/src/test/resources/sql/instrument/clearInstrument.sql deleted file mode 100644 index a86d6b48ca1..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrument/clearInstrument.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_instrument; \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrument/insertInstrumentData.sql b/business-services/egf-instrument/src/test/resources/sql/instrument/insertInstrumentData.sql deleted file mode 100644 index c09ac5398e3..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrument/insertInstrumentData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_instrument (id,transactionDate,transactionNumber,amount,instrumentTypeId,bankId,branchName,bankAccountId,financialStatusId,remittanceVoucherId,transactionType,payee,drawer,surrenderReasonId,serialNo,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('1','07-27-2017','transactionNumber',1,'name','code','branchName','accountNumber','1','1','Credit','payee','drawer','1','serialNo',1,now(),1,now(),'default'); \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumentaccountcode/clearInstrumentAccountCode.sql b/business-services/egf-instrument/src/test/resources/sql/instrumentaccountcode/clearInstrumentAccountCode.sql deleted file mode 100644 index 51048ac501c..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumentaccountcode/clearInstrumentAccountCode.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_instrumentaccountcode; \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql b/business-services/egf-instrument/src/test/resources/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql deleted file mode 100644 index 96834537929..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumentaccountcode/insertInstrumentAccountCodeData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_instrumentaccountcode (id,instrumentTypeId,accountCodeId,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('1','name','glcode',1,now(),1,now(),'default'); \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumenttype/clearInstrumentType.sql b/business-services/egf-instrument/src/test/resources/sql/instrumenttype/clearInstrumentType.sql deleted file mode 100644 index 106c0d8573f..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumenttype/clearInstrumentType.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_instrumenttype; \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumenttype/insertInstrumentTypeData.sql b/business-services/egf-instrument/src/test/resources/sql/instrumenttype/insertInstrumentTypeData.sql deleted file mode 100644 index a7cd50cb1d9..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumenttype/insertInstrumentTypeData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_instrumenttype (id,name,description,active,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('1','name','description',true,1,now(),1,now(),'default'); \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql b/business-services/egf-instrument/src/test/resources/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql deleted file mode 100644 index 47b8ec06e7c..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumenttypeproperty/clearInstrumentTypeProperty.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_instrumenttypeproperty; \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql b/business-services/egf-instrument/src/test/resources/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql deleted file mode 100644 index 2914cd856d1..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumenttypeproperty/insertInstrumentTypePropertyData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_instrumenttypeproperty (id,transactionType,reconciledOncreate,statusOnCreateId,statusOnUpdateId,statusOnReconcileId,instrumentTypeId,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('1','Credit',true,'created','updated','reconciled','1',1,now(),1,now(),'default'); \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumentvoucher/clearInstrumentVoucher.sql b/business-services/egf-instrument/src/test/resources/sql/instrumentvoucher/clearInstrumentVoucher.sql deleted file mode 100644 index 89896c95f90..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumentvoucher/clearInstrumentVoucher.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_instrumentvoucher; \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/instrumentvoucher/insertInstrumentVoucherData.sql b/business-services/egf-instrument/src/test/resources/sql/instrumentvoucher/insertInstrumentVoucherData.sql deleted file mode 100644 index b0d3a6ad5a4..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/instrumentvoucher/insertInstrumentVoucherData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_instrumentvoucher (id,instrumentId,voucherHeaderId,receiptHeaderId,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('1','1','1','1',1,now(),1,now(),'default'); \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/surrenderreason/clearSurrenderReason.sql b/business-services/egf-instrument/src/test/resources/sql/surrenderreason/clearSurrenderReason.sql deleted file mode 100644 index 16f782ce1f2..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/surrenderreason/clearSurrenderReason.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_surrenderreason; \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/sql/surrenderreason/insertSurrenderReasonData.sql b/business-services/egf-instrument/src/test/resources/sql/surrenderreason/insertSurrenderReasonData.sql deleted file mode 100644 index 5bfe19f44fb..00000000000 --- a/business-services/egf-instrument/src/test/resources/sql/surrenderreason/insertSurrenderReasonData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_surrenderreason (id,name,description,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('1','name','description',1,now(),1,now(),'default'); \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/search_by_id_response.json b/business-services/egf-instrument/src/test/resources/surrenderreason/search_by_id_response.json deleted file mode 100644 index 86a79305c4e..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/search_by_id_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "responseInfo": { - "resMsgId": "placeholder", - "status": "placeholder", - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - }, - "surrenderReasons": - [ - { - "id": "1", - "tenantId": "default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_invalid_field_value.json deleted file mode 100644 index 81d6c65803a..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_invalid_field_value.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "surrenderReasons": [ - { - "name":"name", - "description":"description", - "tenantId":"default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_valid_request.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_valid_request.json deleted file mode 100644 index 8712ac8adcc..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_valid_request.json +++ /dev/null @@ -1,7 +0,0 @@ -"surrenderReasons": [ - { - "name":"name", - "description":"description", - "tenantId":"default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_valid_response.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_valid_response.json deleted file mode 100644 index dfab647b173..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_create_valid_response.json +++ /dev/null @@ -1,8 +0,0 @@ -"surrenderReasons": [ - { - "id": null, - "name":"name", - "description":"description", - "tenantId":"default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_invalid_field_value.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_invalid_field_value.json deleted file mode 100644 index 81d6c65803a..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_invalid_field_value.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "surrenderReasons": [ - { - "name":"name", - "description":"description", - "tenantId":"default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_valid_request.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_valid_request.json deleted file mode 100644 index 9681ed15d5f..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_valid_request.json +++ /dev/null @@ -1,8 +0,0 @@ -"surrenderReasons": [ - { - "id":"1", - "name":"name", - "description":"description", - "tenantId":"default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_valid_response.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_valid_response.json deleted file mode 100644 index 9681ed15d5f..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_delete_valid_response.json +++ /dev/null @@ -1,8 +0,0 @@ -"surrenderReasons": [ - { - "id":"1", - "name":"name", - "description":"description", - "tenantId":"default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_search_valid_response.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_search_valid_response.json deleted file mode 100644 index 9023cae1563..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_search_valid_response.json +++ /dev/null @@ -1,17 +0,0 @@ -"surrenderReasons": [ - { - "id":"1", - "name":"name", - "description":"description", - "tenantId":"default" - } - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } - \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_update_valid_request.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_update_valid_request.json deleted file mode 100644 index 9681ed15d5f..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_update_valid_request.json +++ /dev/null @@ -1,8 +0,0 @@ -"surrenderReasons": [ - { - "id":"1", - "name":"name", - "description":"description", - "tenantId":"default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_update_valid_response.json b/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_update_valid_response.json deleted file mode 100644 index 9681ed15d5f..00000000000 --- a/business-services/egf-instrument/src/test/resources/surrenderreason/surrenderreason_update_valid_response.json +++ /dev/null @@ -1,8 +0,0 @@ -"surrenderReasons": [ - { - "id":"1", - "name":"name", - "description":"description", - "tenantId":"default" - } - ] \ No newline at end of file diff --git a/business-services/egf-instrument/start.sh b/business-services/egf-instrument/start.sh deleted file mode 100644 index 3dee95b3cad..00000000000 --- a/business-services/egf-instrument/start.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [[ -z "${JAVA_OPTS}" ]];then - export JAVA_OPTS="-Xmx64m -Xms64m" -fi - -java ${JAVA_OPTS} -jar /opt/egov/egf-instrument.jar diff --git a/business-services/egf-master/.gitignore b/business-services/egf-master/.gitignore deleted file mode 100644 index 2af7cefb0a3..00000000000 --- a/business-services/egf-master/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -target/ -!.mvn/wrapper/maven-wrapper.jar - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr - -### NetBeans ### -nbproject/private/ -build/ -nbbuild/ -dist/ -nbdist/ -.nb-gradle/ \ No newline at end of file diff --git a/business-services/egf-master/CHANGELOG.md b/business-services/egf-master/CHANGELOG.md deleted file mode 100644 index 0a13402194d..00000000000 --- a/business-services/egf-master/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -# Changelog -All notable changes to this module will be documented in this file. -## 1.1.3 - 2023-02-02 - -- Transition from 1.1.3-beta version to 1.1.3 version - -## 1.1.3-beta - 2022-01-13 -- Updated to log4j2 version 2.17.1 - -## 1.1.1 - 2021-02-26 - -- Removed unused code throwing exception - -## 1.1.0 - 2020-06-22 - -- Upgraded to `tracer:2.0.0-SNAPSHOT` -- Upgraded to `Spring boot 2.2.6` - -## 1.0.0 - -- Base version diff --git a/business-services/egf-master/LOCALSETUP.md b/business-services/egf-master/LOCALSETUP.md deleted file mode 100644 index 60e06ee809b..00000000000 --- a/business-services/egf-master/LOCALSETUP.md +++ /dev/null @@ -1,18 +0,0 @@ -# Local Setup - -To setup the egf-master service in your local system, clone the [Business services repository](https://github.com/egovernments/business-services). - -## Dependencies - -### Infra Dependency - -- [X] Postgres DB -- [ ] Redis -- [X] Elasticsearch -- [ ] Kafka - - [ ] Consumer - - [ ] Producer - -## Running Locally - -To run the egf-master service locally, no changes required. Service can be started locally without making any changes. diff --git a/business-services/egf-master/README.md b/business-services/egf-master/README.md deleted file mode 100644 index 4c5b7fdf664..00000000000 --- a/business-services/egf-master/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# egf-master service - -egf master service is used to search finance masters. - -### DB UML Diagram - -NA - -### Service Dependencies - -NA - -### Swagger API Contract - -http://editor.swagger.io/?url=https://raw.githubusercontent.com/egovernments/egov-services/master/docs/financials/contracts/egf-master/v1-0-0.yml#!/ - -## Service Details - -egf master service is used to search finance masters. - -### API Details - -`/chartofaccounts/_search` : API to search chart of accounts -`/financialstatuses/_search` : API to search the instrument status -`/bankaccounts/_search` : API to search bank accounts - -### Kafka Consumers - -NA - -### Kafka Producers - -NA diff --git a/business-services/egf-master/build.wkflo b/business-services/egf-master/build.wkflo deleted file mode 100644 index 9658ce33838..00000000000 --- a/business-services/egf-master/build.wkflo +++ /dev/null @@ -1,9 +0,0 @@ -def build(path, ci_image) { - stage("Build"){ - docker.image("${ci_image}").inside { - sh "cd ${path}; mvn clean test verify deploy -s settings.xml -Dnexus.user=${env.NEXUS_USER} -Dnexus.password=${env.NEXUS_PASSWORD}"; - } - } - } - - return this; \ No newline at end of file diff --git a/business-services/egf-master/mvnw b/business-services/egf-master/mvnw deleted file mode 100644 index 5bf251c0774..00000000000 --- a/business-services/egf-master/mvnw +++ /dev/null @@ -1,225 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Migwn, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" - # TODO classpath? -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -echo $MAVEN_PROJECTBASEDIR -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/business-services/egf-master/mvnw.cmd b/business-services/egf-master/mvnw.cmd deleted file mode 100644 index 019bd74d766..00000000000 --- a/business-services/egf-master/mvnw.cmd +++ /dev/null @@ -1,143 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" - -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/business-services/egf-master/pom.xml b/business-services/egf-master/pom.xml deleted file mode 100644 index b22774a0efe..00000000000 --- a/business-services/egf-master/pom.xml +++ /dev/null @@ -1,194 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.2.6.RELEASE - - - org.egov - egf-master - 1.1.3-SNAPSHOT - egf-master - egf masters project for egov services - - 2.17.1 - UTF-8 - 1.8 - UTF-8 - 1.18.8 - - - - org.flywaydb - flyway-core - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.springframework.kafka - spring-kafka - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework - spring-beans - 5.2.20.RELEASE - - - org.modelmapper - modelmapper - 0.7.5 - - - org.postgresql - postgresql - runtime - - - org.projectlombok - lombok - true - - - io.springfox - springfox-swagger2 - 2.4.0 - - - org.elasticsearch.client - transport - - - org.elasticsearch - elasticsearch - - - org.apache.logging.log4j - log4j-to-slf4j - 2.8.2 - - - org.apache.commons - commons-lang3 - 3.0 - - - commons-io - commons-io - 2.5 - - - org.springframework.boot - spring-boot-starter-test - test - - - org.egov.services - tracer - 2.0.0-SNAPSHOT - - - org.egov.services - services-common - 0.11.1 - - - - - repo.egovernments.org - eGov ERP Releases Repository - https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ - - - - - repo.egovernments.org - eGov ERP Releases Repository - https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ - - - repo.egovernments.org - eGov ERP Snapshots Repository - https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - org.projectlombok - lombok - - - org.springframework.boot - spring-boot-devtools - - - - - - - maven-deploy-plugin - 2.8.2 - - - default-deploy - deploy - - deploy - - - - - - - diff --git a/business-services/egf-master/settings.xml b/business-services/egf-master/settings.xml deleted file mode 100644 index 092c5ee4b49..00000000000 --- a/business-services/egf-master/settings.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - nexus - central - https://nexus-repo.egovernments.org/nexus/content/groups/public/ - - - - - repo.egovernments.org - ${nexus.user} - ${nexus.password} - - - - com.versioneye - - diff --git a/business-services/egf-master/src/main/java/org/egov/EgfMasterApplication.java b/business-services/egf-master/src/main/java/org/egov/EgfMasterApplication.java deleted file mode 100644 index 174bb3489dc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/EgfMasterApplication.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.egov; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import org.egov.tracer.config.TracerConfiguration; -import org.egov.tracer.kafka.LogAwareKafkaTemplate; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.transport.client.PreBuiltTransportClient; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; - -import javax.annotation.PostConstruct; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.TimeZone; - -@Import({ TracerConfiguration.class }) -@SpringBootApplication -public class EgfMasterApplication { - - public static void main(String[] args) { - SpringApplication.run(EgfMasterApplication.class, args); - } - - private static final String CLUSTER_NAME = "cluster.name"; - - @Value("${app.timezone}") - private String timeZone; - - @Value("${es.host}") - private String elasticSearchHost; - - @Value("${es.transport.port}") - private Integer elasticSearchTransportPort; - - @Value("${es.cluster.name}") - private String elasticSearchClusterName; - - private TransportClient client; - - @Autowired - private LogAwareKafkaTemplate logAwareKafkaTemplate; - - @PostConstruct - public void init() throws UnknownHostException { - TimeZone.setDefault(TimeZone.getTimeZone(timeZone)); - Settings settings = Settings.builder().put(CLUSTER_NAME, elasticSearchClusterName).build(); - final InetAddress esAddress = InetAddress.getByName(elasticSearchHost); - final TransportAddress transportAddress = new TransportAddress(esAddress, elasticSearchTransportPort); - client = new PreBuiltTransportClient(settings).addTransportAddress(transportAddress); - } - - @Bean - public MappingJackson2HttpMessageConverter jacksonConverter() { - // DateFormat std=DateFormat.getInstance().f - MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); - ObjectMapper mapper = new ObjectMapper(); - mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - mapper.setTimeZone(TimeZone.getTimeZone(timeZone)); - converter.setObjectMapper(mapper); - return converter; - } - - @Bean - public WebMvcConfigurerAdapter webMvcConfigurerAdapter() { - return new WebMvcConfigurerAdapter() { - - @Override - public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { - configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8); - } - - }; - } - - @Bean - public RestTemplate restTemplate() { - return new RestTemplate(); - } - - @Bean - public TransportClient getTransportClient() { - return client; - } - - @Bean - public FlywayMigrationStrategy cleanMigrateStrategy() { - return flyway -> { - flyway.repair(); - flyway.migrate(); - }; - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/EgfMasterAspectj.java b/business-services/egf-master/src/main/java/org/egov/EgfMasterAspectj.java deleted file mode 100644 index 11a3e3792d6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/EgfMasterAspectj.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.egov; - -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import java.util.Arrays; - -@Aspect -@Component -public class EgfMasterAspectj { - - private static final Logger logger = LoggerFactory.getLogger(EgfMasterAspectj.class); - - /* - * This pointcut will execute for all methods - */ - @Pointcut("within(org.egov..*)") - protected void allMethod() { - } - - /* before -> Any resource annotated with @Controller annotation */ - - @Before("allMethod()") - public void logBefore(JoinPoint joinPoint) { - - logger.debug("Entering in Method : " + joinPoint.getSignature().getName()); - logger.debug("Class Name : " + joinPoint.getSignature().getDeclaringTypeName()); - logger.debug("Arguments : " + Arrays.toString(joinPoint.getArgs())); - logger.debug("Target class : " + joinPoint.getTarget().getClass().getName()); - - } - - - /* - * After -> All method within resource annotated with @Controller annotation - * and return a value - */ - - @AfterReturning(pointcut = "allMethod()", returning = "result") - public void logAfter(JoinPoint joinPoint, Object result) { - - - String returnValue = null; - - if (null != result) { - returnValue = result.toString(); - } - - logger.debug("LEAVING: " + joinPoint.getSignature().getName() + " WITH: " + returnValue); - } - - /* - * After -> Any method within resource annotated with @Controller annotation - * throws an exception ...Log it - */ - - @AfterThrowing(pointcut = "allMethod()", throwing = "exception") - public void logAfterThrowing(JoinPoint joinPoint, Throwable exception) { - logger.error("An exception has been thrown in " + joinPoint.getSignature().getName() + " ()"); - logger.error("Cause : " + exception.getCause()); - } - - /* - * Around -> Any method within resource annotated with @Controller - * annotation - */ - - @Around("allMethod()") - public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable { - - long start = System.currentTimeMillis(); - try { - String className = joinPoint.getSignature().getDeclaringTypeName(); - String methodName = joinPoint.getSignature().getName(); - Object result = joinPoint.proceed(); - long elapsedTime = System.currentTimeMillis() - start; - logger.debug("Method " + className + "." + methodName + " ()" + " execution time : " + elapsedTime + " ms"); - - return result; - } catch (IllegalArgumentException e) { - logger.error("Illegal argument " + Arrays.toString(joinPoint.getArgs()) + " in " - + joinPoint.getSignature().getName() + "()"); - throw e; - } - } - - - -} diff --git a/business-services/egf-master/src/main/java/org/egov/SetThreadLocals.java b/business-services/egf-master/src/main/java/org/egov/SetThreadLocals.java deleted file mode 100644 index f272e3246b4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/SetThreadLocals.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.egov; - -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.*; -import org.aspectj.lang.reflect.CodeSignature; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.repository.AccountCodePurposeESRepository; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -import java.lang.reflect.Field; -import java.util.Arrays; - -@Aspect -@Component -public class SetThreadLocals { - public static final Logger LOGGER = LoggerFactory.getLogger(SetThreadLocals.class); - - /** - * A join point is in the web layer if the method is defined - * in a type in the com.xyz.someapp.web package or any sub-package - * under that. - */ - - @Pointcut("within(@org.springframework.web.bind.annotation.RestController *)") - public void inWebLayer() { - System.out.print("---Before Method Execution---inWebLayer()"); - } - - @Before(value = "inWebLayer() ") - public void logMethodAcceptionEntityAnnotatedBean(JoinPoint jp) { - String tenantId = ""; - - String[] paramNames = ((CodeSignature) jp.getSignature()).getParameterNames(); - int i = 0; - int index = Arrays.asList(paramNames).indexOf("tenantId"); - if (index != -1) { - tenantId = (String) jp.getArgs()[index]; - ApplicationThreadLocals.setTenantId(tenantId); - } - - for (Object obj : jp.getArgs()) { - if (obj.getClass().equals(RequestInfo.class)) { - ApplicationThreadLocals.setRequestInfo((RequestInfo) obj); - break; - } - if (obj.toString().contains("requestInfo")) { - try { - Field f = obj.getClass().getDeclaredField("requestInfo"); - if (f != null) { - f.setAccessible(true); - RequestInfo info = (RequestInfo) f.get(obj); - ApplicationThreadLocals.setRequestInfo(info); - break; - } - - } catch (Exception e) { - LOGGER.error("Exception occurred: " + e.getMessage()); - } - } - - - } - } - - @AfterReturning(value = "inWebLayer()") - public void logMethodAcceptionEntityAnnotatedBeanAfter(JoinPoint jp) { - System.out.print("---After Method Execution---inWebLayer()"); - ApplicationThreadLocals.clearValues(); - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/SwaggerConfig.java b/business-services/egf-master/src/main/java/org/egov/SwaggerConfig.java deleted file mode 100644 index 700a50bfaf9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/SwaggerConfig.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov; - -import org.springframework.context.annotation.Bean; - -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -@EnableSwagger2 -public class SwaggerConfig { - @Bean - public Docket api() { - return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()) - .paths(PathSelectors.any()).build(); - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/constants/Constants.java b/business-services/egf-master/src/main/java/org/egov/common/constants/Constants.java deleted file mode 100644 index 853987acd81..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/constants/Constants.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.common.constants; - -public class Constants { - - private Constants() { - - } - - public static final String ACTION_CREATE = "create"; - public static final String ACTION_UPDATE = "update"; - public static final String ACTION_VIEW = "view"; - public static final String ACTION_EDIT = "edit"; - public static final String ACTION_SEARCH = "search"; -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/annotation/Unique.java b/business-services/egf-master/src/main/java/org/egov/common/domain/annotation/Unique.java deleted file mode 100644 index 10ec59b4e7e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/annotation/Unique.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.common.domain.annotation; - -import static java.lang.annotation.ElementType.ANNOTATION_TYPE; -import static java.lang.annotation.ElementType.CONSTRUCTOR; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER }) -@Retention(RUNTIME) -public @interface Unique { - String[] fields() default { }; -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/CustomBindException.java b/business-services/egf-master/src/main/java/org/egov/common/domain/exception/CustomBindException.java deleted file mode 100644 index d4d69dba400..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/CustomBindException.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.egov.common.domain.exception; - -import org.springframework.validation.BindingResult; - -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -public class CustomBindException extends RuntimeException { - - private static final long serialVersionUID = 8861914629969408745L; - - private BindingResult errors; - - public CustomBindException(BindingResult errors) { - this.errors = errors; - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/ErrorCode.java b/business-services/egf-master/src/main/java/org/egov/common/domain/exception/ErrorCode.java deleted file mode 100644 index a4cdd64af55..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/ErrorCode.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.egov.common.domain.exception; - -import java.util.HashMap; -import java.util.Map; -/** - * - * @author mani - * List of Domain Error codes with message and detailed description - * Donot auto format this file - */ -public enum ErrorCode { - - KAFKA_TIMEOUT_ERROR( - "org.egov.service.kafka.timeout", - "time out while waiting for kafka", - "Some required service is down. Please contact Administrator"), - NON_UNIQUE_VALUE( - "non.unique.value", - "the field {0} must be unique in the system", - "The value {1} for the field {0} already exists in the system. Please provide different value"), - NULL_VALUE("null.value", - "the field {0} must be not be null", - "The value {1} for the field {0} not allowed in the system. Please provide correct value"), - MANDATORY_VALUE_MISSING("mandatory.value.missing", - "the field {0} must be not be null or empty", - "the field {0} is Mandatory .It cannot be not be null or empty.Please provide correct value"), - NOT_NULL("NotNull", - "the field {0} must be not be null", - "The value {1} for the field {0} not allowed in the system. Please provide correct value"), - INVALID_REF_VALUE("invalid.ref.value", - "the field {0} should have a valid value which exists in the system. ", - "The value {1} for the field {0} does exist in system. Please provide correct value"); - - - private final String code; - private final String message; - private final String description; - private static final Map errorMap = new HashMap(); - - static { - for (ErrorCode error : ErrorCode.values()) { - errorMap.put(error.code, error); - } - } - - ErrorCode(final String code, final String message, final String description) { - this.code = code; - this.message = message; - this.description = description; - } - - public static ErrorCode getError(String code) { - return errorMap.get(code); - } - - // add getters and setters here: - public String getCode() { - return this.code; - } - - public String getMessage() { - return this.message; - } - - public String getDescription() { - return this.description; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/InvalidDataException.java b/business-services/egf-master/src/main/java/org/egov/common/domain/exception/InvalidDataException.java deleted file mode 100644 index d47138845ea..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/InvalidDataException.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.egov.common.domain.exception; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -public class InvalidDataException extends RuntimeException { - private static final long serialVersionUID = -1509069993620266971L; - public static final String code = "001"; - private String fieldName; - private String messageKey; - private String fieldValue; - - - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/UnauthorizedAccessException.java b/business-services/egf-master/src/main/java/org/egov/common/domain/exception/UnauthorizedAccessException.java deleted file mode 100644 index 8037baa8169..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/UnauthorizedAccessException.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.egov.common.domain.exception; - -public class UnauthorizedAccessException extends RuntimeException { - - private static final long serialVersionUID = -7621995485789137725L; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/ValidationException.java b/business-services/egf-master/src/main/java/org/egov/common/domain/exception/ValidationException.java deleted file mode 100644 index 6f63e84f99f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/exception/ValidationException.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.common.domain.exception; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -public class ValidationException extends RuntimeException { - private static final long serialVersionUID = -1509069993620266971L; - private String fieldName; - private String messageKey; - private String fieldValue; - - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Attribute.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/Attribute.java deleted file mode 100644 index 8f69e85569a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Attribute.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.egov.common.domain.model; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -@AllArgsConstructor -@NoArgsConstructor -@Getter -public class Attribute { - - public static final String DATATYPE = "String"; - @JsonProperty("variable") - private Boolean variable; - - @JsonProperty("code") - private String code; - - @JsonProperty("datatype") - private String datatype; - - @JsonProperty("required") - private Boolean required; - - @JsonProperty("datatypeDescription") - private String datatypeDescription; - - @JsonProperty("values") - private List values; - - public static Attribute asStringAttr(String code, String value) { - List valueList = new ArrayList<>(); - valueList.add(new Value(code, value)); - return new Attribute(Boolean.TRUE, code, DATATYPE, Boolean.FALSE, StringUtils.EMPTY, valueList); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Auditable.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/Auditable.java deleted file mode 100644 index 0fe45076f02..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Auditable.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.egov.common.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.egov.common.contract.request.User; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotNull; -import java.util.Date; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -public class Auditable { - - /** - * tenantId Unique Identifier of the tenant, Like AP, AP.Kurnool etc. - * represents the client for which the transaction is created. - */ - - @NotNull - @Length(max = 50, min = 5) - protected String tenantId; - /** - * createdBy is the logged in use who is conducting transaction - */ - protected User createdBy; - /** - * lastModifiedBy is the logged in use who is updating transaction - */ - protected User lastModifiedBy; - /** - * createDate date on which trnasaction is created - */ - protected Date createdDate; - /** - * lastModifiedDate date is on which trnasaction is updated lastly - */ - protected Date lastModifiedDate; - - protected String deleteReason; -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/DeletedTransaction.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/DeletedTransaction.java deleted file mode 100644 index 26bcf3174d7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/DeletedTransaction.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.egov.common.domain.model; - - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotNull; -import java.util.Date; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -public class DeletedTransaction { - - - protected String id; - - protected String tableName; - - protected String identifier; - - @Length(max = 250) - protected String deleteReason; - - protected Date updatedDate; - - protected String data; - - @NotNull - @Length(max = 50, min = 5) - protected String tenantId; -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/DepartmentDesignation.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/DepartmentDesignation.java deleted file mode 100644 index f0121c69df7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/DepartmentDesignation.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.common.domain.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.Data; - -@Data -public class DepartmentDesignation { - - private Long id; - - @JsonProperty("department") - private Long departmentId; - - private Designation designation; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Designation.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/Designation.java deleted file mode 100644 index 2aa89e7b1c0..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Designation.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.egov.common.domain.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import lombok.Data; - -@Data -public class Designation { - - @NotNull - private Long id; - - @NotNull - @Size(min = 3, max = 100) - private String name; - - @NotNull - @Size(min = 3, max = 20) - private String code; - - @Size(max = 250) - private String description; - - private String chartOfAccounts; - - @NotNull - private Boolean active; - - @NotNull - private String tenantId; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Pagination.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/Pagination.java deleted file mode 100644 index 7d23a9f4c58..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Pagination.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.common.domain.model; - -import java.util.List; - -import javax.validation.constraints.Max; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonProperty.Access; - -import lombok.Data; - -@Data -public class Pagination { - - public static int DEFAULT_PAGE_SIZE = 500; - public static int DEFAULT_PAGE_OFFSET = 0; - - private Integer totalResults; - - private Integer totalPages; - - @Max(500l) - private Integer pageSize = DEFAULT_PAGE_SIZE; - - private Integer currentPage; - - private Integer offset = DEFAULT_PAGE_OFFSET; - - @JsonProperty(access = Access.WRITE_ONLY) - List pagedData; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Position.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/Position.java deleted file mode 100644 index 190713f327f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Position.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.common.domain.model; - -import lombok.Data; - -@Data -public class Position { - - private Long id; - - private String name; - - private DepartmentDesignation deptdesig; - - private Boolean isPostOutsourced; - - private Boolean active; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Task.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/Task.java deleted file mode 100644 index cd49c7aede9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Task.java +++ /dev/null @@ -1,168 +0,0 @@ -package org.egov.common.domain.model; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import javax.validation.constraints.NotNull; - -import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; - -import com.fasterxml.jackson.annotation.JsonFormat; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class Task { - - /** - * Id of the task getting updated. This field Maps to Id of the Task or - * ProcessInstance in case of eGov internal Work flow or the Work flow - * Matrix based implementation . - */ - @NotNull - private String id = null; - - /** - * businessKey is the name representing the process flow of the a particular - * Item For example For Financial vouchers work flow process may be defined - * with a businessKey of "voucher_workflow" . For eGov internal work flow - * Implementation it is same as the class name of the java object under - * going work flow. example businessKey "Voucher" - */ - @Length(max = 128, min = 1) - @NotNull - private String businessKey = null; - /** - * type field can be used to further divide the work flow processes. For - * example Voucher might have 4 different flows 1. Expense Work flow 2. - * Contractor Journal Work flow 3. Supplier Journal Work flow 4. General JV - * Work flow Each process is different .Another example is Property might - * have different flows like 1.Create,Transfer,Bifurcation,Update etc. - */ - @Length(max = 128, min = 1) - private String type = null; - /** - * assignee is the position of the user to be set while creating a - * instantiating of Process. For Automatic work flow this comes from the - * process definition for manual work flow it is the position selected from - * the UI. - */ - @NotNull - private Position assignee = null; - - /** - * comments is the comment provided by the user while he is initiating a - * process - */ - @Length(max = 1024, min = 1) - private String comments = null; - /** - * createDate is the date on which the process is instantiated. This is set - * internally by the system . For clients it is read only data - */ - @JsonFormat(pattern = "dd/MM/yyyy") - private Date createdDate = null; - - /** - * lastupdatedSince is the date on which the process is updated last time. - * This is set internally by the system . For clients it is read only data - */ - @JsonFormat(pattern = "dd/MM/yyyy") - private Date lastupdatedSince = null; - - /** - * owner gives the Position current owner of the process. This data is only - * for the display purpose. So it will not be considered in the request . - */ - private Position owner = null; - - /** - * state gives the current state of the process. - */ - - @Length(max = 128, min = 1) - private String state = null; - - /** - * status also another representation of the status of the process - */ - @Length(max = 128, min = 1) - private String status = null; - /** - * url provides the complete url of the work flow item. This link takes you - * to the view of the item along with provision to select the next assignee. - * This data is also configured in work flow type object. This data is also - * read only . UI Can consider this field to redirect to the page or UI can - * be build without consuming this. - */ - @Length(max = 256, min = 1) - private String url = null; - /** - * action represents the action performed by the end user . it can be - * forward,approve,reject,cancel etc For eGov internal work flow these four - * values are confirmed and will do the tasks of - * forwarding,approving,rejecting,cancelling accordingly. This is mandatory - * data in case of manual work flow - */ - @NotBlank - @Length(max = 128, min = 1) - private String action = null; - - /** - * senderName represents who initiated the work flow process. This is the - * logged in users primary position . Also this is set by system by taking - * the logged in users primary position. - */ - - @Length(max = 128, min = 1) - private String senderName; - - /** - * details provides more information on the processs/Task instance. Example - * : In voucher work flow it is VoucherNumber, Property it is the propertyId - * ,Grievance it is the complaint or request number This data is set - * internally by the system which is configured in work flow type - */ - - @Length(max = 128, min = 1) - private String details; - /** - * natureOfTask Detaild Description of the task or process . For example in - * case of voucher it can be set as "Finaicial Voucher Workflow " . This - * data is also configured by the display name of the workflowtype object. - * This data is read only. . - * - */ - @Length(max = 128, min = 1) - private String natureOfTask; - /** - * entity Maps to the json representation of the item under workflow. This - * will be used when work flow considers rule engine. like amount based flow - * etc - */ - private String entity; - - private String tenantId; - - private Map attributes = new HashMap(); - - // To be used to fetch single value attributes - public String getValueForKey(final String key) { - if (Objects.nonNull(attributes) && Objects.nonNull(attributes.get(key))) - return attributes.get(key).getValues().get(0).getName(); - - return ""; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/User.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/User.java deleted file mode 100644 index caa76b40576..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/User.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.common.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -public class User { - private String id; -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Value.java b/business-services/egf-master/src/main/java/org/egov/common/domain/model/Value.java deleted file mode 100644 index aa380100c40..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/domain/model/Value.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.common.domain.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -public class Value { - - @JsonProperty("key") - private String key = null; - - @JsonProperty("name") - private String name = null; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/AuditableEntity.java b/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/AuditableEntity.java deleted file mode 100644 index 462b869757c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/AuditableEntity.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.common.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Auditable; - -import java.util.Date; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class AuditableEntity { - protected String tenantId; - protected String createdBy; - protected String lastModifiedBy; - protected Date createdDate; - protected Date lastModifiedDate; - protected String deleteReason; - - protected void toDomain(Auditable domain) { - if (createdBy != null) { - if (!createdBy.isEmpty()) - domain.setCreatedBy(User.builder().id(Long.parseLong(this.getCreatedBy())).build()); - } - if (lastModifiedBy != null) { - if (!lastModifiedBy.isEmpty()) - domain.setLastModifiedBy(User.builder().id(Long.parseLong(this.getLastModifiedBy())).build()); - } - domain.setCreatedDate(this.getCreatedDate()); - domain.setLastModifiedDate(this.getLastModifiedDate()); - domain.setTenantId(this.getTenantId()); - domain.setDeleteReason(this.getDeleteReason()); - } - - protected void toEntity(Auditable domain) { - this.setCreatedBy(domain.getCreatedBy() != null ? domain.getCreatedBy().getId().toString() : null); - this.setLastModifiedBy(domain.getLastModifiedBy() != null ? domain.getLastModifiedBy().getId().toString() : null); - this.setCreatedDate(domain.getCreatedDate()); - this.setLastModifiedDate(domain.getLastModifiedDate()); - this.setTenantId(domain.getTenantId()); - this.setDeleteReason(domain.getDeleteReason()); - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/BaseEntity.java b/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/BaseEntity.java deleted file mode 100644 index b3ce6af1234..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/BaseEntity.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.egov.common.persistence.entity; - -public class BaseEntity { - private String tennatId; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/DeletedTransactionEntity.java b/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/DeletedTransactionEntity.java deleted file mode 100644 index 4623154e07d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/persistence/entity/DeletedTransactionEntity.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.egov.common.persistence.entity; - - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotNull; -import java.util.Date; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -public class DeletedTransactionEntity { - - - protected String id; - - protected String tableName; - - protected String identifier; - - protected String deleteReason; - - protected Date updatedDate; - - protected String data; - - protected String tenantId; -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/ESRepository.java b/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/ESRepository.java deleted file mode 100644 index a50eb9128e5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/ESRepository.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.egov.common.persistence.repository; - -import static org.elasticsearch.index.query.QueryBuilders.termsQuery; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.egov.common.domain.exception.InvalidDataException; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.stereotype.Repository; - -@Repository -public abstract class ESRepository { - - protected TransportClient esClient; - - public void validateSortByOrder(final String sortBy) { - List sortByList = new ArrayList(); - InvalidDataException invalidDataException = new InvalidDataException(); - if (sortBy.contains(",")) { - sortByList = Arrays.asList(sortBy.split(",")); - } else { - sortByList = Arrays.asList(sortBy); - } - for (String s : sortByList) { - if (s.contains(" ") - && (!s.toLowerCase().trim().endsWith("asc") && !s.toLowerCase().trim().endsWith("desc"))) { - invalidDataException.setFieldName(s.split(" ")[0]); - invalidDataException - .setMessageKey("Please send the proper sortBy order for the field " + s.split(" ")[0]); - throw invalidDataException; - } - } - - } - - public void validateEntityFieldName(String sortBy, final Class object) { - InvalidDataException invalidDataException = new InvalidDataException(); - List sortByList = new ArrayList(); - if (sortBy.contains(",")) { - sortByList = Arrays.asList(sortBy.split(",")); - } else { - sortByList = Arrays.asList(sortBy); - } - Boolean isFieldExist = Boolean.FALSE; - for (String s : sortByList) { - for (int i = 0; i < object.getDeclaredFields().length; i++) { - if (object.getDeclaredFields()[i].getName().equals(s.contains(" ") ? s.split(" ")[0] : s)) { - isFieldExist = Boolean.TRUE; - break; - } else { - isFieldExist = Boolean.FALSE; - } - } - if (!isFieldExist) { - invalidDataException.setFieldName(s.contains(" ") ? s.split(" ")[0] : s); - invalidDataException.setMessageKey("Please send the proper Field Names "); - throw invalidDataException; - } - } - - } - - public List prepareOrderBys(String sortBy) { - List orderByList = new ArrayList(); - List sortByList = new ArrayList(); - if (sortBy.contains(",")) { - sortByList = Arrays.asList(sortBy.split(",")); - } else { - sortByList = Arrays.asList(sortBy); - } - for (String s : sortByList) { - if (s.contains(" ") - && (s.toLowerCase().trim().endsWith("asc") || s.toLowerCase().trim().endsWith("desc"))) { - orderByList.add(s.trim()); - } else { - orderByList.add(s.trim() + " asc"); - } - } - - return orderByList; - } - - public void add(Object fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder = boolQueryBuilder.filter(termsQuery(field, fieldValue)); - } - - } - - public void in(List fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder.filter(QueryBuilders.termsQuery(field, fieldValue)); - } - - } - - public void gte(Object fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder = boolQueryBuilder.filter(QueryBuilders.rangeQuery(field).from(fieldValue)); - } - - } - - public void lte(Object fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder = boolQueryBuilder.filter(QueryBuilders.rangeQuery(field).to(fieldValue)); - } - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/JdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/JdbcRepository.java deleted file mode 100644 index dd5731931b0..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/persistence/repository/JdbcRepository.java +++ /dev/null @@ -1,515 +0,0 @@ -package org.egov.common.persistence.repository; - -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.reflect.FieldUtils; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.entity.AuditableEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.annotation.Transactional; - -@Repository -public abstract class JdbcRepository { - public static final Map> allInsertFields = new HashMap>(); - public static final Map> allUpdateFields = new HashMap>(); - public static final Map> allIdentitiferFields = new HashMap>(); - public static final Map allInsertQuery = new HashMap<>(); - public static final Map allUpdateQuery = new HashMap<>(); - public static final Map allSearchQuery = new HashMap<>(); - public static final Map getByIdQuery = new HashMap<>(); - private static final Logger LOG = LoggerFactory.getLogger(JdbcRepository.class); - @Autowired - public JdbcTemplate jdbcTemplate; - @Autowired - public NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - public static synchronized void init(Class T) { - String TABLE_NAME = ""; - - List insertFields = new ArrayList<>(); - List updateFields = new ArrayList<>(); - List uniqueFields = new ArrayList<>(); - - String insertQuery = ""; - String updateQuery = ""; - String searchQuery = ""; - - try { - - TABLE_NAME = (String) T.getDeclaredField("TABLE_NAME").get(null); - } catch (Exception e) { - - } - insertFields.addAll(fetchFields(T)); - uniqueFields.add("id"); - uniqueFields.add("tenantId"); - insertFields.removeAll(uniqueFields); - allInsertQuery.put(T.getSimpleName(), insertQuery(insertFields, TABLE_NAME, uniqueFields)); - updateFields.addAll(insertFields); - updateFields.remove("createdBy"); - updateQuery = updateQuery(updateFields, TABLE_NAME, uniqueFields); - System.out.println(T.getSimpleName() + "--------" + insertFields); - allInsertFields.put(T.getSimpleName(), insertFields); - allUpdateFields.put(T.getSimpleName(), updateFields); - allIdentitiferFields.put(T.getSimpleName(), uniqueFields); - // allInsertQuery.put(T.getSimpleName(), insertQuery); - allUpdateQuery.put(T.getSimpleName(), updateQuery); - getByIdQuery.put(T.getSimpleName(), getByIdQuery(TABLE_NAME, uniqueFields)); - System.out.println(allInsertQuery); - } - - public static String insertQuery(List fields, String tableName, List uniqueFields) { - String iQuery = "insert into :tableName (:fields) values (:params) "; - StringBuilder fieldNames = new StringBuilder(); - StringBuilder paramNames = new StringBuilder(); - int i = 0; - for (String s : fields) { - if (i > 0) { - fieldNames.append(", "); - paramNames.append(", "); - } - fieldNames.append(s); - paramNames.append(":").append(s); - i++; - } - - for (String s : uniqueFields) { - if (i > 0) { - fieldNames.append(", "); - paramNames.append(", "); - } - fieldNames.append(s); - paramNames.append(":").append(s); - i++; - } - - System.out.println(fields); - System.out.println(uniqueFields); - iQuery = iQuery.replace(":fields", fieldNames.toString()).replace(":params", paramNames.toString()) - .replace(":tableName", tableName).toString(); - System.out.println(tableName + "----" + iQuery); - return iQuery; - } - - public static List fetchFields(Class ob) { - List fields = new ArrayList<>(); - for (Field f : ob.getDeclaredFields()) { - if (java.lang.reflect.Modifier.isStatic(f.getModifiers())) { - continue; - } - - fields.add(f.getName()); - } - - for (Field f : AuditableEntity.class.getDeclaredFields()) { - - if (java.lang.reflect.Modifier.isStatic(f.getModifiers())) { - continue; - } - if (f.getName().equalsIgnoreCase("deleteReason")) { - continue; - } - fields.add(f.getName()); - } - return fields; - } - - public static String updateQuery(List fields, String tableName, List uniqueFields) { - String uQuery = "update :tableName set :fields where :uniqueField "; - StringBuilder fieldNameAndParams = new StringBuilder(); - StringBuilder uniqueFieldNameAndParams = new StringBuilder(); - - int i = 0; - for (String s : fields) { - if (i > 0) { - fieldNameAndParams.append(", "); - - } - fieldNameAndParams.append(s).append("=").append(":").append(s); - i++; - } - i = 0; - for (String s : uniqueFields) { - if (i > 0) { - uniqueFieldNameAndParams.append(" and "); - - } - uniqueFieldNameAndParams.append(s).append("=").append(":").append(s); - i++; - } - - uQuery = uQuery.replace(":fields", fieldNameAndParams.toString()) - .replace(":uniqueField", uniqueFieldNameAndParams.toString()).replace(":tableName", tableName) - .toString(); - return uQuery; - } - - public static String getByIdQuery(String tableName, List uniqueFields) { - String uQuery = "select * from :tableName where :uniqueField "; - // StringBuilder fieldNameAndParams = new StringBuilder(); - StringBuilder uniqueFieldNameAndParams = new StringBuilder(); - int i = 0; - - for (String s : uniqueFields) { - if (i > 0) { - uniqueFieldNameAndParams.append(" and "); - - } - uniqueFieldNameAndParams.append(s).append("=").append(":").append(s); - i++; - } - - uQuery = uQuery.replace(":uniqueField", uniqueFieldNameAndParams.toString()).replace(":tableName", tableName) - .toString(); - return uQuery; - } - - - public static Object getValue(Field declaredField, Object obj) { - - Object ob1 = obj; - Object val = null; - while (ob1 != null) { - try { - val = declaredField.get(obj); - break; - } catch (Exception e) { - if (ob1.getClass().getSuperclass() != null) { - ob1 = ob1.getClass().getSuperclass(); - } else { - break; - } - - } - - } - return val; - - } - - public static Field getField(Object obj, String s) { - System.out.println(s); - Field declaredField = null; - Object ob1 = obj; - while (declaredField == null) { - try { - declaredField = ob1.getClass().getDeclaredField(s); - } catch (Exception e) { - try { - declaredField = ob1.getClass().getSuperclass().getDeclaredField(s); - } catch (Exception e1) { - break; - } - } - - } - if (declaredField != null) { - declaredField.setAccessible(true); - } - return declaredField; - } - - public Map paramValues(Object ob, List fields) { - Map paramValues = new LinkedHashMap<>(); - - for (String s : fields) { - Field f = null; - - try { - f = getField(ob, s); - } catch (Exception e) { - } - /* - * try { f = ob.getClass().getSuperclass().getDeclaredField(s); } catch (NoSuchFieldException e1) { - * System.out.println( "Unable to find the field in this class and its super class for field" + s); } } - */ - try { - f.setAccessible(true); - paramValues.put(s, f.get(ob)); - } catch (IllegalArgumentException e1) { - // TODO Auto-generated catch block - LOG.error("Illegal Argument exception occurred: " + e1.getMessage()); - } catch (IllegalAccessException e1) { - // TODO Auto-generated catch block - LOG.error("Illegal access exception occurred: " + e1.getMessage()); - } - } - - return paramValues; - - } - - @Transactional - public Object create(Object ob) { - // System.out.println(allInsertQuery); - ((AuditableEntity) ob).setCreatedDate(new Date()); - ((AuditableEntity) ob).setLastModifiedDate(new Date()); - - String obName = ob.getClass().getSimpleName(); - List> batchValues = new ArrayList<>(); - batchValues.add(paramValues(ob, allInsertFields.get(obName))); - batchValues.get(0).putAll(paramValues(ob, allIdentitiferFields.get(obName))); - System.out.println(obName + "----" + allInsertQuery.get(obName)); - System.out.println(namedParameterJdbcTemplate); - namedParameterJdbcTemplate.batchUpdate(allInsertQuery.get(obName), - batchValues.toArray(new Map[batchValues.size()])); - return ob; - } - - @Transactional - public Object update(Object ob) { - System.out.println(allUpdateQuery); - ((AuditableEntity) ob).setCreatedDate(new Date()); - ((AuditableEntity) ob).setLastModifiedDate(new Date()); - - String obName = ob.getClass().getSimpleName(); - List> batchValues = new ArrayList<>(); - batchValues.add(paramValues(ob, allUpdateFields.get(obName))); - batchValues.get(0).putAll(paramValues(ob, allIdentitiferFields.get(obName))); - System.out.println(obName + "----" + allUpdateQuery.get(obName)); - namedParameterJdbcTemplate.batchUpdate(allUpdateQuery.get(obName), - batchValues.toArray(new Map[batchValues.size()])); - return ob; - } - - @Transactional - public void delete(String tableName, String id) { - String delQuery = "delete from " + tableName + " where id = '" + id + "'"; - jdbcTemplate.execute(delQuery); - } - - @Transactional - public void delete(final String tableName, final String tenantId, final String fieldName, final String fieldValue) { - - final String delQuery = "delete from " + tableName + " where tenantId = '" + tenantId + "' and " + fieldName + " = '" - + fieldValue + "'"; - System.out.println("Delete query" + "----" + delQuery); - jdbcTemplate.execute(delQuery); - } - - public String getSequence(String seqName) { - String seqQuery = "select nextval('" + seqName + "')"; - return String.valueOf(jdbcTemplate.queryForObject(seqQuery, Long.class) + 1); - } - - @Transactional - public void createSequence(String seqName) { - String seqQuery = "create sequence " + seqName + ""; - jdbcTemplate.execute(seqQuery); - } - - public Pagination getPagination(String searchQuery, Pagination page, Map paramValues) { - String countQuery = "select count(*) from (" + searchQuery + ") as x"; - Long count = namedParameterJdbcTemplate.queryForObject(countQuery.toString(), paramValues, Long.class); - Integer totalpages = (int) Math.ceil((double) count / page.getPageSize()); - page.setTotalPages(totalpages); - page.setCurrentPage(page.getOffset()); - return page; - } - - public void validateSortByOrder(final String sortBy) { - List sortByList = new ArrayList(); - InvalidDataException invalidDataException = new InvalidDataException(); - if (sortBy.contains(",")) { - sortByList = Arrays.asList(sortBy.split(",")); - } else { - sortByList = Arrays.asList(sortBy); - } - for (String s : sortByList) { - if (s.contains(" ") - && (!s.toLowerCase().trim().endsWith("asc") && !s.toLowerCase().trim().endsWith("desc"))) { - invalidDataException.setFieldName(s.split(" ")[0]); - invalidDataException - .setMessageKey("Please send the proper sortBy order for the field " + s.split(" ")[0]); - throw invalidDataException; - } - } - - } - - public void validateEntityFieldName(String sortBy, final Class object) { - InvalidDataException invalidDataException = new InvalidDataException(); - List sortByList = new ArrayList(); - if (sortBy.contains(",")) { - sortByList = Arrays.asList(sortBy.split(",")); - } else { - sortByList = Arrays.asList(sortBy); - } - Boolean isFieldExist = Boolean.FALSE; - for (String s : sortByList) { - for (int i = 0; i < object.getDeclaredFields().length; i++) { - if (object.getDeclaredFields()[i].getName().equals(s.contains(" ") ? s.split(" ")[0] : s)) { - isFieldExist = Boolean.TRUE; - break; - } else { - isFieldExist = Boolean.FALSE; - } - } - if (!isFieldExist) { - invalidDataException.setFieldName(s.contains(" ") ? s.split(" ")[0] : s); - invalidDataException.setMessageKey("Please send the proper Field Names "); - throw invalidDataException; - } - } - - } - - public Boolean uniqueCheck(String fieldName, Object ob) { - LOG.info("Unique Checking for field " + fieldName); - - String obName = ob.getClass().getSimpleName(); - List identifierFields = allIdentitiferFields.get(obName); - List> batchValues = new ArrayList<>(); - - // batchValues.get(0).putAll(paramValues(ob, allIdentitiferFields.get(obName))); - Map paramValues = new HashMap<>(); - String table = ""; - try { - table = FieldUtils.readDeclaredField(ob, "TABLE_NAME").toString(); - } catch (IllegalAccessException e) { - throw new RuntimeException("Not able to get Table_name from entity" + obName); - } - StringBuffer uniqueQuery = new StringBuffer( - "select count(*) as count from " + table + " where " + fieldName + "=:fieldValue"); - paramValues.put("fieldValue", getValue(getField(ob, fieldName), ob)); - int i = 0; - for (String s : identifierFields) { - - if (s.equalsIgnoreCase("tenantId")) { - uniqueQuery.append(" and "); - uniqueQuery.append(s).append("=").append(":").append(s); - // implement fallback here - paramValues.put(s, getValue(getField(ob, s), ob)); - continue; - } - if (getValue(getField(ob, s), ob) != null) { - uniqueQuery.append(" and "); - uniqueQuery.append(s).append("!=").append(":").append(s); - paramValues.put(s, getValue(getField(ob, s), ob)); - } - } - - Long count = namedParameterJdbcTemplate.queryForObject(uniqueQuery.toString(), paramValues, Long.class); - LOG.info("Record Count for field " + count); - return count >= 1 ? false : true; - - } - - public Boolean uniqueCheck(String firstFieldName, String secondFieldName, Object ob) { - LOG.info("Unique Checking for combination of fields " + firstFieldName + " & " + secondFieldName); - - String obName = ob.getClass().getSimpleName(); - List identifierFields = allIdentitiferFields.get(obName); - List> batchValues = new ArrayList<>(); - - // batchValues.get(0).putAll(paramValues(ob, allIdentitiferFields.get(obName))); - Map paramValues = new HashMap<>(); - String table = ""; - try { - table = FieldUtils.readDeclaredField(ob, "TABLE_NAME").toString(); - } catch (IllegalAccessException e) { - throw new RuntimeException("Not able to get Table_name from entity" + obName); - } - StringBuffer uniqueQuery = new StringBuffer("select count(*) as count from " + table + " where " + firstFieldName - + "=:firstFieldValue" + " and " + secondFieldName + "=:secondFieldValue"); - paramValues.put("firstFieldValue", getValue(getField(ob, firstFieldName), ob)); - paramValues.put("secondFieldValue", getValue(getField(ob, secondFieldName), ob)); - int i = 0; - for (String s : identifierFields) { - - if (s.equalsIgnoreCase("tenantId")) { - uniqueQuery.append(" and "); - uniqueQuery.append(s).append("=").append(":").append(s); - // implement fallback here - paramValues.put(s, getValue(getField(ob, s), ob)); - continue; - } - if (getValue(getField(ob, s), ob) != null) { - uniqueQuery.append(" and "); - uniqueQuery.append(s).append("!=").append(":").append(s); - paramValues.put(s, getValue(getField(ob, s), ob)); - } - } - - Long count = namedParameterJdbcTemplate.queryForObject(uniqueQuery.toString(), paramValues, Long.class); - LOG.info("Record Count for combination of fields " + count); - return count >= 1 ? false : true; - - } - - public void delete(Object entity, String reason) { - - String backupTable = "egf_deletedtxn"; - - String obName = entity.getClass().getSimpleName(); - List identifierFields = allIdentitiferFields.get(obName); - List> batchValues = new ArrayList<>(); - - batchValues.add(paramValues(entity, allIdentitiferFields.get(obName))); - Map paramValues = new LinkedHashMap<>(); - Collection values = batchValues.get(0).values(); - for (Object value : values) { - if (value == null) - throw new RuntimeException("id field is null . Delete cannot be performed"); - } - - String table = ""; - try { - table = FieldUtils.readDeclaredField(entity, "TABLE_NAME").toString(); - } catch (IllegalAccessException e) { - throw new RuntimeException("Not able to get Table_name from entity" + obName); - } - paramValues.put("tablename", table); - paramValues.put("reason", reason); - - batchValues.get(0).putAll(paramValues); - StringBuffer backupQuery = new StringBuffer(); - StringBuffer deleteQuery = new StringBuffer(); - backupQuery.append( - "insert into " + backupTable + " select '1',:tablename,id,tenantid,:reason,row_to_json(" + table + "),now() " - + " from " + table + " where tenantid=:tenantId and id=:id "); - System.out.println("query.............." + backupQuery); - namedParameterJdbcTemplate.batchUpdate(backupQuery.toString(), batchValues.toArray(new Map[batchValues.size()])); - deleteQuery.append("delete from " + table + " where "); - int i = 0; - for (String s : identifierFields) { - if (i != 0) - deleteQuery.append(" and "); - if (s.equalsIgnoreCase("tenantId")) { - - deleteQuery.append(s).append("=").append(":").append(s); - // implement fallback here - paramValues.put(s, getValue(getField(entity, s), entity)); - continue; - } - if (getValue(getField(entity, s), entity) != null) { - - deleteQuery.append(s).append("=").append(":").append(s); - paramValues.put(s, getValue(getField(entity, s), entity)); - } - i++; - } - - batchValues.get(0).putAll(paramValues); - - namedParameterJdbcTemplate.batchUpdate(deleteQuery.toString(), batchValues.toArray(new Map[batchValues.size()])); - - // paramValues.put("fieldValue", getValue(getField(ob,fieldName ), ob)); - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/queue/HashMapDeserializer.java b/business-services/egf-master/src/main/java/org/egov/common/queue/HashMapDeserializer.java deleted file mode 100644 index f2553917830..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/queue/HashMapDeserializer.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.common.queue; - -import java.util.HashMap; - -import org.springframework.kafka.support.serializer.JsonDeserializer; -import org.springframework.stereotype.Service; - -@Service -public class HashMapDeserializer extends JsonDeserializer { - - public HashMapDeserializer() { - super(HashMap.class); - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/util/ApplicationThreadLocals.java b/business-services/egf-master/src/main/java/org/egov/common/util/ApplicationThreadLocals.java deleted file mode 100644 index 8e4bfd4ecd0..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/util/ApplicationThreadLocals.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.egov.common.util; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.User; -import org.egov.egf.master.web.contract.RequestInfoWrapper; - -import java.util.ArrayList; -import java.util.List; - - -public class ApplicationThreadLocals { - - private static ThreadLocal tenantId = new ThreadLocal<>(); - private static ThreadLocal fallBackTenantId = new ThreadLocal<>(); - private static ThreadLocal user = new ThreadLocal<>(); - private static ThreadLocal requestInfo = new ThreadLocal<>(); - private static ThreadLocal requestInfoWrapper = new ThreadLocal<>(); - - public static ThreadLocal getTenantId() { - return tenantId; - } - - public static void setTenantId(String tenantId) { - ThreadLocal threadLocal = new ThreadLocal(); - threadLocal.set(tenantId); - ApplicationThreadLocals.tenantId = threadLocal; - threadLocal = new ThreadLocal(); - String str = tenantId; - /* in.ap.kurnool should result in - in,in.ap,in.ap.kurnool*/ - List tenants = new ArrayList<>(); - while (str != null && str.lastIndexOf(".") != -1) { - tenants.add(str); - str = str.substring(0, str.lastIndexOf(".")); - } - if (str != null) - tenants.add(str); - if (!tenants.contains("default")) - tenants.add("default"); - threadLocal.set(tenantId); - System.out.print(tenants); - ApplicationThreadLocals.fallBackTenantId = threadLocal; - } - - public static ThreadLocal getUser() { - return user; - } - - public static void setUser(ThreadLocal user) { - ApplicationThreadLocals.user = user; - } - - public static ThreadLocal getRequestInfo() { - return requestInfo; - } - - public static void setRequestInfo(final RequestInfo requestInfo) { - ThreadLocal threadLocal = new ThreadLocal(); - threadLocal.set(requestInfo); - ApplicationThreadLocals.requestInfo = threadLocal; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - threadLocal = new ThreadLocal(); - threadLocal.set(requestInfoWrapper); - ApplicationThreadLocals.requestInfoWrapper = threadLocal; - } - - public static void clearValues() { - tenantId.remove(); - fallBackTenantId.remove(); - requestInfo.remove(); - requestInfoWrapper.remove(); - user.remove(); - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/util/ElasticSearchUtils.java b/business-services/egf-master/src/main/java/org/egov/common/util/ElasticSearchUtils.java deleted file mode 100644 index e4d531461ea..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/util/ElasticSearchUtils.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.egov.common.util; - -import static org.elasticsearch.index.query.QueryBuilders.termsQuery; - -import java.util.List; - -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.stereotype.Service; - -@Service -public class ElasticSearchUtils { - - public void add(Object fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder = boolQueryBuilder.filter(termsQuery(field, fieldValue)); - } - - } - - public void in(List fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder.filter(QueryBuilders.termsQuery(field, fieldValue)); - } - - } - - public void gte(Object fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder = boolQueryBuilder.filter(QueryBuilders.rangeQuery(field).from(fieldValue)); - } - - } - - public void lte(Object fieldValue, String field, BoolQueryBuilder boolQueryBuilder) { - if (fieldValue != null) { - boolQueryBuilder = boolQueryBuilder.filter(QueryBuilders.rangeQuery(field).to(fieldValue)); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/AttributeContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/AttributeContract.java deleted file mode 100644 index 0a9ff9eca49..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/AttributeContract.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.egov.common.web.contract; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; - -@AllArgsConstructor -@NoArgsConstructor -@Getter -public class AttributeContract { - - public static final String DATATYPE = "String"; - @JsonProperty("variable") - private Boolean variable; - - @JsonProperty("code") - private String code; - - @JsonProperty("datatype") - private String datatype; - - @JsonProperty("required") - private Boolean required; - - @JsonProperty("datatypeDescription") - private String datatypeDescription; - - @JsonProperty("values") - private List values; - - public static AttributeContract asStringAttr(String code, String value) { - List valueList = new ArrayList<>(); - valueList.add(new ValueContract(code, value)); - return new AttributeContract(Boolean.TRUE, code, DATATYPE, Boolean.FALSE, StringUtils.EMPTY, valueList); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/AuditableContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/AuditableContract.java deleted file mode 100644 index c3ea989964a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/AuditableContract.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.egov.common.web.contract; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.egov.common.contract.request.User; - -import java.util.Date; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -public class AuditableContract { - protected String tenantId; - protected User createdBy; - protected User lastModifiedBy; - protected Date createdDate; - protected Date lastModifiedDate; - protected String deleteReason; - - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/DeletedTransactionContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/DeletedTransactionContract.java deleted file mode 100644 index 6578b1df310..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/DeletedTransactionContract.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.egov.common.web.contract; - - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import java.util.Date; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -public class DeletedTransactionContract { - - - protected String id; - - protected String tableName; - - protected String identifier; - - protected String deleteReason; - - protected Date updatedDate; - - protected String data; - - protected String tenantId; -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/DepartmentDesignationContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/DepartmentDesignationContract.java deleted file mode 100644 index 36810034867..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/DepartmentDesignationContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.common.web.contract; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Data; - -@Data -public class DepartmentDesignationContract { - - private Long id; - - @JsonProperty("department") - private Long departmentId; - - private DesignationContract designation; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/DesignationContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/DesignationContract.java deleted file mode 100644 index 59fe679544b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/DesignationContract.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.egov.common.web.contract; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import lombok.Data; - -@Data -public class DesignationContract { - - @NotNull - private Long id; - - @NotNull - @Size(min = 3, max = 100) - private String name; - - @NotNull - @Size(min = 3, max = 20) - private String code; - - @Size(max = 250) - private String description; - - private String chartOfAccounts; - - @NotNull - private Boolean active; - - @NotNull - private String tenantId; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/Error.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/Error.java deleted file mode 100644 index 3b4c150501a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/Error.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.common.web.contract; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.validation.FieldError; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.Data; - -@JsonPropertyOrder({ "code", "message", "description" ,"params"}) -public @Data class Error { - - private String code ; - - private String message ; - - private String description ; - - private List params=new ArrayList<>(); - - public Error(String code, String message, String description) { - super(); - this.code = code; - this.message = message; - this.description = description; - } - - public Error() { - // TODO Auto-generated constructor stub - } - - public Error(String code, String message, String description, List params) { - super(); - this.code = code; - this.message = message; - this.description = description; - this.params = params; - } - - - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ErrorResponse.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/ErrorResponse.java deleted file mode 100644 index b078be37c23..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ErrorResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.egov.common.web.contract; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@Builder -@EqualsAndHashCode -public class ErrorResponse { - private ResponseInfo responseInfo; - private List errors=new ArrayList<>(); -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/PaginationContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/PaginationContract.java deleted file mode 100644 index acc54db6779..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/PaginationContract.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.common.web.contract; - -import javax.validation.constraints.Max; - -import org.egov.common.domain.model.Pagination; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@AllArgsConstructor -@NoArgsConstructor -@Data -public class PaginationContract { - - public static int DEFAULT_PAGE_SIZE = 500; - public static int DEFAULT_PAGE_OFFSET = 0; - - private Integer totalResults; - - private Integer totalPages; - - @Max(500l) - private Integer pageSize; - - private Integer currentPage; - - private Integer offset; - - public PaginationContract(Pagination page) { - this.pageSize = page.getPageSize(); - this.currentPage = page.getCurrentPage(); - this.offset = page.getOffset(); - this.totalPages = page.getTotalPages(); - this.totalResults = page.getTotalResults(); - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/PositionContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/PositionContract.java deleted file mode 100644 index c074a798d2f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/PositionContract.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.common.web.contract; - -import lombok.Data; - -@Data -public class PositionContract { - - private Long id; - - private String name; - - private DepartmentDesignationContract deptdesig; - - private Boolean isPostOutsourced; - - private Boolean active; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstance.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstance.java deleted file mode 100644 index 00b2e8575a6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstance.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.egov.common.web.contract; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AttributeContract; -import org.egov.common.web.contract.PositionContract; -import org.egov.common.web.contract.TaskContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonFormat; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Setter -@Getter -@AllArgsConstructor -@Builder -@NoArgsConstructor -public class ProcessInstance { - - /** - * Id of the ProcessInstance gets created. This field Maps to Id of the Task in case of eGov internal Work flow or the Work - * flow Matrix based Implementation. - */ - - private String id = null; - - /** - * businessKey is the name representing the process flow of the a particular Item For example For Financial vouchers work flow - * process may be defined with a businessKey of "voucher_workflow" . For eGov internal work flow Implementation it is same as - * the class name of the java object under going work flow. example businessKey "Voucher" - */ - @Length(max = 128, min = 1) - @NotNull - private String businessKey = null; - /** - * type field can be used to further divide the work flow processes. For example Voucher might have 4 different flows 1. - * Expense Work flow 2. Contractor Journal Work flow 3. Supplier Journal Work flow 4. General JV Work flow Each process is - * different .Another example is Property might have different flows like 1.Create,Transfer,Bifurcation,Update etc. - */ - @Length(max = 128, min = 1) - private String type = null; - /** - * assignee is the position of the user to be set while creating a instantiating of Process. For Automatic work flow this - * comes from the process definition for manual work flow it is the position selected from the UI. - */ - @NotNull - private PositionContract assignee = null; - - /** - * comments is the comment provided by the user while he is initiating a process - */ - @Length(max = 1024, min = 1) - private String comments = null; - /** - * createDate is the date on which the process is instantiated. This is set internally by the system . For clients it is read - * only data - */ - @JsonFormat(pattern = "dd/MM/yyyy") - private Date createdDate = null; - - /** - * lastupdatedSince is the date on which the process is updated last time. This is set internally by the system . For clients - * it is read only data - */ - @JsonFormat(pattern = "dd/MM/yyyy") - private Date lastupdatedSince = null; - - /** - * owner gives the Position current owner of the process. This data is only for the display purpose. So it will not be - * considered in the request . - */ - private PositionContract owner = null; - - /** - * state gives the current state of the process. - */ - - @Length(max = 128, min = 1) - private String state = null; - - /** - * status also another representation of the status of the process - */ - @Length(max = 128, min = 1) - private String status = null; - - /** - * senderName represents who initiated the work flow process. This is the logged in users primary position . Also this is set - * by system by taking the logged in users primary position. - */ - @Length(max = 128, min = 1) - private String senderName; - - /** - * details provides more information on the processs/Task instance. Example : In voucher work flow it is VoucherNumber, - * Property it is the propertyId ,Grievance it is the complaint or request number This data is set internally by the system - * which is configured in work flow type - */ - - @Length(max = 128, min = 1) - private String details; - - /** - * tasks gives the list of tasks owned by the process. For eGov internal work flow this value will be empty. - * - */ - - List tasks = new ArrayList(); - - private String tenantId; - /** - * attributes used to pass any additional properties which is not defined in here . - */ - private Map attributes = new HashMap(); - - private Long initiatorPosition; - - /* - * @JsonIgnore public String getComments() { return getValueForKey("approvalComments"); } - * @JsonIgnore public boolean isGrievanceOfficer() { return getValueForKey("userRole").equals("Grievance Officer"); } - */ - /* - * public void setStateId(Long stateId) { Value value = new Value("stateId", String.valueOf(stateId)); List - * attributeValues = Collections.singletonList(value); Attribute attribute = new Attribute(true, "stateId", "String", true, - * "This is the id of state", attributeValues,null); attributeValues.put("stateId", attribute); } - */ - // To be used to fetch single value attributes - public String getValueForKey(final String key) { - if (Objects.nonNull(attributes) && Objects.nonNull(attributes.get(key))) - return attributes.get(key).getValues().get(0).getName(); - - return ""; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstanceRequest.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstanceRequest.java deleted file mode 100644 index d95c787fdf2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstanceRequest.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.common.web.contract; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; - -import lombok.Data; - -public @Data class ProcessInstanceRequest { - - private RequestInfo requestInfo = new RequestInfo(); - - private List processInstances = new ArrayList(); - - private ProcessInstance processInstance = new ProcessInstance(); - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstanceResponse.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstanceResponse.java deleted file mode 100644 index ff7e4e68f78..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ProcessInstanceResponse.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.egov.common.web.contract; - -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class ProcessInstanceResponse { - - private ResponseInfo responseInfo; - - private List processInstances; - - private ProcessInstance processInstance; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/RequestContext.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/RequestContext.java deleted file mode 100644 index 86e784582cd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/RequestContext.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.common.web.contract; - -public class RequestContext { - - public static String CORRELATION_ID = "X-CORRELATION-ID"; - - private static final ThreadLocal id = new ThreadLocal<>(); - - public static String getId() { - return id.get(); - } - - public static void setId(String correlationId) { - id.set(correlationId); - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskContract.java deleted file mode 100644 index 44339af6da6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskContract.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.egov.common.web.contract; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.*; -import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; - -import javax.validation.constraints.NotNull; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class TaskContract { - - /** - * Id of the task getting updated. This field Maps to Id of the Task or - * ProcessInstance in case of eGov internal Work flow or the Work flow - * Matrix based implementation . - */ - @NotNull - private String id = null; - - /** - * businessKey is the name representing the process flow of the a particular - * Item For example For Financial vouchers work flow process may be defined - * with a businessKey of "voucher_workflow" . For eGov internal work flow - * Implementation it is same as the class name of the java object under - * going work flow. example businessKey "Voucher" - */ - @Length(max = 128, min = 1) - @NotNull - private String businessKey = null; - /** - * type field can be used to further divide the work flow processes. For - * example Voucher might have 4 different flows 1. Expense Work flow 2. - * Contractor Journal Work flow 3. Supplier Journal Work flow 4. General JV - * Work flow Each process is different .Another example is Property might - * have different flows like 1.Create,Transfer,Bifurcation,Update etc. - */ - @Length(max = 128, min = 1) - private String type = null; - /** - * assignee is the position of the user to be set while creating a - * instantiating of Process. For Automatic work flow this comes from the - * process definition for manual work flow it is the position selected from - * the UI. - */ - @NotNull - private PositionContract assignee = null; - - /** - * comments is the comment provided by the user while he is initiating a - * process - */ - @Length(max = 1024, min = 1) - private String comments = null; - /** - * createDate is the date on which the process is instantiated. This is set - * internally by the system . For clients it is read only data - */ - @JsonFormat(pattern = "dd/MM/yyyy") - private Date createdDate = null; - - /** - * lastupdatedSince is the date on which the process is updated last time. - * This is set internally by the system . For clients it is read only data - */ - @JsonFormat(pattern = "dd/MM/yyyy") - private Date lastupdatedSince = null; - - /** - * owner gives the Position current owner of the process. This data is only - * for the display purpose. So it will not be considered in the request . - */ - private PositionContract owner = null; - - /** - * state gives the current state of the process. - */ - - @Length(max = 128, min = 1) - private String state = null; - - /** - * status also another representation of the status of the process - */ - @Length(max = 128, min = 1) - private String status = null; - /** - * url provides the complete url of the work flow item. This link takes you - * to the view of the item along with provision to select the next assignee. - * This data is also configured in work flow type object. This data is also - * read only . UI Can consider this field to redirect to the page or UI can - * be build without consuming this. - */ - @Length(max = 256, min = 1) - private String url = null; - /** - * action represents the action performed by the end user . it can be - * forward,approve,reject,cancel etc For eGov internal work flow these four - * values are confirmed and will do the tasks of - * forwarding,approving,rejecting,cancelling accordingly. This is mandatory - * data in case of manual work flow - */ - @NotBlank - @Length(max = 128, min = 1) - private String action = null; - - /** - * senderName represents who initiated the work flow process. This is the - * logged in users primary position . Also this is set by system by taking - * the logged in users primary position. - */ - - @Length(max = 128, min = 1) - private String senderName; - - /** - * details provides more information on the processs/Task instance. Example - * : In voucher work flow it is VoucherNumber, Property it is the propertyId - * ,Grievance it is the complaint or request number This data is set - * internally by the system which is configured in work flow type - */ - - @Length(max = 128, min = 1) - private String details; - /** - * natureOfTask Detaild Description of the task or process . For example in - * case of voucher it can be set as "Finaicial Voucher Workflow " . This - * data is also configured by the display name of the workflowtype object. - * This data is read only. . - */ - @Length(max = 128, min = 1) - private String natureOfTask; - /** - * entity Maps to the json representation of the item under workflow. This - * will be used when work flow considers rule engine. like amount based flow - * etc - */ - private String entity; - - private String tenantId; - - private Map attributes = new HashMap(); - - // To be used to fetch single value attributes - public String getValueForKey(final String key) { - if (Objects.nonNull(attributes) && Objects.nonNull(attributes.get(key))) - return attributes.get(key).getValues().get(0).getName(); - - return ""; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskRequest.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskRequest.java deleted file mode 100644 index dc3e088ec51..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskRequest.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.common.web.contract; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.web.contract.TaskContract; - -import lombok.Data; - -public @Data class TaskRequest { - - private RequestInfo requestInfo = new RequestInfo(); - - private List tasks = new ArrayList(); - - private TaskContract task = new TaskContract(); - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskResponse.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskResponse.java deleted file mode 100644 index 2ee7a118f1c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/TaskResponse.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.egov.common.web.contract; - -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.web.contract.TaskContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class TaskResponse { - - private ResponseInfo responseInfo; - - private List tasks; - - private TaskContract task; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ValueContract.java b/business-services/egf-master/src/main/java/org/egov/common/web/contract/ValueContract.java deleted file mode 100644 index 83539ced044..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/contract/ValueContract.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.common.web.contract; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -public class ValueContract { - - @JsonProperty("key") - private String key = null; - - @JsonProperty("name") - private String name = null; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/interceptor/CorrelationIdAwareRestTemplate.java b/business-services/egf-master/src/main/java/org/egov/common/web/interceptor/CorrelationIdAwareRestTemplate.java deleted file mode 100644 index 1fe9684301e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/interceptor/CorrelationIdAwareRestTemplate.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.egov.common.web.interceptor; - -import java.util.Collections; -import java.util.List; - -import org.egov.common.web.contract.RequestContext; -import org.springframework.http.HttpHeaders; -import org.springframework.http.client.ClientHttpRequestInterceptor; -import org.springframework.web.client.RestTemplate; - -public class CorrelationIdAwareRestTemplate extends RestTemplate { - - public CorrelationIdAwareRestTemplate() { - this.setInterceptors(customInterceptors()); - } - - private List customInterceptors() { - return Collections.singletonList(correlationIdInterceptor()); - } - - private ClientHttpRequestInterceptor correlationIdInterceptor() { - return (httpRequest, bytes, clientHttpRequestExecution) -> { - final HttpHeaders headers = httpRequest.getHeaders(); - headers.put(RequestContext.CORRELATION_ID, Collections.singletonList(RequestContext.getId())); - - return clientHttpRequestExecution.execute(httpRequest, bytes); - }; - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/common/web/interceptor/CorrelationIdInterceptor.java b/business-services/egf-master/src/main/java/org/egov/common/web/interceptor/CorrelationIdInterceptor.java deleted file mode 100644 index 5e3b520d894..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/common/web/interceptor/CorrelationIdInterceptor.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.egov.common.web.interceptor; - -import java.util.UUID; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.egov.common.web.contract.RequestContext; -import org.slf4j.MDC; -import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; - -public class CorrelationIdInterceptor extends HandlerInterceptorAdapter { - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) - throws Exception { - - final String correlationId = getCorrelationId(request); - MDC.put(RequestContext.CORRELATION_ID, correlationId); - RequestContext.setId(correlationId); - return super.preHandle(request, response, handler); - } - - private String getCorrelationId(HttpServletRequest request) { - final String incomingCorrelationId = request.getHeader(RequestContext.CORRELATION_ID); - return incomingCorrelationId == null ? UUID.randomUUID().toString() : incomingCorrelationId; - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BankAccountType.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BankAccountType.java deleted file mode 100644 index 4187dfac00f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BankAccountType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.enums; - -public enum BankAccountType { - RECEIPTS, PAYMENTS, RECEIPTS_PAYMENTS -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BudgetAccountType.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BudgetAccountType.java deleted file mode 100644 index 3a3177124ce..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BudgetAccountType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.enums; - -public enum BudgetAccountType { - REVENUE_RECEIPTS, REVENUE_EXPENDITURE, CAPITAL_RECEIPTS, CAPITAL_EXPENDITURE -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BudgetingType.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BudgetingType.java deleted file mode 100644 index 9ad9c8b2f02..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/enums/BudgetingType.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.egov.egf.master.domain.enums; - -public enum BudgetingType { - ALL, DEBIT, CREDIT -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountCodePurpose.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountCodePurpose.java deleted file mode 100644 index fcd7b355c70..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountCodePurpose.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.annotation.Unique; -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@AllArgsConstructor -@EqualsAndHashCode -@Getter -@NoArgsConstructor -@Setter -@ToString -@Builder -public class AccountCodePurpose extends Auditable { - - private String id; - - @Unique - @NotNull - @Length(max = 256, min = 3) - private String name; -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountCodePurposeSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountCodePurposeSearch.java deleted file mode 100644 index 1d300ae474f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountCodePurposeSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountCodePurposeSearch extends AccountCodePurpose{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailKey.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailKey.java deleted file mode 100644 index 8e26c6b8448..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailKey.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "accountDetailType" }, callSuper = false) - -public class AccountDetailKey extends Auditable { - - private String id; - - @NotNull - private String key; - - @NotNull - private AccountDetailType accountDetailType; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailKeySearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailKeySearch.java deleted file mode 100644 index e99113ec14f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailKeySearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountDetailKeySearch extends AccountDetailKey{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailType.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailType.java deleted file mode 100644 index a3308aabe83..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailType.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder - -public class AccountDetailType extends Auditable { - - private String id; - - @NotNull - @Length(max = 50, min = 1) - private String name; - - @NotNull - @Length(max = 50, min = 1) - private String description; - - @Length(max = 25) - private String tableName; - - @NotNull - private Boolean active; - - @Length(max = 250, min = 1) - private String fullyQualifiedName; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailTypeSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailTypeSearch.java deleted file mode 100644 index 2d947df6170..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountDetailTypeSearch.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.master.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountDetailTypeSearch extends AccountDetailType { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountEntity.java deleted file mode 100644 index 1f7b4ae1bd2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountEntity.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "accountDetailType" }, callSuper = false) - -public class AccountEntity extends Auditable { - - private String id; - - @NotNull - private AccountDetailType accountDetailType; - - @NotNull - @Length(max = 25, min = 1) - private String code; - - @NotNull - @Length(max = 350, min = 1) - private String name; - - @NotNull - private Boolean active; - - @Length(max = 256) - private String description; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountEntitySearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountEntitySearch.java deleted file mode 100644 index 7976cfcb1d8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/AccountEntitySearch.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.master.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountEntitySearch extends AccountEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Bank.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Bank.java deleted file mode 100644 index 68419ab971b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Bank.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -/** - * - * @author mani - * - */ - -/* - * Every ULB need to maintain bank accounts information . May be it is collection information - * or the payment. This is the master list of banks operated by ULB - * - */ -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class Bank extends Auditable { - - /** - * id is unique identifier . It is generated internally - */ - private String id; - - /** - * code is the code of the bank - */ - @NotNull - @Size(max = 50, min = 1) - private String code; - - /** - * name is the Bank Name . - */ - @NotNull - @Size(max = 100, min = 2) - private String name; - - /** - * description more detailed description of the bank - */ - - @Size(max = 250) - private String description; - /** - * active states whether the bank is active in the system or not . - */ - @NotNull - private Boolean active; - - @NotNull - @Size(max = 50) - private String type; - - - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankAccount.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankAccount.java deleted file mode 100644 index 55fa04e9a6f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankAccount.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.egov.egf.master.domain.enums.BankAccountType; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "bankBranch", "chartOfAccount", "fund", "type" }, callSuper = false) - -public class BankAccount extends Auditable { - - private String id; - - @NotNull - private BankBranch bankBranch; - - @NotNull - private ChartOfAccount chartOfAccount; - - @NotNull - private Fund fund; - - @NotNull - @Length(max = 25) - private String accountNumber; - - // is this required ? - private String accountType; - - @Length(max = 256) - private String description; - - @NotNull - private Boolean active; - - @Length(max = 100) - private String payTo; - - @NotNull - private BankAccountType type; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankAccountSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankAccountSearch.java deleted file mode 100644 index 42a7260aed4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankAccountSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankAccountSearch extends BankAccount{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankBranch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankBranch.java deleted file mode 100644 index d8b75d4380c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankBranch.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -/** - * - * @author mani - * - */ -/* - * - * - *This is the master list of bankbranches operated by ULB - */ -@ToString -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "bank" }, callSuper = false) - -public class BankBranch extends Auditable { - - /** - * id is the unique identifier - */ - private String id; - /** - * bank is the bank of the branch - */ - @NotNull - private Bank bank; - - /** - * code is the branch code - */ - @NotNull - @Length(max = 50, min = 1) - private String code; - /** - * name is the branch name - */ - @NotNull - @Length(max = 50, min = 1) - @Pattern(regexp = "^[a-zA-Z0-9_]*$") - private String name; - - /** - * address is the address of the branch - */ - @NotNull - @Length(max = 50, min = 1) - private String address; - - /** - * address2 is the secondary address of the branch - */ - @Length(max = 50) - private String address2; - - /** - * city is the name of the bank branches city - */ - - @Length(max = 50) - private String city; - - /** - * state is the name of the state - */ - - @Length(max = 50) - private String state; - - /** - * pincode is the pincode of the branch - */ - @Length(max = 50) - private String pincode; - - /** - * phone is the phone number of the branch - */ - @Length(max = 15) - private String phone; - - /** - * fax is the fax number of the branch - */ - @Length(max = 15) - private String fax; - - /** - * contactPerson is the name of the person in contact - */ - @Length(max = 50) - private String contactPerson; - - /** - * active states whether branch is active. i.e is usable by the system or not - * if not active it cannot be used - */ - @NotNull - private Boolean active; - - /** - * description is the more detailed description of the branch - */ - @Length(max = 256) - private String description; - - /** - * micr is the micr code of the bank branch - */ - @Length(max = 50) - private String micr; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankBranchSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankBranchSearch.java deleted file mode 100644 index 4b62d09cb51..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankBranchSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankBranchSearch extends BankBranch{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankReconciliation.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankReconciliation.java deleted file mode 100644 index 3a48261749d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankReconciliation.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import java.math.BigDecimal; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "bankAccount" }, callSuper = false) - -public class BankReconciliation extends Auditable { - - private String id; - - private BankAccount bankAccount; - - private BigDecimal amount; - - private String transactionType; - - private String instrumentHeaderId; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankSearch.java deleted file mode 100644 index 7a6bb341ad4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BankSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankSearch extends Bank{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BudgetGroup.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BudgetGroup.java deleted file mode 100644 index d63e0457c19..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BudgetGroup.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import org.egov.common.domain.model.Auditable; -import org.egov.egf.master.domain.enums.BudgetAccountType; -import org.egov.egf.master.domain.enums.BudgetingType; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "majorCode", "maxCode", "minCode", "accountType", "budgetingType" }, callSuper = false) - -public class BudgetGroup extends Auditable { - - private String id; - - @Length(max = 250, min = 1) - private String name; - - @Length(max = 250, message = "Max 250 characters are allowed for description") - private String description; - - private ChartOfAccount majorCode; - - private ChartOfAccount maxCode; - - private ChartOfAccount minCode; - - private BudgetAccountType accountType; - - private BudgetingType budgetingType; - - private Boolean active; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BudgetGroupSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BudgetGroupSearch.java deleted file mode 100644 index a18dfcb1a17..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/BudgetGroupSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BudgetGroupSearch extends BudgetGroup{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccount.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccount.java deleted file mode 100644 index b7d0eaa46cf..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccount.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import java.util.List; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -/** - * - * @author mani - * - */ - -/* - * Account head is mandatory for every financial transaction for appropriate - * classification, balancing as well as reporting. Chart of accounts classified - * in to 3 categories, i.e Major Head, Minor Head and Detailed Head . The same - * structure created for storing of Chart of Accounts in Finance Module.The - * Chart of Accounts are maintained centrally for better control and pass on the - * best practices evenly to all ULBs across the State. - */ -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "accountCodePurpose", "parentId" }, callSuper = false) -public class ChartOfAccount extends Auditable { - - /** - * id is the Unique Identifier . This data is generated internally - */ - private String id; - - /** - * glcode is the Account Code or Account Head in Accounting terms.It may be - * Major head,Minor head or Detailed head.It is numeric examples are - * 1,110,1101,1101001,2,210,21000,210010 - * - * - */ - @NotNull - @Length(max = 16, min = 1) - private String glcode; - /** - * name is the name of the account code . for example 110 glcode has the - * name "Tax Revenue" - */ - @NotNull - @Length(max = 128, min = 5) - private String name; - /** - * accountCodePurpose is the mapped AccountCodePurpose . This mapping can - * happen at any level say Major,minor or detailed. When Account code is - * searched 1. If mapped at major code then it lists major and all other - * codes under that major code 2. If mapped at minor code then it list minor - * code and all other codes under that minor code 3. If mapped at detailed - * code then it lists only that code - */ - - private AccountCodePurpose accountCodePurpose; - - /** - * description is the more detailed description about the account code - */ - @Length(max = 256) - private String description; - - /** - * isActiveForPosting true will be considered for transactions. All - * major,minor codes will be false and only detailed code will be true . - * Further any account code can be disabled for transaction by making this - * field false - */ - @NotNull - private Boolean isActiveForPosting; - - /** - * parentId is the id of other account code in the chart of account .Chart - * of account is created in tree structure. Any code can have other code as - * parent . All minor code will have manjor code as parent . All detailed - * code will have minor code as parent only leaf account code that is which - * is not parent for any account code will used for transactions. - */ - private ChartOfAccount parentId; - - /** - * type is a single character representation of account code type I: Income - * E: Expenditure L: Liability A: Asset Account code for all I start with 1 - * Account code for all E start with 2 Account code for all L start with 3 - * Account code for all A start with 4 - * - * - */ - @NotNull - private Character type; - /** - * classification is internal to the system. This tells whether the code is - * Major ,Minor,Subminor or detailed. Major code classification value is 1 - * Minor code is 2 Subminor code is 3 Detailed code is 4. Only - * classification 4 and is activeforposting=true will be used in - * transactions. Reports can be generated at any level. - */ - @NotNull - private Long classification; - /** - * functionRequired field specifies while transacting with this accountcode - * is the function is mandatory or not . For any account code this field is - * set to true then all transactions expect a fun=ction code to be passed - * along with account code - */ - @NotNull - private Boolean functionRequired; - /** - * budgetCheckRequired field specifies whether budgeting check required for - * this account code. Apart from global Budgetcheck configuration this is - * where glcode wise budget check decision is made. - * - */ - @NotNull - private Boolean budgetCheckRequired; - - /** - * major code is interanlly maintained for faster reporting purpose. if the - * glcode is major code then this value is true . all minor,subminor - * detailed code will have this property as false - */ - @Length(max = 16) - private String majorCode; - - /** - * isSubledger denotes is the account code is control account / Secondary - * account or not . This is created and maintained internal to the system. - * When ever a account code made control account (subledger) this field is - * set to true. This field is ignore even if it is provided. - */ - - private Boolean isSubLedger; - - private List chartOfAccountDetails; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountDetail.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountDetail.java deleted file mode 100644 index 786df660681..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountDetail.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "chartOfAccount", "accountDetailType" }, callSuper = false) - -public class ChartOfAccountDetail extends Auditable { - - private String id; - - @NotNull - private ChartOfAccount chartOfAccount; - - @NotNull - private AccountDetailType accountDetailType; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountDetailSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountDetailSearch.java deleted file mode 100644 index 4c853900d6f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountDetailSearch.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.master.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class ChartOfAccountDetailSearch extends ChartOfAccountDetail { - private String ids; - private String chartOfAccountIds; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountSearch.java deleted file mode 100644 index 0680627cf1a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/ChartOfAccountSearch.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.master.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class ChartOfAccountSearch extends ChartOfAccount { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String glcodes; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/EntityType.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/EntityType.java deleted file mode 100644 index 2c571fd4ffa..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/EntityType.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -/** - * This interface is used to get the subledger(entity) information for the - * implementing classes. - * - * @author eGov - */ -public interface EntityType { - - /** - * To get the bank name for the entity. it's required to generate the bank - * advice for Contractor/supplier/employee - * - * @return - */ - public String getBankname(); - - /** - * To get the bank account no. for the entity. it's required to generate the - * bank advice for Contractor/supplier/employee. - * - * @return - */ - public String getBankaccount(); - - /** - * To get the Pan no. for the entity. it's required to generate the bank - * advice for Contractor/supplier/employee. - * - * @return - */ - public String getPanno(); - - /** - * To get the Tin no. for the entity. it's required to generate the bank - * advice - * - * @return - */ - public String getTinno(); - - /** - * To get the IFSC code for the entity. it's required to generate the bank - * advice - * - * @return - */ - public String getIfsccode(); - - /** - * To get the subledger party name. - * - * @return - */ - public String getName(); - - /** - * To get the mode of payment, to make a payment for the entity possible - * value, Cheque, Cash or RTGS - * - * @return - */ - public String getModeofpay(); - - /** - * To get the code for the entity - * - * @return - */ - public String getCode(); - - /** - * To get The id/detailKeyd for the entity - * - * @return - */ - public Integer getEntityId(); - - /** - * - * @return data to be displayed in reports - */ - public String getEntityDescription(); - - /** - * - * @return status of Entity^M - */ - public FinancialStatus getFinancialStatus(); - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfiguration.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfiguration.java deleted file mode 100644 index f14c007e322..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfiguration.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import java.util.List; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@ToString -public class FinancialConfiguration extends Auditable { - - @NotNull - private String id; - - @Size(min = 3, max = 50) - private String name; - - @NotNull - @Size(min = 3, max = 250) - private String description; - - @NotNull - @Size(min = 3, max = 50) - private String module; - - @NotNull - private List values; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationSearch.java deleted file mode 100644 index e2616920bdb..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialConfigurationSearch extends FinancialConfiguration{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationValue.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationValue.java deleted file mode 100644 index 922a1cf5662..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationValue.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import java.util.Date; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@ToString -@Builder -public class FinancialConfigurationValue extends Auditable { - - @NotNull - private String id; - - @NotNull - private FinancialConfiguration financialConfiguration; - - @NotNull - @Size(min = 1, max = 1000) - private String value; - - @NotNull - private Date effectiveFrom; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationValueSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationValueSearch.java deleted file mode 100644 index 81b3aa0a13a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialConfigurationValueSearch.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.egf.master.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class FinancialConfigurationValueSearch extends FinancialConfigurationValue { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialStatus.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialStatus.java deleted file mode 100644 index 9306ab7168e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialStatus.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.domain.model.Auditable; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@ToString -@Builder -public class FinancialStatus extends Auditable { - - private String id; - - @NotNull - @Size(min = 3, max = 50) - private String moduleType; - - @NotNull - @Size(min = 3, max = 20) - private String code; - - @NotNull - @Size(min = 3, max = 20) - private String name; - - @NotNull - @Size(min = 3, max = 250) - private String description; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialStatusSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialStatusSearch.java deleted file mode 100644 index d614a69c31e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialStatusSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialStatusSearch extends FinancialStatus{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialYear.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialYear.java deleted file mode 100644 index c4d76c43972..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialYear.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotBlank; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -/** - * - * @author mani - * - */ -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -/** - * - * Financial Year is the Accounting year and is a key master setup that defines - * the dates for which the vouchers can be posted. All government bodies in - * India follow a Financial Year cycle of April 1st to March-31st. A financial - * year can have any number of fiscal periods. Each fiscal period must have a - * start and end date. The start date of the first period and end date of the - * last period will be the period of the financial year Dates cannot overlap - * across periods – i.e. any given date cannot be in more than on fiscal period. - * A Financial Year must be Active for posting for vouchers to be posted in that - * financial year. - * - */ -public class FinancialYear extends Auditable { - - /** - * id is the unique identifier. it is generated internally - */ - private String id; - /** - * finYearRange is the name of the Financial Year . for example for - * accounting year 2017 and 2018 it may be named 2017-18 - * - */ - @NotNull - @Length(min = 1, max = 25) - private String finYearRange; - - /** - * startingDate is the date on which Accounting Year starts. Usually it is - * 1st April of that year. - */ - @NotNull - private Date startingDate; - - /** - * endingDate is the date on which Financial Year ends. Usually it is 31st - * march of next year - * - */ - @NotNull - private Date endingDate; - /** - * active says whether Financial Year is active or not . Over a period - * system will have number of Financial years. Reports - * ,searches,transactions will need to display this.If the active value is - * true then Financial Year is listed, if value is false it wont be listed - */ - @NotNull - private Boolean active; - /** - * isActiveForPosting refers whether posting allowed for the Financial Year - * or not . This value will be true for current year and few previous year - * for which data entry will be happening. Once the account is closed this - * value is set to false . All transactions will happen if and only if - * isActiveForPosting is true - */ - - @NotNull - private Boolean isActiveForPosting; - /** - * isClosed refers whether the account is closed or not . Once the account - * is closed and balance is transferred this value is set to false if the - * account is closed no transaction can happen on that financial year. - */ - private Boolean isClosed; - /** - * transferClosingBalance informs whether While closing account balance is - * transferred or not . - */ - private Boolean transferClosingBalance; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialYearSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialYearSearch.java deleted file mode 100644 index 07e4a97714d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FinancialYearSearch.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.egov.egf.master.domain.model; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialYearSearch extends FinancialYear { - private Integer pageSize; - private Integer offset; - private String sortBy; - private Date asOnDate; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FiscalPeriod.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FiscalPeriod.java deleted file mode 100644 index a8f2668fd0b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FiscalPeriod.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -/** - * - * @author mani - * - */ - -/** - * A financial year can have any number of fiscal periods. Each fiscal period - * must have a start and end date. The start date of the first period and end - * date of the last period will be the period of the financial year Dates cannot - * overlap across periods – i.e. any given date cannot be in more than on fiscal - * period. - */ -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "financialYear" }, callSuper = false) -public class FiscalPeriod extends Auditable { - - /** - * id is the unique identifier. it is generated internally - */ - private String id; - - @Length(min = 1, max = 25) - @NotNull - private String name = ""; - - @NotNull - private FinancialYear financialYear; - - /** - * startingDate is the date on which period starts. - */ - @NotNull - private Date startingDate; - - /** - * endingDate is the date on which period ends. - */ - @NotNull - private Date endingDate; - - /** - * active says whether fiscal period is active or not . Over a period system - * will have number of fiscal period. Reports ,searches,transactions will - * need to display this.If the active value is true then fiscal period is - * listed, if value is false it wont be listed - */ - - @NotNull - private Boolean active; - - /** - * isActiveForPosting refers whether posting allowed for the fiscal period - * or not . This value will be true for current year and few previous year - * for which data entry will be happening. Once the account is closed this - * value is set to false . All transactions will happen if and only if - * isActiveForPosting is true - */ - @NotNull - private Boolean isActiveForPosting; - - /** - * isClosed refers whether the account is closed or not . Once the account - * is closed and balance is transferred this value is set to false if the - * account is closed no transaction can happen on that fiscal period. - */ - - private Boolean isClosed; -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FiscalPeriodSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FiscalPeriodSearch.java deleted file mode 100644 index 9f75c82b491..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FiscalPeriodSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FiscalPeriodSearch extends FiscalPeriod{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Function.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Function.java deleted file mode 100644 index ac72eb6e903..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Function.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -/** - * @author mani - */ -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.annotation.Unique; -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "parentId" }, callSuper = false) -/** - * - * ULB activates are carried out by the concerned Departments . In each - * department again multiple activities are carried out and these activities are - * grouped as functions .Common functions enabled across all ULBs shall be - * managed in Central Monitoring Cell based on the requirements for addition, - * deletion and modification of functions from the ULBs. - * - */ - -public class Function extends Auditable { - - /** - * id is the unique identifier . - */ - private String id; - - /** - * name is the name of the function . - */ - @Length(max = 128, min = 2) - @NotNull - @Unique - private String name; - - /** - * code is a unique number given to each function . ULBs may refer this for - * the short name. - */ - @Length(max = 16, min = 2) - @NotNull - private String code; - /** - * level identifies what is the level of the function in the tree structure. - * Top most parent will have level 0 and its child will have level as 1 - * - */ - @NotNull - private Integer level; - - /** - * active is a boolean value which says whether function is in use or not . - * If Function is active, then accounting of transactions under the Function - * is enabled. If Function becomes inactive, and no transactions can be - * accounted under the Function. Only leaf function can be used in - * transaction ie function which is not parent to any other function - */ - @NotNull - private Boolean active; - - private Function parentId; - - public void add() { - if (parentId == null) { - level = 0; - - } else { - level = parentId.getLevel() + 1; - } - } - - public void update() { - if (parentId == null) { - level = 0; - - } else { - level = parentId.getLevel() + 1; - } - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FunctionSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FunctionSearch.java deleted file mode 100644 index 42c47903833..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FunctionSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FunctionSearch extends Function{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Functionary.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Functionary.java deleted file mode 100644 index 922dce161b5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Functionary.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -/** - * - * @author mani - * - */ -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -/* - * Functionary is considered as another cost center. In the government set-up, - * demands for expenditure are drawn by the department discharging the functions - * and become the responsibility center for the assigned functions. Functionary - * group represents this. Each sub-level within this group typically can - * represent the organisational structure within the ULB. This level is used - * only for the internal control of the ULB. - */ -public class Functionary extends Auditable { - - /** - * id is the unique identifier and it is generated internally - */ - private String id; - - /** - * code is uniue identifier and ULB may refer this for short name. - */ - @NotNull - @Length(max = 16, min = 1) - private String code; - - /** - * name is the name of the functionary - */ - @NotNull - @Length(max = 256, min = 1) - private String name; - - /** - * active states whether the functionary is active or not . Only active - * functionaries will be used in transaction - */ - @NotNull - private Boolean active; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FunctionarySearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FunctionarySearch.java deleted file mode 100644 index 4f3cdd93d50..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FunctionarySearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FunctionarySearch extends Functionary{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Fund.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Fund.java deleted file mode 100644 index 0cdac81428c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Fund.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; -import org.springframework.stereotype.Service; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -/** - * @author mani - */ -@AllArgsConstructor -@NoArgsConstructor -@Service -@Builder -@Getter -@Setter -@EqualsAndHashCode(exclude = { "parent" }, callSuper = false) - -/** - * - * Fund is a defining concept in municipal accounting – where it is required to - * segregate all accounting transactions into designated funds. Each fund needs - * to be treated as an independent accounting entity – in other words, all - * vouchers within a fund must be self-balancing and balance sheets and - * Income/Expenditure reports must be generated for each fund. A hierarchy of - * funds may be defined – i.e. each fund can have multiple sub-funds and so on. - */ - -public class Fund extends Auditable { - - /** - * id is the unique field . - */ - protected String id; - - /** - * name is the name of the fund . Example :Municipal Fund,Capital Fund. Also - * name is unique. - */ - @Length(max = 50, min = 2) - @NotNull - protected String name; - - /** - * code is a unique number given to each fund . ULB may refer this for the - * short name - */ - @Length(max = 50, min = 2) - @NotNull - protected String code; - /** - * identifier appears as prefix in all the vouchers accounted in the books - * of the Fund. Each fund must have an identifier – each voucher belonging - * to a fund must have the identifier embedded in the voucher number for - * easy identification. Fund is taken at a voucher head level for each - * voucher transaction. - */ - @NotNull - protected Character identifier; - - /** - * parent adding a parent will create the fund as a sub-fund (child) of a - * fund already created (parent fund). - * - */ - protected Fund parent; - /** - * active is a boolean value which says whether fund is in use or not . If - * Fund is active, then accounting of transactions under the fund is - * enabled. If Fund becomes inactive, and no transactions can be accounted - * under the Fund. - */ - @NotNull - protected Boolean active; - - /** - * isParent is updated internally so that system can identify whether the - * fund is parent or child. Only child which is not parent for any other - * fund can only participate in transaction . - */ - - protected Boolean isParent; - - /** - * level identifies what is the level of the fund in the tree structure. Top - * most parent will have level 0 and its child will have level as 1 - * - */ - - @NotNull - protected Long level; - - public void add() { - if (parent == null) { - level = 0l; - - } else { - level = parent.getLevel() + 1; - } - } - - public void update() { - if (parent == null) { - level = 0l; - - } else { - level = parent.getLevel() + 1; - } - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FundSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FundSearch.java deleted file mode 100644 index a18e20cccdd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FundSearch.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.egov.egf.master.domain.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class FundSearch extends Fund { - - private Date fromDate; - - private Integer pageSize; - - private Integer offset; - - private String sortBy; - - private List ids = new ArrayList(); - - private Integer fromIndex; - - public boolean isPaginationCriteriaPresent() { - return fromIndex != null && pageSize != null; - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Fundsource.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Fundsource.java deleted file mode 100644 index b776c23ca6c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Fundsource.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import java.math.BigDecimal; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "fundSource" }, callSuper = false) - -public class Fundsource extends Auditable { - - private String id; - - @Length(min = 1, max = 25) - @NotNull - private String code; - - @Length(min = 1, max = 25) - @NotNull - private String name; - - @Length(min = 1, max = 25) - private String type; - - private Fundsource parent; - - private BigDecimal llevel; - - @NotNull - private Boolean active; - - // is this required - private Boolean isParent; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FundsourceSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FundsourceSearch.java deleted file mode 100644 index 686f7704748..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/FundsourceSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FundsourceSearch extends Fundsource{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Recovery.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Recovery.java deleted file mode 100644 index 9d7ef038b91..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Recovery.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.domain.model; - -import lombok.*; -import org.egov.common.domain.model.Auditable; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.hibernate.validator.constraints.Length; -import org.springframework.stereotype.Service; - -import javax.validation.constraints.NotNull; - -@AllArgsConstructor -@NoArgsConstructor -@Service -@Builder -@Getter -@Setter -public class Recovery extends Auditable { - - protected String id; - - @Length(max = 50, min = 2) - @NotNull - protected String name; - - @Length(max = 50, min = 2) - @NotNull - protected String code; - - @NotNull - protected ChartOfAccount chartOfAccount; - - protected String type; - - protected Double flat; - - protected Double percentage; - - @NotNull - protected Boolean active; - - @Length(max = 100) - protected String remitted; - - @Length(max = 16) - protected String ifscCode; - - protected Character mode; - - protected Character remittanceMode; - - @Length(max = 32) - protected String accountNumber; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/RecoverySearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/RecoverySearch.java deleted file mode 100644 index 424032795a1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/RecoverySearch.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.egov.egf.master.domain.model; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class RecoverySearch extends Recovery { - - private Integer pageSize; - - private Integer offset; - - private String sortBy; - - private List ids = new ArrayList(); - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Scheme.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Scheme.java deleted file mode 100644 index 81913ff45ce..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Scheme.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "fund" }, callSuper = false) -public class Scheme extends Auditable { - - private String id; - - private Fund fund; - - @Length(max = 25, min = 1) - private String code; - - @Length(max = 25, min = 1) - private String name; - - @NotNull - private Date validFrom; - - @NotNull - private Date validTo; - - @NotNull - private Boolean active; - - @Length(max = 256) - private String description; - - private String boundary; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SchemeSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SchemeSearch.java deleted file mode 100644 index f9e3b92569f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SchemeSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SchemeSearch extends Scheme{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SubScheme.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SubScheme.java deleted file mode 100644 index a86a6acf3b5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SubScheme.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "scheme" }, callSuper = false) - -public class SubScheme extends Auditable { - - private String id; - - @NotNull - private Scheme scheme; - - @NotNull - @Length(max = 50, min = 1) - private String code; - - @NotNull - @Length(max = 50, min = 1) - private String name; - - @NotNull - private Date validFrom; - - @NotNull - private Date validTo; - - @NotNull - private Boolean active; - - private String departmentId; - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SubSchemeSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SubSchemeSearch.java deleted file mode 100644 index b0a1e6bbc2b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SubSchemeSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SubSchemeSearch extends SubScheme{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Supplier.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Supplier.java deleted file mode 100644 index ba574865434..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/Supplier.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.domain.model; - -import javax.validation.constraints.NotNull; - -import org.egov.common.domain.model.Auditable; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@EqualsAndHashCode(exclude = { "bank", "bankAccount" }, callSuper = false) -public class Supplier extends Auditable { - - private String id; - - @NotNull - @Length(max = 50, min = 1) - private String code; - - @NotNull - @Length(max = 50, min = 1) - private String name; - - @Length(max = 300) - private String address; - - @Length(max = 10) - private String mobile; - - @Length(max = 25) - private String email; - - @Length(max = 250) - private String description; - @NotNull - private Boolean active; - - @Length(max = 10) - private String panNo; - - @Length(max = 20) - private String tinNo; - - @Length(max = 25) - private String registationNo; - - private BankAccount bankAccount; - - @Length(max = 12) - private String ifscCode; - - private Bank bank; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SupplierSearch.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SupplierSearch.java deleted file mode 100644 index 08446b36b56..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/model/SupplierSearch.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.domain.model ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SupplierSearch extends Supplier{ private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountCodePurposeESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountCodePurposeESRepository.java deleted file mode 100644 index dc29f788068..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountCodePurposeESRepository.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.persistence.entity.AccountCodePurposeEntity; -import org.egov.egf.master.web.contract.AccountCodePurposeSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class AccountCodePurposeESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(AccountCodePurposeESRepository.class); - - public AccountCodePurposeESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(AccountCodePurposeSearchContract accountCodePurposeSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(accountCodePurposeSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToAccountCodePurposeList(searchResponse, accountCodePurposeSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToAccountCodePurposeList(SearchResponse searchResponse, - AccountCodePurposeSearchContract accountCodePurposeSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List accountCodePurposes = new ArrayList(); - AccountCodePurpose accountCodePurpose = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - accountCodePurpose = mapper.readValue(hit.getSourceAsString(), AccountCodePurpose.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Exception occurred while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON Mapping Exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO Exception occurred: " + e1.getMessage()); - } - - accountCodePurposes.add(accountCodePurpose); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(accountCodePurposes); - - return page; - } - - private SearchRequestBuilder getSearchRequest(AccountCodePurposeSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), AccountCodePurposeEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchAccountCodePurpose(criteria); - SearchRequestBuilder searchRequestBuilder = esClient - .prepareSearch(AccountCodePurpose.class.getSimpleName().toLowerCase()) - .setTypes(AccountCodePurpose.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountCodePurposeRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountCodePurposeRepository.java deleted file mode 100644 index 55f340654c2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountCodePurposeRepository.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.annotation.Unique; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountCodePurposeEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountCodePurposeJdbcRepository; -import org.egov.egf.master.web.contract.AccountCodePurposeContract; -import org.egov.egf.master.web.contract.AccountCodePurposeSearchContract; -import org.egov.egf.master.web.requests.AccountCodePurposeRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class AccountCodePurposeRepository { - - @Autowired - private AccountCodePurposeJdbcRepository accountCodePurposeJdbcRepository; - @Autowired - private MastersQueueRepository accountCodePurposeQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private AccountCodePurposeESRepository accountCodePurposeESRepository; - - private String persistThroughKafka; - - @Autowired - public AccountCodePurposeRepository(AccountCodePurposeJdbcRepository accountCodePurposeJdbcRepository, - MastersQueueRepository accountCodePurposeQueueRepository, - FinancialConfigurationService financialConfigurationService, - AccountCodePurposeESRepository accountCodePurposeESRepository, - @Value("${persist.through.kafka}") String persistThroughKafka) { - this.accountCodePurposeJdbcRepository = accountCodePurposeJdbcRepository; - this.accountCodePurposeQueueRepository = accountCodePurposeQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.accountCodePurposeESRepository = accountCodePurposeESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - public AccountCodePurpose findById(AccountCodePurpose accountCodePurpose) { - AccountCodePurposeEntity entity = accountCodePurposeJdbcRepository - .findById(new AccountCodePurposeEntity().toEntity(accountCodePurpose)); - return entity.toDomain(); - - } - - public String getNextSequence() { - return accountCodePurposeJdbcRepository.getSequence(AccountCodePurposeEntity.SEQUENCE_NAME); - } - - @Transactional - public AccountCodePurpose save(AccountCodePurpose accountCodePurpose) { - AccountCodePurposeEntity entity = accountCodePurposeJdbcRepository - .create(new AccountCodePurposeEntity().toEntity(accountCodePurpose)); - return entity.toDomain(); - } - - @Transactional - public AccountCodePurpose update(AccountCodePurpose accountCodePurpose) { - AccountCodePurposeEntity entity = accountCodePurposeJdbcRepository - .update(new AccountCodePurposeEntity().toEntity(accountCodePurpose)); - return entity.toDomain(); - } - - @Transactional - public List save(List accountCodePurposes, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountCodePurposeContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountCodePurposeRequest request = new AccountCodePurposeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountCodePurposes(new ArrayList<>()); - - for (AccountCodePurpose account : accountCodePurposes) { - - contract = new AccountCodePurposeContract(); - contract.setCreatedDate(new Date()); - mapper.map(account, contract); - request.getAccountCodePurposes().add(contract); - - } - - addToQue(request); - - return accountCodePurposes; - } else { - - List resultList = new ArrayList<>(); - - for (AccountCodePurpose account : accountCodePurposes) { - - resultList.add(save(account)); - } - - AccountCodePurposeRequest request = new AccountCodePurposeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountCodePurposes(new ArrayList<>()); - - for (AccountCodePurpose account : resultList) { - - contract = new AccountCodePurposeContract(); - contract.setCreatedDate(new Date()); - mapper.map(account, contract); - request.getAccountCodePurposes().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List accountCodePurposes, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountCodePurposeContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountCodePurposeRequest request = new AccountCodePurposeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountCodePurposes(new ArrayList<>()); - - for (AccountCodePurpose account : accountCodePurposes) { - - contract = new AccountCodePurposeContract(); - contract.setCreatedDate(new Date()); - mapper.map(account, contract); - request.getAccountCodePurposes().add(contract); - - } - - addToQue(request); - - return accountCodePurposes; - } else { - - List resultList = new ArrayList(); - - for (AccountCodePurpose account : accountCodePurposes) { - - resultList.add(update(account)); - } - - AccountCodePurposeRequest request = new AccountCodePurposeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountCodePurposes(new ArrayList<>()); - - for (AccountCodePurpose account : resultList) { - - contract = new AccountCodePurposeContract(); - contract.setCreatedDate(new Date()); - mapper.map(account, contract); - request.getAccountCodePurposes().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - public void add(AccountCodePurposeRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountcodepurpose_create", request); - } else { - message.put("accountcodepurpose_update", request); - } - accountCodePurposeQueueRepository.add(message); - } - - public Pagination search(AccountCodePurposeSearch domain) { - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - AccountCodePurposeSearchContract accountCodePurposeSearchContract = new AccountCodePurposeSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, accountCodePurposeSearchContract); - return accountCodePurposeESRepository.search(accountCodePurposeSearchContract); - } else { - return accountCodePurposeJdbcRepository.search(domain); - } - - } - - public void uniqueCheck(AccountCodePurpose accountCodePurpose) { - if (accountCodePurpose.getClass().isAnnotationPresent(Unique.class) == true) { - } - } - - public Boolean uniqueCheck(String fieldName, AccountCodePurpose accountCodePurpose) { - return accountCodePurposeJdbcRepository.uniqueCheck(fieldName, - new AccountCodePurposeEntity().toEntity(accountCodePurpose)); - } - - public void addToQue(AccountCodePurposeRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountcodepurpose_create", request); - } else { - message.put("accountcodepurpose_update", request); - } - accountCodePurposeQueueRepository.add(message); - } - - public void addToSearchQueue(AccountCodePurposeRequest request) { - Map message = new HashMap<>(); - - message.put("accountcodepurpose_persisted", request); - - accountCodePurposeQueueRepository.addToSearch(message); - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailKeyESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailKeyESRepository.java deleted file mode 100644 index 5308c055770..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailKeyESRepository.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.persistence.entity.AccountDetailKeyEntity; -import org.egov.egf.master.web.contract.AccountDetailKeySearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class AccountDetailKeyESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(AccountDetailKeyESRepository.class); - - public AccountDetailKeyESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(AccountDetailKeySearchContract accountCodeKeySearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(accountCodeKeySearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToAccountDetailKeyList(searchResponse, accountCodeKeySearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToAccountDetailKeyList(SearchResponse searchResponse, - AccountDetailKeySearchContract accountCodePurposeSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List accountDetailkeys = new ArrayList(); - AccountDetailKey accountDetailKey = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - accountDetailKey = mapper.readValue(hit.getSourceAsString(), AccountDetailKey.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO Exception occurred: " + e1.getMessage()); - } - - accountDetailkeys.add(accountDetailKey); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(accountDetailkeys); - - return page; - } - - private SearchRequestBuilder getSearchRequest(AccountDetailKeySearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), AccountDetailKeyEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchAccountDetailKey(criteria); - SearchRequestBuilder searchRequestBuilder = esClient - .prepareSearch(AccountDetailKey.class.getSimpleName().toLowerCase()) - .setTypes(AccountDetailKey.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailKeyRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailKeyRepository.java deleted file mode 100644 index 3b8ee1ec7cf..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailKeyRepository.java +++ /dev/null @@ -1,238 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountDetailKeyEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountDetailKeyJdbcRepository; -import org.egov.egf.master.web.contract.AccountDetailKeyContract; -import org.egov.egf.master.web.contract.AccountDetailKeySearchContract; -import org.egov.egf.master.web.requests.AccountDetailKeyRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class AccountDetailKeyRepository { - - @Autowired - private AccountDetailKeyJdbcRepository accountDetailKeyJdbcRepository; - @Autowired - private MastersQueueRepository accountDetailKeyQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private AccountDetailKeyESRepository accountDetailKeyESRepository; - - private String persistThroughKafka; - - @Autowired - public AccountDetailKeyRepository(AccountDetailKeyJdbcRepository accountDetailKeyJdbcRepository, - MastersQueueRepository accountDetailKeyQueueRepository, - FinancialConfigurationService financialConfigurationService, - AccountDetailKeyESRepository accountDetailKeyESRepository, - @Value("${persist.through.kafka}") String persistThroughKafka) { - this.accountDetailKeyJdbcRepository = accountDetailKeyJdbcRepository; - this.accountDetailKeyQueueRepository = accountDetailKeyQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.accountDetailKeyESRepository = accountDetailKeyESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - @Transactional - public List save(List accountDetailKies, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountDetailKeyContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountDetailKeyRequest request = new AccountDetailKeyRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailKeys(new ArrayList<>()); - - for (AccountDetailKey f : accountDetailKies) { - - contract = new AccountDetailKeyContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailKeys().add(contract); - - } - - addToQue(request); - - return accountDetailKies; - } else { - - List resultList = new ArrayList<>(); - - for (AccountDetailKey f : accountDetailKies) { - - resultList.add(save(f)); - } - - AccountDetailKeyRequest request = new AccountDetailKeyRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailKeys(new ArrayList<>()); - - for (AccountDetailKey f : resultList) { - - contract = new AccountDetailKeyContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailKeys().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List accountDetailKies, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountDetailKeyContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountDetailKeyRequest request = new AccountDetailKeyRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailKeys(new ArrayList<>()); - - for (AccountDetailKey f : accountDetailKies) { - - contract = new AccountDetailKeyContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailKeys().add(contract); - - } - - addToQue(request); - - return accountDetailKies; - } else { - - List resultList = new ArrayList<>(); - - for (AccountDetailKey f : accountDetailKies) { - - resultList.add(update(f)); - } - - AccountDetailKeyRequest request = new AccountDetailKeyRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailKeys(new ArrayList<>()); - - for (AccountDetailKey f : resultList) { - - contract = new AccountDetailKeyContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailKeys().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - public void addToQue(AccountDetailKeyRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountdetailkey_create", request); - } else { - message.put("accountdetailkey_update", request); - } - accountDetailKeyQueueRepository.add(message); - } - - public void addToSearchQueue(AccountDetailKeyRequest request) { - Map message = new HashMap<>(); - - message.put("accountdetailkey_persisted", request); - - accountDetailKeyQueueRepository.addToSearch(message); - } - - public AccountDetailKey findById(AccountDetailKey accountDetailKey) { - AccountDetailKeyEntity entity = accountDetailKeyJdbcRepository - .findById(new AccountDetailKeyEntity().toEntity(accountDetailKey)); - return entity.toDomain(); - - } - - public String getNextSequence() { - return accountDetailKeyJdbcRepository.getSequence(AccountDetailKeyEntity.SEQUENCE_NAME); - } - - @Transactional - public AccountDetailKey save(AccountDetailKey accountDetailKey) { - AccountDetailKeyEntity entity = accountDetailKeyJdbcRepository - .create(new AccountDetailKeyEntity().toEntity(accountDetailKey)); - return entity.toDomain(); - } - - @Transactional - public AccountDetailKey update(AccountDetailKey accountDetailKey) { - AccountDetailKeyEntity entity = accountDetailKeyJdbcRepository - .update(new AccountDetailKeyEntity().toEntity(accountDetailKey)); - return entity.toDomain(); - } - - public void add(AccountDetailKeyRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountdetailkey_create", request); - } else { - message.put("accountdetailkey_update", request); - } - accountDetailKeyQueueRepository.add(message); - } - - public Pagination search(final AccountDetailKeySearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - final AccountDetailKeySearchContract accountDetailKeySearchContract = new AccountDetailKeySearchContract(); - final ModelMapper mapper = new ModelMapper(); - mapper.map(domain, accountDetailKeySearchContract); - return accountDetailKeyESRepository.search(accountDetailKeySearchContract); - } else - return accountDetailKeyJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, AccountDetailKey accountDetailKey) { - return accountDetailKeyJdbcRepository.uniqueCheck(fieldName, - new AccountDetailKeyEntity().toEntity(accountDetailKey)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailTypeESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailTypeESRepository.java deleted file mode 100644 index e1fdc8ad590..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailTypeESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.persistence.entity.AccountDetailTypeEntity; -import org.egov.egf.master.web.contract.AccountDetailTypeSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class AccountDetailTypeESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(AccountDetailTypeESRepository.class); - - public AccountDetailTypeESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(AccountDetailTypeSearchContract accountCodeTypeSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(accountCodeTypeSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToAccountDetailTypeList(searchResponse, accountCodeTypeSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToAccountDetailTypeList(SearchResponse searchResponse, - AccountDetailTypeSearchContract accountCodeTypeSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List accountDetailkeys = new ArrayList(); - AccountDetailType accountDetailKey = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - accountDetailKey = mapper.readValue(hit.getSourceAsString(), AccountDetailType.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Exception occurred while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("Json mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - accountDetailkeys.add(accountDetailKey); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(accountDetailkeys); - - return page; - } - - private SearchRequestBuilder getSearchRequest(AccountDetailTypeSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), AccountDetailTypeEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchAccountDetailType(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(AccountDetailType.class.getSimpleName().toLowerCase()) - .setTypes(AccountDetailType.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailTypeRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailTypeRepository.java deleted file mode 100644 index 0580d4a4774..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountDetailTypeRepository.java +++ /dev/null @@ -1,237 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountDetailTypeEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountDetailTypeJdbcRepository; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.contract.AccountDetailTypeSearchContract; -import org.egov.egf.master.web.requests.AccountDetailTypeRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class AccountDetailTypeRepository { - - @Autowired - private AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository; - @Autowired - private MastersQueueRepository accountDetailTypeQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private AccountDetailTypeESRepository accountDetailTypeESRepository; - private String persistThroughKafka; - - @Autowired - public AccountDetailTypeRepository(AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository, - MastersQueueRepository accountDetailTypeQueueRepository, - FinancialConfigurationService financialConfigurationService, - AccountDetailTypeESRepository accountDetailTypeESRepository, - @Value("${persist.through.kafka}") String persistThroughKafka) { - this.accountDetailTypeJdbcRepository = accountDetailTypeJdbcRepository; - this.accountDetailTypeQueueRepository = accountDetailTypeQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.accountDetailTypeESRepository = accountDetailTypeESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - @Transactional - public List save(List accountDetailTypes, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountDetailTypeContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountDetailTypeRequest request = new AccountDetailTypeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailTypes(new ArrayList<>()); - - for (AccountDetailType f : accountDetailTypes) { - - contract = new AccountDetailTypeContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailTypes().add(contract); - - } - - addToQue(request); - - return accountDetailTypes; - } else { - - List resultList = new ArrayList<>(); - - for (AccountDetailType f : accountDetailTypes) { - - resultList.add(save(f)); - } - - AccountDetailTypeRequest request = new AccountDetailTypeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailTypes(new ArrayList<>()); - - for (AccountDetailType f : resultList) { - - contract = new AccountDetailTypeContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailTypes().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List accountDetailTypes, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountDetailTypeContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountDetailTypeRequest request = new AccountDetailTypeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailTypes(new ArrayList<>()); - - for (AccountDetailType f : accountDetailTypes) { - - contract = new AccountDetailTypeContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailTypes().add(contract); - - } - - addToQue(request); - - return accountDetailTypes; - } else { - - List resultList = new ArrayList(); - - for (AccountDetailType f : accountDetailTypes) { - - resultList.add(update(f)); - } - - AccountDetailTypeRequest request = new AccountDetailTypeRequest(); - request.setRequestInfo(requestInfo); - request.setAccountDetailTypes(new ArrayList<>()); - - for (AccountDetailType f : resultList) { - - contract = new AccountDetailTypeContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountDetailTypes().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - public AccountDetailType findById(AccountDetailType accountDetailType) { - AccountDetailTypeEntity entity = accountDetailTypeJdbcRepository - .findById(new AccountDetailTypeEntity().toEntity(accountDetailType)); - return entity.toDomain(); - - } - - public String getNextSequence() { - return accountDetailTypeJdbcRepository.getSequence(AccountDetailTypeEntity.SEQUENCE_NAME); - } - - @Transactional - public AccountDetailType save(AccountDetailType accountDetailType) { - AccountDetailTypeEntity entity = accountDetailTypeJdbcRepository - .create(new AccountDetailTypeEntity().toEntity(accountDetailType)); - return entity.toDomain(); - } - - @Transactional - public AccountDetailType update(AccountDetailType accountDetailType) { - AccountDetailTypeEntity entity = accountDetailTypeJdbcRepository - .update(new AccountDetailTypeEntity().toEntity(accountDetailType)); - return entity.toDomain(); - } - - public void add(AccountDetailTypeRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountdetailtype_create", request); - } else { - message.put("accountdetailtype_update", request); - } - accountDetailTypeQueueRepository.add(message); - } - - public Pagination search(AccountDetailTypeSearch domain) { - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - AccountDetailTypeSearchContract accountCodeTypeSearchContract = new AccountDetailTypeSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, accountCodeTypeSearchContract); - return accountDetailTypeESRepository.search(accountCodeTypeSearchContract); - } else { - return accountDetailTypeJdbcRepository.search(domain); - } - - } - - public void addToQue(AccountDetailTypeRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountdetailtype_create", request); - } else { - message.put("accountdetailtype_update", request); - } - accountDetailTypeQueueRepository.add(message); - } - - public void addToSearchQueue(AccountDetailTypeRequest request) { - Map message = new HashMap<>(); - - message.put("accountdetailtype_persisted", request); - - accountDetailTypeQueueRepository.addToSearch(message); - } - - public boolean uniqueCheck(String fieldName, AccountDetailType accountDetailType) { - return accountDetailTypeJdbcRepository.uniqueCheck(fieldName, - new AccountDetailTypeEntity().toEntity(accountDetailType)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountEntityESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountEntityESRepository.java deleted file mode 100644 index e85009f5d96..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountEntityESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.persistence.entity.AccountEntityEntity; -import org.egov.egf.master.web.contract.AccountEntitySearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class AccountEntityESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(AccountEntityESRepository.class); - - public AccountEntityESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(AccountEntitySearchContract accountEntitySearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(accountEntitySearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToAccountEntityList(searchResponse,accountEntitySearchContract); - } - - - @SuppressWarnings("deprecation") - private Pagination mapToAccountEntityList(SearchResponse searchResponse,AccountEntitySearchContract accountEntitySearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List accountDetailkeys = new ArrayList(); - AccountEntity accountDetailKey=null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - //JSON from file to Object - try { - accountDetailKey = mapper.readValue(hit.getSourceAsString(), AccountEntity.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Exception occurred while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("Json mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - accountDetailkeys.add(accountDetailKey); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(accountDetailkeys); - - return page; - } - - private SearchRequestBuilder getSearchRequest(AccountEntitySearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), AccountEntityEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchAccountEntity(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(AccountEntity.class.getSimpleName().toLowerCase()).setTypes(AccountEntity.class.getSimpleName().toLowerCase()) - ; - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountEntityRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountEntityRepository.java deleted file mode 100644 index 0c4acdf8e71..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/AccountEntityRepository.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountEntityEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountEntityJdbcRepository; -import org.egov.egf.master.web.contract.AccountEntityContract; -import org.egov.egf.master.web.contract.AccountEntitySearchContract; -import org.egov.egf.master.web.requests.AccountEntityRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; - -@Service -public class AccountEntityRepository { - - @Autowired - private AccountEntityJdbcRepository accountEntityJdbcRepository; - - @Autowired - private MastersQueueRepository accountEntityQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private AccountEntityESRepository accountEntityESRepository; - - private String persistThroughKafka; - - @Autowired - public AccountEntityRepository(AccountEntityJdbcRepository accountEntityJdbcRepository, - MastersQueueRepository accountEntityQueueRepository, FinancialConfigurationService financialConfigurationService, - AccountEntityESRepository accountEntityESRepository, @Value("${persist.through.kafka}") String persistThroughKafka) { - this.accountEntityJdbcRepository = accountEntityJdbcRepository; - this.accountEntityQueueRepository = accountEntityQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.accountEntityESRepository = accountEntityESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - @Transactional - public List save(List accountEntities, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountEntityContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountEntityRequest request = new AccountEntityRequest(); - request.setRequestInfo(requestInfo); - request.setAccountEntities(new ArrayList<>()); - - for (AccountEntity f : accountEntities) { - - contract = new AccountEntityContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountEntities().add(contract); - - } - - addToQue(request); - - return accountEntities; - } else { - - List resultList = new ArrayList(); - - for (AccountEntity f : accountEntities) { - - resultList.add(save(f)); - } - - AccountEntityRequest request = new AccountEntityRequest(); - request.setRequestInfo(requestInfo); - request.setAccountEntities(new ArrayList<>()); - - for (AccountEntity f : resultList) { - - contract = new AccountEntityContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountEntities().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List accountEntities, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - AccountEntityContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - AccountEntityRequest request = new AccountEntityRequest(); - request.setRequestInfo(requestInfo); - request.setAccountEntities(new ArrayList<>()); - - for (AccountEntity f : accountEntities) { - - contract = new AccountEntityContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountEntities().add(contract); - - } - - addToQue(request); - - return accountEntities; - } else { - - List resultList = new ArrayList(); - - for (AccountEntity f : accountEntities) { - - resultList.add(update(f)); - } - - AccountEntityRequest request = new AccountEntityRequest(); - request.setRequestInfo(requestInfo); - request.setAccountEntities(new ArrayList<>()); - - for (AccountEntity f : resultList) { - - contract = new AccountEntityContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getAccountEntities().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - - public void addToQue(AccountEntityRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountentity_create", request); - } else { - message.put("accountentity_update", request); - } - accountEntityQueueRepository.add(message); - } - - public void addToSearchQueue(AccountEntityRequest request) { - Map message = new HashMap<>(); - - message.put("accountentity_persisted", request); - - accountEntityQueueRepository.addToSearch(message); - } - - public AccountEntity findById(AccountEntity accountEntity) { - AccountEntityEntity entity = accountEntityJdbcRepository - .findById(new AccountEntityEntity().toEntity(accountEntity)); - return entity.toDomain(); - - } - - public String getNextSequence() { - return accountEntityJdbcRepository.getSequence(AccountEntityEntity.SEQUENCE_NAME); - } - - @Transactional - public AccountEntity save(AccountEntity accountEntity) { - AccountEntityEntity entity = accountEntityJdbcRepository - .create(new AccountEntityEntity().toEntity(accountEntity)); - return entity.toDomain(); - } - - @Transactional - public AccountEntity update(AccountEntity accountEntity) { - AccountEntityEntity entity = accountEntityJdbcRepository - .update(new AccountEntityEntity().toEntity(accountEntity)); - return entity.toDomain(); - } - - public void add(AccountEntityRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("accountentity_create", request); - } else { - message.put("accountentity_update", request); - } - accountEntityQueueRepository.add(message); - } - - public Pagination search(AccountEntitySearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - AccountEntitySearchContract accountEntitySearchContract = new AccountEntitySearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, accountEntitySearchContract); - return accountEntityESRepository.search(accountEntitySearchContract); - } else { - return accountEntityJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, AccountEntity accountEntity) { - return accountEntityJdbcRepository.uniqueCheck(fieldName, new AccountEntityEntity().toEntity(accountEntity)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankAccountESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankAccountESRepository.java deleted file mode 100644 index f9f9401226f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankAccountESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.persistence.entity.BankAccountEntity; -import org.egov.egf.master.web.contract.BankAccountSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class BankAccountESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(BankAccountESRepository.class); - - public BankAccountESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(BankAccountSearchContract bankAccountSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(bankAccountSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToBankAccountList(searchResponse, bankAccountSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToBankAccountList(SearchResponse searchResponse, - BankAccountSearchContract bankAccountSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List bankAccounts = new ArrayList(); - BankAccount bankAccount = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - bankAccount = mapper.readValue(hit.getSourceAsString(), BankAccount.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - bankAccounts.add(bankAccount); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(bankAccounts); - - return page; - } - - private SearchRequestBuilder getSearchRequest(BankAccountSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), BankAccountEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchBankAccount(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(BankAccount.class.getSimpleName().toLowerCase()) - .setTypes(BankAccount.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankAccountRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankAccountRepository.java deleted file mode 100644 index 43565a104bd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankAccountRepository.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.BankAccountEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.BankAccountJdbcRepository; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankAccountSearchContract; -import org.egov.egf.master.web.requests.BankAccountRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class BankAccountRepository { - - @Autowired - private BankAccountJdbcRepository bankAccountJdbcRepository; - - @Autowired - private MastersQueueRepository bankAccountQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private BankAccountESRepository bankAccountESRepository; - - private String persistThroughKafka; - - @Autowired - public BankAccountRepository(BankAccountJdbcRepository bankAccountJdbcRepository, - MastersQueueRepository bankAccountQueueRepository, - FinancialConfigurationService financialConfigurationService, - BankAccountESRepository bankAccountESRepository, - @Value("${persist.through.kafka}") String persistThroughKafka) { - this.bankAccountJdbcRepository = bankAccountJdbcRepository; - this.bankAccountQueueRepository = bankAccountQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.bankAccountESRepository = bankAccountESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - public BankAccount findById(BankAccount bankAccount) { - BankAccountEntity entity = bankAccountJdbcRepository.findById(new BankAccountEntity().toEntity(bankAccount)); - return entity.toDomain(); - - } - - public String getNextSequence() { - return bankAccountJdbcRepository.getSequence(BankAccountEntity.SEQUENCE_NAME); - } - - @Transactional - public BankAccount save(BankAccount bankAccount) { - BankAccountEntity entity = bankAccountJdbcRepository.create(new BankAccountEntity().toEntity(bankAccount)); - return entity.toDomain(); - } - - @Transactional - public BankAccount update(BankAccount bankAccount) { - BankAccountEntity entity = bankAccountJdbcRepository.update(new BankAccountEntity().toEntity(bankAccount)); - return entity.toDomain(); - } - - public boolean uniqueCheck(String fieldName, BankAccount bankAccount) { - return bankAccountJdbcRepository.uniqueCheck(fieldName, new BankAccountEntity().toEntity(bankAccount)); - } - - public void add(BankAccountRequest request) { - Map message = new HashMap<>(); - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("bankaccount_create", request); - } else { - message.put("bankaccount_update", request); - } - bankAccountQueueRepository.add(message); - } - - public Pagination search(BankAccountSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - BankAccountSearchContract bankAccountSearchContract = new BankAccountSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, bankAccountSearchContract); - return bankAccountESRepository.search(bankAccountSearchContract); - } else { - return bankAccountJdbcRepository.search(domain); - } - - } - - @Transactional - public List save(List bankAccounts, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - BankAccountContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && "yes".equalsIgnoreCase(persistThroughKafka)) { - - BankAccountRequest request = new BankAccountRequest(); - request.setRequestInfo(requestInfo); - request.setBankAccounts(new ArrayList<>()); - - for (BankAccount b : bankAccounts) { - - contract = new BankAccountContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankAccounts().add(contract); - - } - - addToQue(request); - - return bankAccounts; - } else { - - List resultList = new ArrayList<>(); - - for (BankAccount b : bankAccounts) { - - resultList.add(save(b)); - } - - BankAccountRequest request = new BankAccountRequest(); - request.setRequestInfo(requestInfo); - request.setBankAccounts(new ArrayList<>()); - - for (BankAccount b : resultList) { - - contract = new BankAccountContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankAccounts().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List bankAccounts, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - BankAccountContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && "yes".equalsIgnoreCase(persistThroughKafka)) { - - BankAccountRequest request = new BankAccountRequest(); - request.setRequestInfo(requestInfo); - request.setBankAccounts(new ArrayList<>()); - - for (BankAccount b : bankAccounts) { - - contract = new BankAccountContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankAccounts().add(contract); - - } - - addToQue(request); - - return bankAccounts; - } else { - - List resultList = new ArrayList<>(); - - for (BankAccount b : bankAccounts) { - - resultList.add(update(b)); - } - - BankAccountRequest request = new BankAccountRequest(); - request.setRequestInfo(requestInfo); - request.setBankAccounts(new ArrayList<>()); - - for (BankAccount b : resultList) { - - contract = new BankAccountContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankAccounts().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - public void addToQue(BankAccountRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("bankaccount_create", request); - } else { - message.put("bankaccount_update", request); - } - bankAccountQueueRepository.add(message); - } - - public void addToSearchQueue(BankAccountRequest request) { - Map message = new HashMap<>(); - - message.put("bankaccount_persisted", request); - - bankAccountQueueRepository.addToSearch(message); - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankBranchESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankBranchESRepository.java deleted file mode 100644 index 2818893b761..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankBranchESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.persistence.entity.BankBranchEntity; -import org.egov.egf.master.web.contract.BankBranchSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class BankBranchESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(BankBranchESRepository.class); - - public BankBranchESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(BankBranchSearchContract bankBranchSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(bankBranchSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToBankBranchList(searchResponse, bankBranchSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToBankBranchList(SearchResponse searchResponse, - BankBranchSearchContract bankBranchSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List bankBranchs = new ArrayList(); - BankBranch bankBranch = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - bankBranch = mapper.readValue(hit.getSourceAsString(), BankBranch.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - bankBranchs.add(bankBranch); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(bankBranchs); - - return page; - } - - private SearchRequestBuilder getSearchRequest(BankBranchSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), BankBranchEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchBankBranch(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(BankBranch.class.getSimpleName().toLowerCase()) - .setTypes(BankBranch.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankBranchRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankBranchRepository.java deleted file mode 100644 index b841ecec0b8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankBranchRepository.java +++ /dev/null @@ -1,235 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.BankBranchEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.BankBranchJdbcRepository; -import org.egov.egf.master.web.contract.BankBranchContract; -import org.egov.egf.master.web.contract.BankBranchSearchContract; -import org.egov.egf.master.web.requests.BankBranchRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class BankBranchRepository { - - @Autowired - private BankBranchJdbcRepository bankBranchJdbcRepository; - - @Autowired - private MastersQueueRepository bankBranchQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private BankBranchESRepository bankBranchESRepository; - - @Autowired - public BankBranchRepository(BankBranchJdbcRepository bankBranchJdbcRepository, - MastersQueueRepository bankBranchQueueRepository, - FinancialConfigurationService financialConfigurationService, BankBranchESRepository bankBranchESRepository, - @Value("${persist.through.kafka}") String persistThroughKafka) { - this.bankBranchJdbcRepository = bankBranchJdbcRepository; - this.bankBranchQueueRepository = bankBranchQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.bankBranchESRepository = bankBranchESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - private String persistThroughKafka; - - public BankBranch findById(BankBranch bankBranch) { - BankBranchEntity entity = bankBranchJdbcRepository.findById(new BankBranchEntity().toEntity(bankBranch)); - return entity.toDomain(); - - } - - public String getNextSequence() { - return bankBranchJdbcRepository.getSequence(BankBranchEntity.SEQUENCE_NAME); - } - - @Transactional - public List save(List bankBranches, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - BankBranchContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && "yes".equalsIgnoreCase(persistThroughKafka)) { - - BankBranchRequest request = new BankBranchRequest(); - request.setRequestInfo(requestInfo); - request.setBankBranches(new ArrayList<>()); - - for (BankBranch b : bankBranches) { - - contract = new BankBranchContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankBranches().add(contract); - - } - - addToQue(request); - - return bankBranches; - } else { - - List resultList = new ArrayList<>(); - - for (BankBranch b : bankBranches) { - - resultList.add(save(b)); - } - - BankBranchRequest request = new BankBranchRequest(); - request.setRequestInfo(requestInfo); - request.setBankBranches(new ArrayList<>()); - - for (BankBranch b : resultList) { - - contract = new BankBranchContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankBranches().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List bankBranches, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - BankBranchContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && "yes".equalsIgnoreCase(persistThroughKafka)) { - - BankBranchRequest request = new BankBranchRequest(); - request.setRequestInfo(requestInfo); - request.setBankBranches(new ArrayList<>()); - - for (BankBranch b : bankBranches) { - - contract = new BankBranchContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankBranches().add(contract); - - } - - addToQue(request); - - return bankBranches; - } else { - - List resultList = new ArrayList<>(); - - for (BankBranch b : bankBranches) { - - resultList.add(update(b)); - } - - BankBranchRequest request = new BankBranchRequest(); - request.setRequestInfo(requestInfo); - request.setBankBranches(new ArrayList<>()); - - for (BankBranch b : resultList) { - - contract = new BankBranchContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBankBranches().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public BankBranch save(BankBranch bankBranch) { - BankBranchEntity entity = bankBranchJdbcRepository.create(new BankBranchEntity().toEntity(bankBranch)); - return entity.toDomain(); - } - - @Transactional - public BankBranch update(BankBranch bankBranch) { - BankBranchEntity entity = bankBranchJdbcRepository.update(new BankBranchEntity().toEntity(bankBranch)); - return entity.toDomain(); - } - - public void add(BankBranchRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("bankbranch_create", request); - } else { - message.put("bankbranch_update", request); - } - bankBranchQueueRepository.add(message); - } - - public Pagination search(BankBranchSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - BankBranchSearchContract bankBranchSearchContract = new BankBranchSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, bankBranchSearchContract); - return bankBranchESRepository.search(bankBranchSearchContract); - } else { - return bankBranchJdbcRepository.search(domain); - } - - } - - public void addToQue(BankBranchRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("bankbranch_create", request); - } else { - message.put("bankbranch_update", request); - } - bankBranchQueueRepository.add(message); - } - - public void addToSearchQueue(BankBranchRequest request) { - Map message = new HashMap<>(); - - message.put("bankbranch_persisted", request); - - bankBranchQueueRepository.addToSearch(message); - } - - public boolean uniqueCheck(String fieldName, BankBranch bankBranch) { - return bankBranchJdbcRepository.uniqueCheck(fieldName, new BankBranchEntity().toEntity(bankBranch)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankESRepository.java deleted file mode 100644 index f8a8c7895f1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankESRepository.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.persistence.entity.BankEntity; -import org.egov.egf.master.web.contract.BankSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class BankESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(BankESRepository.class); - - public BankESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(BankSearchContract bankSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(bankSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToBankList(searchResponse, bankSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToBankList(SearchResponse searchResponse, BankSearchContract bankSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List banks = new ArrayList(); - Bank bank = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - bank = mapper.readValue(hit.getSourceAsString(), Bank.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - banks.add(bank); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(banks); - - return page; - } - - private SearchRequestBuilder getSearchRequest(BankSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), BankEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchBank(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Bank.class.getSimpleName().toLowerCase()) - .setTypes(Bank.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankRepository.java deleted file mode 100644 index bb98514fb74..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BankRepository.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.BankEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.BankJdbcRepository; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.BankSearchContract; -import org.egov.egf.master.web.requests.BankRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class BankRepository { - - @Autowired - private BankJdbcRepository bankJdbcRepository; - @Autowired - private MastersQueueRepository bankQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private BankESRepository bankESRepository; - - private String persistThroughKafka; - - @Autowired - public BankRepository(BankJdbcRepository bankJdbcRepository, MastersQueueRepository bankQueueRepository, - FinancialConfigurationService financialConfigurationService, BankESRepository bankESRepository, - @Value("${persist.through.kafka}") String persistThroughKafka) { - this.bankJdbcRepository = bankJdbcRepository; - this.bankQueueRepository = bankQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.bankESRepository = bankESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - public Bank findById(Bank bank) { - BankEntity entity = bankJdbcRepository.findById(new BankEntity().toEntity(bank)); - return entity.toDomain(); - - } - - public String getNextSequence() { - return bankJdbcRepository.getSequence(BankEntity.SEQUENCE_NAME); - } - - @Transactional - public Bank save(Bank bank) { - BankEntity entity = bankJdbcRepository.create(new BankEntity().toEntity(bank)); - return entity.toDomain(); - } - - @Transactional - public Bank update(Bank bank) { - BankEntity entity = bankJdbcRepository.update(new BankEntity().toEntity(bank)); - return entity.toDomain(); - } - - public void add(BankRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("bank_create", request); - } else { - message.put("bank_update", request); - } - bankQueueRepository.add(message); - } - - public Pagination search(BankSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - BankSearchContract bankSearchContract = new BankSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, bankSearchContract); - return bankESRepository.search(bankSearchContract); - } else { - return bankJdbcRepository.search(domain); - } - } - - @Transactional - public List save(List banks, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - BankContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && "yes".equalsIgnoreCase(persistThroughKafka)) { - - BankRequest request = new BankRequest(); - request.setRequestInfo(requestInfo); - request.setBanks(new ArrayList<>()); - - for (Bank b : banks) { - - contract = new BankContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBanks().add(contract); - - } - - addToQue(request); - - return banks; - } else { - - List resultList = new ArrayList<>(); - - for (Bank b : banks) { - - resultList.add(save(b)); - } - - BankRequest request = new BankRequest(); - request.setRequestInfo(requestInfo); - request.setBanks(new ArrayList<>()); - - for (Bank b : resultList) { - - contract = new BankContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBanks().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List banks, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - BankContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && "yes".equalsIgnoreCase(persistThroughKafka)) { - - BankRequest request = new BankRequest(); - request.setRequestInfo(requestInfo); - request.setBanks(new ArrayList<>()); - - for (Bank b : banks) { - - contract = new BankContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBanks().add(contract); - - } - - addToQue(request); - - return banks; - } else { - - List resultList = new ArrayList<>(); - - for (Bank b : banks) { - - resultList.add(update(b)); - } - - BankRequest request = new BankRequest(); - request.setRequestInfo(requestInfo); - request.setBanks(new ArrayList<>()); - - for (Bank b : resultList) { - - contract = new BankContract(); - contract.setCreatedDate(new Date()); - mapper.map(b, contract); - request.getBanks().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - public void addToQue(BankRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("bank_create", request); - } else { - message.put("bank_update", request); - } - bankQueueRepository.add(message); - } - - public void addToSearchQueue(BankRequest request) { - Map message = new HashMap<>(); - - message.put("bank_persisted", request); - - bankQueueRepository.addToSearch(message); - } - - public boolean uniqueCheck(String fieldName, Bank bank) { - return bankJdbcRepository.uniqueCheck(fieldName, new BankEntity().toEntity(bank)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BudgetGroupESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BudgetGroupESRepository.java deleted file mode 100644 index aa2ccfef719..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BudgetGroupESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.BudgetGroup; -import org.egov.egf.master.persistence.entity.BudgetGroupEntity; -import org.egov.egf.master.web.contract.BudgetGroupSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class BudgetGroupESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(BudgetGroupESRepository.class); - - public BudgetGroupESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(BudgetGroupSearchContract budgetGroupSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(budgetGroupSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToBudgetGroupList(searchResponse, budgetGroupSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToBudgetGroupList(SearchResponse searchResponse, - BudgetGroupSearchContract budgetGroupSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List budgetGroups = new ArrayList(); - BudgetGroup budgetGroup = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - budgetGroup = mapper.readValue(hit.getSourceAsString(), BudgetGroup.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - budgetGroups.add(budgetGroup); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(budgetGroups); - - return page; - } - - private SearchRequestBuilder getSearchRequest(BudgetGroupSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), BudgetGroupEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchBudgetGroup(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(BudgetGroup.class.getSimpleName().toLowerCase()) - .setTypes(BudgetGroup.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BudgetGroupRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BudgetGroupRepository.java deleted file mode 100644 index fe875156bca..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/BudgetGroupRepository.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.BudgetGroup; -import org.egov.egf.master.domain.model.BudgetGroupSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.BudgetGroupEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.BudgetGroupJdbcRepository; -import org.egov.egf.master.web.contract.BudgetGroupSearchContract; -import org.egov.egf.master.web.requests.BudgetGroupRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class BudgetGroupRepository { - - @Autowired - private BudgetGroupJdbcRepository budgetGroupJdbcRepository; - - @Autowired - private MastersQueueRepository budgetGroupQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private BudgetGroupESRepository budgetGroupESRepository; - - public BudgetGroup findById(BudgetGroup budgetGroup) { - BudgetGroupEntity entity = budgetGroupJdbcRepository.findById(new BudgetGroupEntity().toEntity(budgetGroup)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return budgetGroupJdbcRepository.getSequence(BudgetGroupEntity.SEQUENCE_NAME); - } - - @Transactional - public BudgetGroup save(BudgetGroup budgetGroup) { - BudgetGroupEntity entity = budgetGroupJdbcRepository.create(new BudgetGroupEntity().toEntity(budgetGroup)); - return entity.toDomain(); - } - - @Transactional - public BudgetGroup update(BudgetGroup budgetGroup) { - BudgetGroupEntity entity = budgetGroupJdbcRepository.update(new BudgetGroupEntity().toEntity(budgetGroup)); - return entity.toDomain(); - } - - public void add(BudgetGroupRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("budgetgroup_create", request); - } else { - message.put("budgetgroup_update", request); - } - budgetGroupQueueRepository.add(message); - } - - public Pagination search(BudgetGroupSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - BudgetGroupSearchContract budgetGroupSearchContract = new BudgetGroupSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, budgetGroupSearchContract); - return budgetGroupESRepository.search(budgetGroupSearchContract); - } else { - return budgetGroupJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, BudgetGroup budgetGroup) { - return budgetGroupJdbcRepository.uniqueCheck(fieldName, new BudgetGroupEntity().toEntity(budgetGroup)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailESRepository.java deleted file mode 100644 index acdaa44fddd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailESRepository.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.persistence.entity.ChartOfAccountDetailEntity; -import org.egov.egf.master.web.contract.ChartOfAccountDetailSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class ChartOfAccountDetailESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(ChartOfAccountDetailESRepository.class); - - public ChartOfAccountDetailESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(ChartOfAccountDetailSearchContract chartOfAccountDetailSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(chartOfAccountDetailSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToChartOfAccountDetailList(searchResponse, chartOfAccountDetailSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToChartOfAccountDetailList(SearchResponse searchResponse, - ChartOfAccountDetailSearchContract chartOfAccountDetailSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List chartOfAccountDetails = new ArrayList(); - ChartOfAccountDetail chartOfAccountDetail = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - chartOfAccountDetail = mapper.readValue(hit.getSourceAsString(), ChartOfAccountDetail.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - chartOfAccountDetails.add(chartOfAccountDetail); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(chartOfAccountDetails); - - return page; - } - - private SearchRequestBuilder getSearchRequest(ChartOfAccountDetailSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), ChartOfAccountDetailEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchChartOfAccountDetail(criteria); - SearchRequestBuilder searchRequestBuilder = esClient - .prepareSearch(ChartOfAccountDetail.class.getSimpleName().toLowerCase()) - .setTypes(ChartOfAccountDetail.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailRepository.java deleted file mode 100644 index cf689f93335..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailRepository.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.ChartOfAccountDetailEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.ChartOfAccountDetailJdbcRepository; -import org.egov.egf.master.web.contract.ChartOfAccountDetailSearchContract; -import org.egov.egf.master.web.requests.ChartOfAccountDetailRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class ChartOfAccountDetailRepository { - - @Autowired - private ChartOfAccountDetailJdbcRepository chartOfAccountDetailJdbcRepository; - - @Autowired - private MastersQueueRepository chartOfAccountDetailQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private ChartOfAccountDetailESRepository chartOfAccountDetailESRepository; - - public ChartOfAccountDetail findById(ChartOfAccountDetail chartOfAccountDetail) { - ChartOfAccountDetailEntity entity = chartOfAccountDetailJdbcRepository - .findById(new ChartOfAccountDetailEntity().toEntity(chartOfAccountDetail)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return chartOfAccountDetailJdbcRepository.getSequence(ChartOfAccountDetailEntity.SEQUENCE_NAME); - } - - @Transactional - public ChartOfAccountDetail save(ChartOfAccountDetail chartOfAccountDetail) { - ChartOfAccountDetailEntity entity = chartOfAccountDetailJdbcRepository - .create(new ChartOfAccountDetailEntity().toEntity(chartOfAccountDetail)); - return entity.toDomain(); - } - - @Transactional - public ChartOfAccountDetail update(ChartOfAccountDetail chartOfAccountDetail) { - ChartOfAccountDetailEntity entity = chartOfAccountDetailJdbcRepository - .update(new ChartOfAccountDetailEntity().toEntity(chartOfAccountDetail)); - return entity.toDomain(); - } - - public void add(ChartOfAccountDetailRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("chartofaccountdetail_create", request); - } else { - message.put("chartofaccountdetail_update", request); - } - chartOfAccountDetailQueueRepository.add(message); - } - - public Pagination search(ChartOfAccountDetailSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - ChartOfAccountDetailSearchContract chartOfAccountDetailSearchContract = new ChartOfAccountDetailSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, chartOfAccountDetailSearchContract); - return chartOfAccountDetailESRepository.search(chartOfAccountDetailSearchContract); - } else { - return chartOfAccountDetailJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, ChartOfAccountDetail chartOfAccountDetail) { - return chartOfAccountDetailJdbcRepository.uniqueCheck(fieldName, new ChartOfAccountDetailEntity().toEntity(chartOfAccountDetail)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountESRepository.java deleted file mode 100644 index 4cdef8ce2e3..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.persistence.entity.ChartOfAccountEntity; -import org.egov.egf.master.web.contract.ChartOfAccountSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class ChartOfAccountESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(ChartOfAccountESRepository.class); - - public ChartOfAccountESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(ChartOfAccountSearchContract chartOfAccountSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(chartOfAccountSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToChartOfAccountList(searchResponse, chartOfAccountSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToChartOfAccountList(SearchResponse searchResponse, - ChartOfAccountSearchContract chartOfAccountSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List chartOfAccounts = new ArrayList(); - ChartOfAccount chartOfAccount = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - chartOfAccount = mapper.readValue(hit.getSourceAsString(), ChartOfAccount.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - chartOfAccounts.add(chartOfAccount); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(chartOfAccounts); - - return page; - } - - private SearchRequestBuilder getSearchRequest(ChartOfAccountSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), ChartOfAccountEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchChartOfAccount(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(ChartOfAccount.class.getSimpleName().toLowerCase()) - .setTypes(ChartOfAccount.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountRepository.java deleted file mode 100644 index 428ee306eb9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ChartOfAccountRepository.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.ChartOfAccountEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.ChartOfAccountJdbcRepository; -import org.egov.egf.master.web.contract.ChartOfAccountSearchContract; -import org.egov.egf.master.web.requests.ChartOfAccountRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class ChartOfAccountRepository { - - @Autowired - private ChartOfAccountJdbcRepository chartOfAccountJdbcRepository; - - @Autowired - private MastersQueueRepository chartOfAccountQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private ChartOfAccountESRepository chartOfAccountESRepository; - - public ChartOfAccount findById(ChartOfAccount chartOfAccount) { - ChartOfAccountEntity entity = chartOfAccountJdbcRepository - .findById(new ChartOfAccountEntity().toEntity(chartOfAccount)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return chartOfAccountJdbcRepository.getSequence(ChartOfAccountEntity.SEQUENCE_NAME); - } - - @Transactional - public ChartOfAccount save(ChartOfAccount chartOfAccount) { - ChartOfAccountEntity entity = chartOfAccountJdbcRepository - .create(new ChartOfAccountEntity().toEntity(chartOfAccount)); - return entity.toDomain(); - } - - @Transactional - public ChartOfAccount update(ChartOfAccount chartOfAccount) { - ChartOfAccountEntity entity = chartOfAccountJdbcRepository - .update(new ChartOfAccountEntity().toEntity(chartOfAccount)); - return entity.toDomain(); - } - - public void add(ChartOfAccountRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("chartofaccount_create", request); - } else { - message.put("chartofaccount_update", request); - } - chartOfAccountQueueRepository.add(message); - } - - public Pagination search(ChartOfAccountSearch domain) { - - Set chartOfAccountSet = new HashSet(); - Pagination finalResult = new Pagination<>(); - Pagination result = new Pagination<>(); - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - ChartOfAccountSearchContract chartOfAccountSearchContract = new ChartOfAccountSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, chartOfAccountSearchContract); - result = chartOfAccountESRepository.search(chartOfAccountSearchContract); - } else { - - result = chartOfAccountJdbcRepository.search(domain); - } - - if (domain != null && domain.getAccountCodePurpose() != null - && domain.getAccountCodePurpose().getId() != null) { - - domain.setAccountCodePurpose(null); - - for (ChartOfAccount coa : result.getPagedData()) { - chartOfAccountSet.add(coa); - domain.setGlcode(coa.getGlcode() + "%"); - Pagination result1 = chartOfAccountJdbcRepository.search(domain); - for (ChartOfAccount temp : result1.getPagedData()) { - chartOfAccountSet.add(temp); - } - finalResult = result1; - } - finalResult.setTotalResults(chartOfAccountSet.size()); - finalResult.setPagedData(new ArrayList<>(chartOfAccountSet)); - - return finalResult; - - } else - - return result; - - } - - public boolean uniqueCheck(String fieldName, ChartOfAccount chartOfAccount) { - return chartOfAccountJdbcRepository.uniqueCheck(fieldName, new ChartOfAccountEntity().toEntity(chartOfAccount)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/CommonDbRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/CommonDbRepository.java deleted file mode 100644 index 6be3098758d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/CommonDbRepository.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.egov.egf.master.domain.repository; - -public interface CommonDbRepository { - - T save(T entity); - - T update(T entity); - - T findById(T entity); - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ElasticSearchQueryFactory.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ElasticSearchQueryFactory.java deleted file mode 100644 index eb3f60821d3..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/ElasticSearchQueryFactory.java +++ /dev/null @@ -1,385 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.elasticsearch.index.query.QueryBuilders.boolQuery; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.egov.common.util.ElasticSearchUtils; -import org.egov.egf.master.web.contract.AccountCodePurposeSearchContract; -import org.egov.egf.master.web.contract.AccountDetailKeySearchContract; -import org.egov.egf.master.web.contract.AccountDetailTypeSearchContract; -import org.egov.egf.master.web.contract.AccountEntitySearchContract; -import org.egov.egf.master.web.contract.BankAccountSearchContract; -import org.egov.egf.master.web.contract.BankBranchSearchContract; -import org.egov.egf.master.web.contract.BankSearchContract; -import org.egov.egf.master.web.contract.BudgetGroupSearchContract; -import org.egov.egf.master.web.contract.ChartOfAccountDetailSearchContract; -import org.egov.egf.master.web.contract.ChartOfAccountSearchContract; -import org.egov.egf.master.web.contract.FinancialYearSearchContract; -import org.egov.egf.master.web.contract.FiscalPeriodSearchContract; -import org.egov.egf.master.web.contract.FunctionSearchContract; -import org.egov.egf.master.web.contract.FunctionarySearchContract; -import org.egov.egf.master.web.contract.FundSearchContract; -import org.egov.egf.master.web.contract.FundsourceSearchContract; -import org.egov.egf.master.web.contract.RecoverySearchContract; -import org.egov.egf.master.web.contract.SchemeSearchContract; -import org.egov.egf.master.web.contract.SubSchemeSearchContract; -import org.egov.egf.master.web.contract.SupplierSearchContract; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class ElasticSearchQueryFactory { - - @Autowired - private ElasticSearchUtils elasticSearchUtils; - - public BoolQueryBuilder searchFund(FundSearchContract fundSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (fundSearchContract.getIds() != null && !fundSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(fundSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(fundSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(fundSearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(fundSearchContract.getIdentifier(), "identifier", boolQueryBuilder); - elasticSearchUtils.add(fundSearchContract.getLevel(), "level", boolQueryBuilder); - elasticSearchUtils.add(fundSearchContract.getParent(), "parent", boolQueryBuilder); - elasticSearchUtils.add(fundSearchContract.getActive(), "active", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchAccountCodePurpose( - AccountCodePurposeSearchContract accountCodePurposeSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (accountCodePurposeSearchContract.getIds() != null && !accountCodePurposeSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(accountCodePurposeSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(accountCodePurposeSearchContract.getName(), "name", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchAccountDetailKey(AccountDetailKeySearchContract accountDetailKeySearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (accountDetailKeySearchContract.getIds() != null && !accountDetailKeySearchContract.getIds().isEmpty()) - elasticSearchUtils.add(accountDetailKeySearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(accountDetailKeySearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(accountDetailKeySearchContract.getKey(), "key", boolQueryBuilder); - elasticSearchUtils.add(accountDetailKeySearchContract.getAccountDetailType(), "accountDetailType", - boolQueryBuilder); - return boolQueryBuilder; - } - - public BoolQueryBuilder searchAccountDetailType(AccountDetailTypeSearchContract accountDetailTypeSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (accountDetailTypeSearchContract.getIds() != null && !accountDetailTypeSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(accountDetailTypeSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(accountDetailTypeSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(accountDetailTypeSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(accountDetailTypeSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(accountDetailTypeSearchContract.getTableName(), "tableName", boolQueryBuilder); - elasticSearchUtils.add(accountDetailTypeSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(accountDetailTypeSearchContract.getFullyQualifiedName(), "fullyQualifiedName", - boolQueryBuilder); - return boolQueryBuilder; - } - - public BoolQueryBuilder searchAccountEntity(AccountEntitySearchContract accountEntitySearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (accountEntitySearchContract.getIds() != null && !accountEntitySearchContract.getIds().isEmpty()) - elasticSearchUtils.add(accountEntitySearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(accountEntitySearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(accountEntitySearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(accountEntitySearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(accountEntitySearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(accountEntitySearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(accountEntitySearchContract.getAccountDetailType(), "accountDetailType", - boolQueryBuilder); - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchBankAccount(BankAccountSearchContract bankAccountSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (bankAccountSearchContract.getIds() != null && !bankAccountSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(bankAccountSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getChartOfAccount(), "chartOfAccount", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getFund(), "fund", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getAccountNumber(), "accountNumber", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getAccountType(), "accountType", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getPayTo(), "payTo", boolQueryBuilder); - elasticSearchUtils.add(bankAccountSearchContract.getType(), "type", boolQueryBuilder); - - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchBankBranch(BankBranchSearchContract bankBranchSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (bankBranchSearchContract.getIds() != null && !bankBranchSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(bankBranchSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getBank(), "bank", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getAddress(), "address", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getAddress2(), "address2", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getBank(), "city", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getActive(), "state", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getAddress(), "pincode", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getPhone(), "phone", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getFax(), "fax", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getContactPerson(), "contactPerson", boolQueryBuilder); - elasticSearchUtils.add(bankBranchSearchContract.getMicr(), "micr", boolQueryBuilder); - - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchBank(BankSearchContract bankSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (bankSearchContract.getIds() != null && !bankSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(bankSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(bankSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(bankSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(bankSearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(bankSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(bankSearchContract.getType(), "type", boolQueryBuilder); - elasticSearchUtils.add(bankSearchContract.getActive(), "active", boolQueryBuilder); - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchBudgetGroup(BudgetGroupSearchContract budgetGroupSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (budgetGroupSearchContract.getIds() != null && !budgetGroupSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(budgetGroupSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getMajorCode(), "majorCode", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getMaxCode(), "maxCode", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getMinCode(), "minCode", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getAccountType(), "accountType", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(budgetGroupSearchContract.getBudgetingType(), "budgetingType", boolQueryBuilder); - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchChartOfAccount(ChartOfAccountSearchContract chartOfAccountContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (chartOfAccountContract.getIds() != null && !chartOfAccountContract.getIds().isEmpty()) - elasticSearchUtils.add(chartOfAccountContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getMajorCode(), "majorCode", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getGlcode(), "glcode", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getAccountCodePurpose(), "accountCodePurpose", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getIsActiveForPosting(), "isActiveForPosting", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getParentId(), "parentId", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getType(), "type", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getClassification(), "classification", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getFunctionRequired(), "functionRequired", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getBudgetCheckRequired(), "budgetCheckRequired", - boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountContract.getIsSubLedger(), "isSubLedger", boolQueryBuilder); - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchChartOfAccountDetail( - ChartOfAccountDetailSearchContract chartOfAccountDetailSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (chartOfAccountDetailSearchContract.getIds() != null - && !chartOfAccountDetailSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(chartOfAccountDetailSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountDetailSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountDetailSearchContract.getChartOfAccount(), "chartOfAccount", - boolQueryBuilder); - elasticSearchUtils.add(chartOfAccountDetailSearchContract.getAccountDetailType(), "accountDetailType", - boolQueryBuilder); - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchFinancialYear(FinancialYearSearchContract financialYearSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (financialYearSearchContract.getIds() != null && !financialYearSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(financialYearSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getFinYearRange(), "finYearRange", boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getStartingDate(), "startingDate", boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getEndingDate(), "endingDate", boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getIsActiveForPosting(), "isActiveForPosting", - boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getIsClosed(), "isClosed", boolQueryBuilder); - elasticSearchUtils.add(financialYearSearchContract.getTransferClosingBalance(), "transferClosingBalance", - boolQueryBuilder); - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchFunction(FunctionSearchContract functionSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (functionSearchContract.getIds() != null && !functionSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(functionSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(functionSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(functionSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(functionSearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(functionSearchContract.getLevel(), "level", boolQueryBuilder); - elasticSearchUtils.add(functionSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(functionSearchContract.getParentId(), "parentId", boolQueryBuilder); - return boolQueryBuilder; - - } - - public BoolQueryBuilder searchFunctionary(FunctionarySearchContract functionarySearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (functionarySearchContract.getIds() != null && !functionarySearchContract.getIds().isEmpty()) - elasticSearchUtils.add(functionarySearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(functionarySearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(functionarySearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(functionarySearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(functionarySearchContract.getActive(), "active", boolQueryBuilder); - return boolQueryBuilder; - } - - public BoolQueryBuilder searchScheme(SchemeSearchContract schemeSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (schemeSearchContract.getIds() != null && !schemeSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(schemeSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getValidFrom(), "validFrom", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getValidTo(), "validTo", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getFund(), "fund", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(schemeSearchContract.getBoundary(), "boundary", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchSubScheme(SubSchemeSearchContract subSchemeSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (subSchemeSearchContract.getIds() != null && !subSchemeSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(subSchemeSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getValidFrom(), "validFrom", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getValidTo(), "validTo", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getScheme(), "scheme", boolQueryBuilder); - elasticSearchUtils.add(subSchemeSearchContract.getDepartmentId(), "departmentId", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchSupplier(SupplierSearchContract supplierSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (supplierSearchContract.getIds() != null && !supplierSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(supplierSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getAddress(), "address", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getMobile(), "mobile", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getEmail(), "email", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getDescription(), "description", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getPanNo(), "panNo", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getTinNo(), "tinNo", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getRegistationNo(), "registationNo", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getBankAccount(), "bankAccount", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getIfscCode(), "ifscCode", boolQueryBuilder); - elasticSearchUtils.add(supplierSearchContract.getBank(), "bank", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchFiscalPeriod(FiscalPeriodSearchContract fiscalPeriodSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (fiscalPeriodSearchContract.getIds() != null && !fiscalPeriodSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(fiscalPeriodSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getFinancialYear(), "financialYear", boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getStartingDate(), "startingDate", boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getEndingDate(), "endingDate", boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getIsActiveForPosting(), "isActiveForPosting", - boolQueryBuilder); - elasticSearchUtils.add(fiscalPeriodSearchContract.getIsClosed(), "isClosed", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchFundsource(FundsourceSearchContract fundsourceSearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (fundsourceSearchContract.getIds() != null && !fundsourceSearchContract.getIds().isEmpty()) - elasticSearchUtils.add(fundsourceSearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getId(), "id", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getActive(), "active", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getParent(), "parent", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getIsParent(), "isParent", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getLlevel(), "llevel", boolQueryBuilder); - elasticSearchUtils.add(fundsourceSearchContract.getType(), "type", boolQueryBuilder); - - return boolQueryBuilder; - } - - public BoolQueryBuilder searchRecovery(RecoverySearchContract recoverySearchContract) { - BoolQueryBuilder boolQueryBuilder = boolQuery(); - if (recoverySearchContract.getIds() != null && !recoverySearchContract.getIds().isEmpty()) - elasticSearchUtils.add(recoverySearchContract.getIds(), "id", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getName(), "name", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getCode(), "code", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getActive(), "active", boolQueryBuilder); - if (recoverySearchContract.getChartOfAccount() != null) - elasticSearchUtils.add(recoverySearchContract.getChartOfAccount(), "chartOfAccount", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getType(), "type", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getFlat(), "flat", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getPercentage(), "percentage", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getRemitted(), "remitted", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getIfscCode(), "ifscCode", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getMode(), "mode", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getRemittanceMode(), "remittanceMode", boolQueryBuilder); - elasticSearchUtils.add(recoverySearchContract.getAccountNumber(), "accountNumber", boolQueryBuilder); - - return boolQueryBuilder; - } - - public List prepareOrderBys(String sortBy) { - List orderByList = new ArrayList(); - List sortByList = new ArrayList(); - if (sortBy.contains(",")) { - sortByList = Arrays.asList(sortBy.split(",")); - } else { - sortByList = Arrays.asList(sortBy); - } - for (String s : sortByList) { - if (s.contains(" ") - && (s.toLowerCase().trim().endsWith("asc") || s.toLowerCase().trim().endsWith("desc"))) { - orderByList.add(s.trim()); - } else { - orderByList.add(s.trim() + " asc"); - } - } - - return orderByList; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialConfigurationRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialConfigurationRepository.java deleted file mode 100644 index 8e05ddcc104..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialConfigurationRepository.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.FinancialConfiguration; -import org.egov.egf.master.domain.model.FinancialConfigurationSearch; -import org.egov.egf.master.domain.model.FinancialConfigurationValue; -import org.egov.egf.master.domain.model.FinancialConfigurationValueSearch; -import org.egov.egf.master.persistence.entity.FinancialConfigurationEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FinancialConfigurationJdbcRepository; -import org.egov.egf.master.web.requests.FinancialConfigurationRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FinancialConfigurationRepository { - - @Autowired - private FinancialConfigurationJdbcRepository financialConfigurationJdbcRepository; - - @Autowired - private FinancialConfigurationValueRepository financialConfigurationValueRepository; - - @Autowired - private MastersQueueRepository financialConfigurationQueueRepository; - - public FinancialConfiguration findById(FinancialConfiguration financialConfiguration) { - FinancialConfigurationEntity entity = financialConfigurationJdbcRepository - .findById(new FinancialConfigurationEntity().toEntity(financialConfiguration)); - return entity.toDomain(); - - } - - @Transactional - public FinancialConfiguration save(FinancialConfiguration financialConfiguration) { - FinancialConfigurationEntity entity = financialConfigurationJdbcRepository - .create(new FinancialConfigurationEntity().toEntity(financialConfiguration)); - return entity.toDomain(); - } - - @Transactional - public FinancialConfiguration update(FinancialConfiguration financialConfiguration) { - FinancialConfigurationEntity entity = financialConfigurationJdbcRepository - .update(new FinancialConfigurationEntity().toEntity(financialConfiguration)); - return entity.toDomain(); - } - - public void add(FinancialConfigurationRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("financialconfiguration_create", request); - } else { - message.put("financialconfiguration_update", request); - } - financialConfigurationQueueRepository.add(message); - } - - public Pagination search(FinancialConfigurationSearch domain) { - - if (domain.getName() != null && domain.getModule() != null && !domain.getName().isEmpty() - && !domain.getModule().isEmpty()) { - List finalList = new ArrayList<>(); - - Pagination response = financialConfigurationJdbcRepository.search(domain); - FinancialConfigurationValueSearch valueSearchReq = new FinancialConfigurationValueSearch(); - - for (FinancialConfiguration fc : response.getPagedData()) { - - FinancialConfiguration financialConfiguration = FinancialConfiguration.builder().id(fc.getId()).build(); - financialConfiguration.setTenantId(fc.getTenantId()); - valueSearchReq.setFinancialConfiguration(financialConfiguration); - Pagination valuesRes = financialConfigurationValueRepository.search(valueSearchReq); - fc.setValues(valuesRes.getPagedData()); - finalList.add(fc); - } - - response.setPagedData(finalList); - - return response; - - } - - return financialConfigurationJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, FinancialConfiguration financialConfiguration) { - return financialConfigurationJdbcRepository.uniqueCheck(fieldName, new FinancialConfigurationEntity().toEntity(financialConfiguration)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialConfigurationValueRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialConfigurationValueRepository.java deleted file mode 100644 index bd9d565bf23..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialConfigurationValueRepository.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.FinancialConfigurationValue; -import org.egov.egf.master.domain.model.FinancialConfigurationValueSearch; -import org.egov.egf.master.persistence.entity.FinancialConfigurationValueEntity; -import org.egov.egf.master.persistence.repository.FinancialConfigurationValueJdbcRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FinancialConfigurationValueRepository { - - @Autowired - private FinancialConfigurationValueJdbcRepository financialConfigurationValueJdbcRepository; - - public FinancialConfigurationValue findById(FinancialConfigurationValue financialConfigurationValue) { - FinancialConfigurationValueEntity entity = financialConfigurationValueJdbcRepository - .findById(new FinancialConfigurationValueEntity().toEntity(financialConfigurationValue)); - return entity.toDomain(); - - } - - @Transactional - public FinancialConfigurationValue save(FinancialConfigurationValue financialConfigurationValue) { - FinancialConfigurationValueEntity entity = financialConfigurationValueJdbcRepository - .create(new FinancialConfigurationValueEntity().toEntity(financialConfigurationValue)); - return entity.toDomain(); - } - - @Transactional - public FinancialConfigurationValue update(FinancialConfigurationValue financialConfigurationValue) { - FinancialConfigurationValueEntity entity = financialConfigurationValueJdbcRepository - .update(new FinancialConfigurationValueEntity().toEntity(financialConfigurationValue)); - return entity.toDomain(); - } - - /* - * public void add(FinancialConfigurationValueRequest request) { Map message = new HashMap<>(); if - * (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - * message.put("financialconfigurationvalue_create", request); } else { message.put("financialconfigurationvalue_update", - * request); } financialConfigurationValueQueueRepository.add(message); } - */ - - public Pagination search(FinancialConfigurationValueSearch domain) { - - return financialConfigurationValueJdbcRepository.search(domain); - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialStatusRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialStatusRepository.java deleted file mode 100644 index cf0cdb4403d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialStatusRepository.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.FinancialStatus; -import org.egov.egf.master.domain.model.FinancialStatusSearch; -import org.egov.egf.master.persistence.entity.FinancialStatusEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FinancialStatusJdbcRepository; -import org.egov.egf.master.web.requests.FinancialStatusRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FinancialStatusRepository { - - @Autowired - private FinancialStatusJdbcRepository financialStatusJdbcRepository; - @Autowired - private MastersQueueRepository financialStatusQueueRepository; - - public FinancialStatus findById(FinancialStatus financialStatus) { - FinancialStatusEntity entity = financialStatusJdbcRepository - .findById(new FinancialStatusEntity().toEntity(financialStatus)); - return entity.toDomain(); - - } - - @Transactional - public FinancialStatus save(FinancialStatus financialStatus) { - FinancialStatusEntity entity = financialStatusJdbcRepository - .create(new FinancialStatusEntity().toEntity(financialStatus)); - return entity.toDomain(); - } - - @Transactional - public FinancialStatus update(FinancialStatus financialStatus) { - FinancialStatusEntity entity = financialStatusJdbcRepository - .update(new FinancialStatusEntity().toEntity(financialStatus)); - return entity.toDomain(); - } - - public void add(FinancialStatusRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("financialstatus_create", request); - } else { - message.put("financialstatus_update", request); - } - financialStatusQueueRepository.add(message); - } - - public Pagination search(FinancialStatusSearch domain) { - - return financialStatusJdbcRepository.search(domain); - - } - - public boolean uniqueCheck(String fieldName, FinancialStatus financialStatus) { - return financialStatusJdbcRepository.uniqueCheck(fieldName, new FinancialStatusEntity().toEntity(financialStatus)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialYearESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialYearESRepository.java deleted file mode 100644 index b58e91dcbaa..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialYearESRepository.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.persistence.entity.FinancialYearEntity; -import org.egov.egf.master.web.contract.FinancialYearSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FinancialYearESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(FinancialYearESRepository.class); - - public FinancialYearESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(FinancialYearSearchContract financialYearSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(financialYearSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToFinancialYearList(searchResponse, financialYearSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToFinancialYearList(SearchResponse searchResponse, - FinancialYearSearchContract financialYearSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List financialYears = new ArrayList(); - FinancialYear financialYear = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - financialYear = mapper.readValue(hit.getSourceAsString(), FinancialYear.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - financialYears.add(financialYear); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(financialYears); - - return page; - } - - private SearchRequestBuilder getSearchRequest(FinancialYearSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), FinancialYearEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchFinancialYear(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(FinancialYear.class.getSimpleName().toLowerCase()) - .setTypes(FinancialYear.class.getSimpleName().toLowerCase()) - .setQuery(boolQueryBuilder); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialYearRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialYearRepository.java deleted file mode 100644 index 72106609a4d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FinancialYearRepository.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.domain.model.FinancialYearSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FinancialYearEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FinancialYearJdbcRepository; -import org.egov.egf.master.web.contract.FinancialYearSearchContract; -import org.egov.egf.master.web.requests.FinancialYearRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class FinancialYearRepository { - - @Autowired - private FinancialYearJdbcRepository financialYearJdbcRepository; - - @Autowired - private MastersQueueRepository financialYearQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private FinancialYearESRepository financialYearESRepository; - - public FinancialYear findById(FinancialYear financialYear) { - return financialYearJdbcRepository.findById(new FinancialYearEntity().toEntity(financialYear)).toDomain(); - - } - - public FinancialYear save(FinancialYear financialYear) { - return financialYearJdbcRepository.create(new FinancialYearEntity().toEntity(financialYear)).toDomain(); - } - - public FinancialYear update(FinancialYear entity) { - return financialYearJdbcRepository.update(new FinancialYearEntity().toEntity(entity)).toDomain(); - } - - public void add(FinancialYearRequest request) { - - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("financialyear_create", request); - } else { - message.put("financialyear_update", request); - } - financialYearQueueRepository.add(message); - } - - public String getNextSequence(){ - return financialYearJdbcRepository.getSequence(FinancialYearEntity.SEQUENCE_NAME); - } - - public Pagination search(FinancialYearSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - FinancialYearSearchContract financialYearSearchContract = new FinancialYearSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, financialYearSearchContract); - return financialYearESRepository.search(financialYearSearchContract); - } else { - return financialYearJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, FinancialYear financialYear) { - return financialYearJdbcRepository.uniqueCheck(fieldName, new FinancialYearEntity().toEntity(financialYear)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FiscalPeriodESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FiscalPeriodESRepository.java deleted file mode 100644 index 2c25a1c6a7f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FiscalPeriodESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.FiscalPeriod; -import org.egov.egf.master.persistence.entity.FiscalPeriodEntity; -import org.egov.egf.master.web.contract.FiscalPeriodSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FiscalPeriodESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(FiscalPeriodESRepository.class); - - public FiscalPeriodESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(FiscalPeriodSearchContract fiscalPeriodSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(fiscalPeriodSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToFiscalPeriodList(searchResponse, fiscalPeriodSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToFiscalPeriodList(SearchResponse searchResponse, - FiscalPeriodSearchContract fiscalPeriodSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List fiscalPeriods = new ArrayList(); - FiscalPeriod fiscalPeriod = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - fiscalPeriod = mapper.readValue(hit.getSourceAsString(), FiscalPeriod.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - fiscalPeriods.add(fiscalPeriod); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(fiscalPeriods); - - return page; - } - - private SearchRequestBuilder getSearchRequest(FiscalPeriodSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), FiscalPeriodEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchFiscalPeriod(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(FiscalPeriod.class.getSimpleName().toLowerCase()) - .setTypes(FiscalPeriod.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FiscalPeriodRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FiscalPeriodRepository.java deleted file mode 100644 index 5845f583d06..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FiscalPeriodRepository.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.FiscalPeriod; -import org.egov.egf.master.domain.model.FiscalPeriodSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FiscalPeriodEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FiscalPeriodJdbcRepository; -import org.egov.egf.master.web.contract.FiscalPeriodSearchContract; -import org.egov.egf.master.web.requests.FiscalPeriodRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FiscalPeriodRepository { - - @Autowired - private FiscalPeriodJdbcRepository fiscalPeriodJdbcRepository; - - @Autowired - private MastersQueueRepository fiscalPeriodQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private FiscalPeriodESRepository fiscalPeriodESRepository; - - public FiscalPeriod findById(FiscalPeriod fiscalPeriod) { - FiscalPeriodEntity entity = fiscalPeriodJdbcRepository - .findById(new FiscalPeriodEntity().toEntity(fiscalPeriod)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return fiscalPeriodJdbcRepository.getSequence(FiscalPeriodEntity.SEQUENCE_NAME); - } - - @Transactional - public FiscalPeriod save(FiscalPeriod fiscalPeriod) { - FiscalPeriodEntity entity = fiscalPeriodJdbcRepository.create(new FiscalPeriodEntity().toEntity(fiscalPeriod)); - return entity.toDomain(); - } - - @Transactional - public FiscalPeriod update(FiscalPeriod fiscalPeriod) { - FiscalPeriodEntity entity = fiscalPeriodJdbcRepository.update(new FiscalPeriodEntity().toEntity(fiscalPeriod)); - return entity.toDomain(); - } - - public void add(FiscalPeriodRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("fiscalperiod_create", request); - } else { - message.put("fiscalperiod_update", request); - } - fiscalPeriodQueueRepository.add(message); - } - - public Pagination search(FiscalPeriodSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - FiscalPeriodSearchContract fiscalPeriodSearchContract = new FiscalPeriodSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, fiscalPeriodSearchContract); - return fiscalPeriodESRepository.search(fiscalPeriodSearchContract); - } else { - return fiscalPeriodJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, FiscalPeriod fiscalPeriod) { - return fiscalPeriodJdbcRepository.uniqueCheck(fieldName, new FiscalPeriodEntity().toEntity(fiscalPeriod)); - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionESRepository.java deleted file mode 100644 index b9cae096d3c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionESRepository.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.persistence.entity.FunctionEntity; -import org.egov.egf.master.web.contract.FunctionSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FunctionESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(FunctionESRepository.class); - - public FunctionESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(FunctionSearchContract functionSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(functionSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToFunctionList(searchResponse, functionSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToFunctionList(SearchResponse searchResponse, FunctionSearchContract functionSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List functions = new ArrayList(); - Function function = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - function = mapper.readValue(hit.getSourceAsString(), Function.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - functions.add(function); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(functions); - - return page; - } - - private SearchRequestBuilder getSearchRequest(FunctionSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), FunctionEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchFunction(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Function.class.getSimpleName().toLowerCase()) - .setTypes(Function.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionRepository.java deleted file mode 100644 index 110947046fd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionRepository.java +++ /dev/null @@ -1,218 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FunctionEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FunctionJdbcRepository; -import org.egov.egf.master.web.contract.FunctionContract; -import org.egov.egf.master.web.contract.FunctionSearchContract; -import org.egov.egf.master.web.requests.FunctionRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FunctionRepository { - - private FunctionJdbcRepository functionJdbcRepository; - - private MastersQueueRepository functionQueueRepository; - - private FinancialConfigurationService financialConfigurationService; - - private FunctionESRepository functionESRepository; - - private String persistThroughKafka; - - @Autowired - public FunctionRepository(FunctionJdbcRepository functionJdbcRepository, - MastersQueueRepository functionQueueRepository, FinancialConfigurationService financialConfigurationService, - FunctionESRepository functionESRepository, @Value("${persist.through.kafka}") String persistThroughKafka) { - this.functionJdbcRepository = functionJdbcRepository; - this.functionQueueRepository = functionQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.functionESRepository = functionESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - @Transactional - public List save(List functions, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - FunctionContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - FunctionRequest request = new FunctionRequest(); - request.setRequestInfo(requestInfo); - request.setFunctions(new ArrayList<>()); - - for (Function f : functions) { - - contract = new FunctionContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunctions().add(contract); - - } - - addToQue(request); - - return functions; - } else { - - List resultList = new ArrayList(); - - for (Function f : functions) { - - resultList.add(save(f)); - } - - FunctionRequest request = new FunctionRequest(); - request.setRequestInfo(requestInfo); - request.setFunctions(new ArrayList<>()); - - for (Function f : resultList) { - - contract = new FunctionContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunctions().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List functions, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - FunctionContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - FunctionRequest request = new FunctionRequest(); - request.setRequestInfo(requestInfo); - request.setFunctions(new ArrayList<>()); - - for (Function f : functions) { - - contract = new FunctionContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunctions().add(contract); - - } - - addToQue(request); - - return functions; - } else { - - List resultList = new ArrayList(); - - for (Function f : functions) { - - resultList.add(update(f)); - } - - FunctionRequest request = new FunctionRequest(); - request.setRequestInfo(requestInfo); - request.setFunctions(new ArrayList<>()); - - for (Function f : resultList) { - - contract = new FunctionContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunctions().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - public String getNextSequence() { - return functionJdbcRepository.getSequence(FunctionEntity.SEQUENCE_NAME); - } - - public Function findById(Function function) { - FunctionEntity entity = functionJdbcRepository.findById(new FunctionEntity().toEntity(function)); - return entity.toDomain(); - - } - - @Transactional - public Function save(Function function) { - FunctionEntity entity = functionJdbcRepository.create(new FunctionEntity().toEntity(function)); - return entity.toDomain(); - } - - @Transactional - public Function update(Function function) { - FunctionEntity entity = functionJdbcRepository.update(new FunctionEntity().toEntity(function)); - return entity.toDomain(); - } - - public void addToQue(FunctionRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("function_create", request); - } else { - message.put("function_update", request); - } - functionQueueRepository.add(message); - } - - public void addToSearchQueue(FunctionRequest request) { - Map message = new HashMap<>(); - - message.put("function_persisted", request); - - functionQueueRepository.addToSearch(message); - } - - public Pagination search(FunctionSearch domain) { - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - FunctionSearchContract functionSearchContract = new FunctionSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, functionSearchContract); - return functionESRepository.search(functionSearchContract); - } else { - return functionJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, Function function) { - return functionJdbcRepository.uniqueCheck(fieldName, new FunctionEntity().toEntity(function)); - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionaryESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionaryESRepository.java deleted file mode 100644 index 61acb3dd934..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionaryESRepository.java +++ /dev/null @@ -1,97 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.elasticsearch.index.query.QueryBuilders.boolQuery; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Functionary; -import org.egov.egf.master.persistence.entity.FunctionaryEntity; -import org.egov.egf.master.web.contract.FunctionarySearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FunctionaryESRepository extends ESRepository { - - public FunctionaryESRepository(TransportClient esClient) { - this.esClient = esClient; - } - public static final Logger LOGGER = LoggerFactory.getLogger(FunctionaryESRepository.class); - - public Pagination search(FunctionarySearchContract functionarySearchContract) { - - SearchRequestBuilder searchRequestBuilder; - BoolQueryBuilder boolQueryBuilder = boolQuery(); - List orderByList = new ArrayList<>(); - - searchRequestBuilder = esClient.prepareSearch(Functionary.class.getSimpleName().toLowerCase()) - .setTypes(Functionary.class.getSimpleName().toLowerCase()); - - if (functionarySearchContract.getSortBy() != null && !functionarySearchContract.getSortBy().isEmpty()) { - validateSortByOrder(functionarySearchContract.getSortBy()); - validateEntityFieldName(functionarySearchContract.getSortBy(), FunctionaryEntity.class); - orderByList = prepareOrderBys(functionarySearchContract.getSortBy()); - } - - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - if (functionarySearchContract.getIds() != null && !functionarySearchContract.getIds().isEmpty()) - add(functionarySearchContract.getIds(), "id", boolQueryBuilder); - add(functionarySearchContract.getId(), "id", boolQueryBuilder); - - add(functionarySearchContract.getName(), "name", boolQueryBuilder); - add(functionarySearchContract.getCode(), "code", boolQueryBuilder); - add(functionarySearchContract.getActive(), "active", boolQueryBuilder); - - searchRequestBuilder.setQuery(boolQueryBuilder); - - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - - return mapToFunctionarysList(searchResponse, functionarySearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToFunctionarysList(SearchResponse searchResponse, - FunctionarySearchContract functionarySearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List functionarys = new ArrayList(); - Functionary functionary = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - try { - functionary = mapper.readValue(hit.getSourceAsString(), Functionary.class); - } catch (Exception e1) { - LOGGER.error("Exception while reading functionary: " + e1.getMessage()); - } - - functionarys.add(functionary); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(functionarys); - - return page; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionaryRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionaryRepository.java deleted file mode 100644 index 7f0a215f344..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FunctionaryRepository.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Functionary; -import org.egov.egf.master.domain.model.FunctionarySearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FunctionaryEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FunctionaryJdbcRepository; -import org.egov.egf.master.web.contract.FunctionarySearchContract; -import org.egov.egf.master.web.requests.FunctionaryRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FunctionaryRepository { - - @Autowired - private FunctionaryJdbcRepository functionaryJdbcRepository; - - @Autowired - private MastersQueueRepository functionaryQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private FunctionaryESRepository functionaryESRepository; - - public Functionary findById(Functionary functionary) { - FunctionaryEntity entity = functionaryJdbcRepository.findById(new FunctionaryEntity().toEntity(functionary)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return functionaryJdbcRepository.getSequence(FunctionaryEntity.SEQUENCE_NAME); - } - - @Transactional - public Functionary save(Functionary functionary) { - FunctionaryEntity entity = functionaryJdbcRepository.create(new FunctionaryEntity().toEntity(functionary)); - return entity.toDomain(); - } - - @Transactional - public Functionary update(Functionary functionary) { - FunctionaryEntity entity = functionaryJdbcRepository.update(new FunctionaryEntity().toEntity(functionary)); - return entity.toDomain(); - } - - public void add(FunctionaryRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("functionary_create", request); - } else { - message.put("functionary_update", request); - } - functionaryQueueRepository.add(message); - } - - public Pagination search(FunctionarySearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - FunctionarySearchContract functionarySearchContract = new FunctionarySearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, functionarySearchContract); - return functionaryESRepository.search(functionarySearchContract); - } else { - return functionaryJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, Functionary functionary) { - return functionaryJdbcRepository.uniqueCheck(fieldName, new FunctionaryEntity().toEntity(functionary)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundESRepository.java deleted file mode 100644 index 82e587a0bb2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundESRepository.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.persistence.entity.FundEntity; -import org.egov.egf.master.web.contract.FundSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FundESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(FundESRepository.class); - - public FundESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(FundSearchContract fundSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(fundSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToFundList(searchResponse, fundSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToFundList(SearchResponse searchResponse, FundSearchContract fundSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List funds = new ArrayList(); - Fund fund = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - fund = mapper.readValue(hit.getSourceAsString(), Fund.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - funds.add(fund); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(funds); - - return page; - } - - private SearchRequestBuilder getSearchRequest(FundSearchContract criteria) { - - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), FundEntity.class); - } - List orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchFund(criteria); - - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Fund.class.getSimpleName().toLowerCase()) - .setTypes(Fund.class.getSimpleName().toLowerCase()); - - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundRepository.java deleted file mode 100644 index 93f4c5b70ec..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundRepository.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FundEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FundJdbcRepository; -import org.egov.egf.master.web.contract.FundContract; -import org.egov.egf.master.web.contract.FundSearchContract; -import org.egov.egf.master.web.requests.FundRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FundRepository { - - private FundJdbcRepository fundJdbcRepository; - - private MastersQueueRepository fundQueueRepository; - - private FinancialConfigurationService financialConfigurationService; - - private FundESRepository fundESRepository; - - private String persistThroughKafka; - - @Autowired - public FundRepository(FundJdbcRepository fundJdbcRepository, MastersQueueRepository fundQueueRepository, - FinancialConfigurationService financialConfigurationService, FundESRepository fundESRepository, - @Value("${persist.through.kafka}") String persistThroughKafka) { - this.fundJdbcRepository = fundJdbcRepository; - this.fundQueueRepository = fundQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.fundESRepository = fundESRepository; - this.persistThroughKafka = persistThroughKafka; - - } - - @Transactional - public List save(List funds, RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - FundContract contract; - Map message = new HashMap<>(); - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - FundRequest request = new FundRequest(); - request.setRequestInfo(requestInfo); - request.setFunds(new ArrayList<>()); - - for (Fund f : funds) { - - contract = new FundContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunds().add(contract); - - } - message.put("fund_create", request); - fundQueueRepository.add(message); - - return funds; - } else { - - List resultList = new ArrayList(); - - for (Fund f : funds) { - - resultList.add(save(f)); - } - - FundRequest request = new FundRequest(); - request.setRequestInfo(requestInfo); - request.setFunds(new ArrayList<>()); - - for (Fund f : resultList) { - - contract = new FundContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunds().add(contract); - - } - - message.put("fund_create", request); - fundQueueRepository.addToSearch(message); - - return resultList; - } - - } - - @Transactional - public List update(List funds, RequestInfo requestInfo) { - ModelMapper mapper = new ModelMapper(); - Map message = new HashMap<>(); - FundRequest request = new FundRequest(); - FundContract contract; - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - request.setRequestInfo(requestInfo); - request.setFunds(new ArrayList<>()); - for (Fund f : funds) { - contract = new FundContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunds().add(contract); - } - message.put("fund_update", request); - fundQueueRepository.add(message); - return funds; - } else { - List resultList = new ArrayList(); - for (Fund f : funds) { - resultList.add(update(f)); - } - request.setRequestInfo(requestInfo); - request.setFunds(new ArrayList<>()); - for (Fund f : resultList) { - contract = new FundContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getFunds().add(contract); - } - message.put("fund_persisted", request); - fundQueueRepository.addToSearch(message); - return resultList; - } - - } - - public String getNextSequence() { - return fundJdbcRepository.getSequence(FundEntity.SEQUENCE_NAME); - } - - public Fund findById(Fund fund) { - FundEntity entity = fundJdbcRepository.findById(new FundEntity().toEntity(fund)); - return entity.toDomain(); - - } - - @Transactional - public Fund save(Fund fund) { - FundEntity entity = fundJdbcRepository.create(new FundEntity().toEntity(fund)); - - return entity.toDomain(); - - } - - @Transactional - public Fund update(Fund fund) { - FundEntity entity = fundJdbcRepository.update(new FundEntity().toEntity(fund)); - return entity.toDomain(); - } - - - public Pagination search(FundSearch domain) { - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - FundSearchContract fundSearchContract = new FundSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, fundSearchContract); - return fundESRepository.search(fundSearchContract); - } else { - return fundJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, Fund fund) { - return fundJdbcRepository.uniqueCheck(fieldName, new FundEntity().toEntity(fund)); - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundsourceESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundsourceESRepository.java deleted file mode 100644 index 608dafd2520..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundsourceESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Fundsource; -import org.egov.egf.master.persistence.entity.FundsourceEntity; -import org.egov.egf.master.web.contract.FundsourceSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FundsourceESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(FundsourceESRepository.class); - - public FundsourceESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(FundsourceSearchContract fundsourceSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(fundsourceSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToFundsourceList(searchResponse,fundsourceSearchContract); - } - - - @SuppressWarnings("deprecation") - private Pagination mapToFundsourceList(SearchResponse searchResponse,FundsourceSearchContract fundsourceSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List Fundsources = new ArrayList(); - Fundsource fundsource=null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - //JSON from file to Object - try { - fundsource = mapper.readValue(hit.getSourceAsString(), Fundsource.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - Fundsources.add(fundsource); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(Fundsources); - - return page; - } - - private SearchRequestBuilder getSearchRequest(FundsourceSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), FundsourceEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchFundsource(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Fundsource.class.getSimpleName().toLowerCase()).setTypes(Fundsource.class.getSimpleName().toLowerCase()) - ; - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundsourceRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundsourceRepository.java deleted file mode 100644 index b031b076bf4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/FundsourceRepository.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Fundsource; -import org.egov.egf.master.domain.model.FundsourceSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FundsourceEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FundsourceJdbcRepository; -import org.egov.egf.master.web.contract.FundsourceSearchContract; -import org.egov.egf.master.web.requests.FundsourceRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class FundsourceRepository { - - @Autowired - private FundsourceJdbcRepository fundsourceJdbcRepository; - @Autowired - private MastersQueueRepository fundsourceQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private FundsourceESRepository fundsourceESRepository; - - public Fundsource findById(Fundsource fundsource) { - FundsourceEntity entity = fundsourceJdbcRepository.findById(new FundsourceEntity().toEntity(fundsource)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return fundsourceJdbcRepository.getSequence(FundsourceEntity.SEQUENCE_NAME); - } - - @Transactional - public Fundsource save(Fundsource fundsource) { - FundsourceEntity entity = fundsourceJdbcRepository.create(new FundsourceEntity().toEntity(fundsource)); - return entity.toDomain(); - } - - @Transactional - public Fundsource update(Fundsource fundsource) { - FundsourceEntity entity = fundsourceJdbcRepository.update(new FundsourceEntity().toEntity(fundsource)); - return entity.toDomain(); - } - - public void add(FundsourceRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("fundsource_create", request); - } else { - message.put("fundsource_update", request); - } - fundsourceQueueRepository.add(message); - } - - public Pagination search(FundsourceSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - FundsourceSearchContract fundsourceSearchContract = new FundsourceSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, fundsourceSearchContract); - return fundsourceESRepository.search(fundsourceSearchContract); - } else { - return fundsourceJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, Fundsource fundsource) { - return fundsourceJdbcRepository.uniqueCheck(fieldName, new FundsourceEntity().toEntity(fundsource)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/RecoveryESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/RecoveryESRepository.java deleted file mode 100644 index 752c248e5e4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/RecoveryESRepository.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.persistence.entity.RecoveryEntity; -import org.egov.egf.master.web.contract.RecoverySearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -@Service -public class RecoveryESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(RecoveryESRepository.class); - - public RecoveryESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(RecoverySearchContract recoverySearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(recoverySearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToRecoveryList(searchResponse, recoverySearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToRecoveryList(SearchResponse searchResponse, RecoverySearchContract recoverySearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List recoverys = new ArrayList(); - Recovery recovery = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - recovery = mapper.readValue(hit.getSourceAsString(), Recovery.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - recoverys.add(recovery); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(recoverys); - - return page; - } - - private SearchRequestBuilder getSearchRequest(RecoverySearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), RecoveryEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchRecovery(criteria); - - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Recovery.class.getSimpleName().toLowerCase()) - .setTypes(Recovery.class.getSimpleName().toLowerCase()); - - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/RecoveryRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/RecoveryRepository.java deleted file mode 100644 index dce3f89736e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/RecoveryRepository.java +++ /dev/null @@ -1,221 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.RecoveryEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.RecoveryJdbcRepository; -import org.egov.egf.master.web.contract.RecoveryContract; -import org.egov.egf.master.web.contract.RecoverySearchContract; -import org.egov.egf.master.web.requests.RecoveryRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.annotation.Transactional; - -@Repository -public class RecoveryRepository { - - private MastersQueueRepository recoveryQueueRepository; - - private FinancialConfigurationService financialConfigurationService; - - private String persistThroughKafka; - - private RecoveryJdbcRepository recoveryJdbcRepository; - - private RecoveryESRepository recoveryESRepository; - - @Autowired - public RecoveryRepository(MastersQueueRepository recoveryQueueRepository, FinancialConfigurationService financialConfigurationService, - @Value("${persist.through.kafka}") String persistThroughKafka, - RecoveryJdbcRepository recoveryJdbcRepository, - RecoveryESRepository recoveryESRepository) { - this.recoveryQueueRepository = recoveryQueueRepository; - this.financialConfigurationService = financialConfigurationService; - this.persistThroughKafka = persistThroughKafka; - this.recoveryJdbcRepository = recoveryJdbcRepository; - this.recoveryESRepository = recoveryESRepository; - - } - - @Transactional - public List save(List recoveries, - RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - RecoveryContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - RecoveryRequest request = new RecoveryRequest(); - request.setRequestInfo(requestInfo); - request.setRecoverys(new ArrayList<>()); - - for (Recovery f : recoveries) { - - contract = new RecoveryContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getRecoverys().add(contract); - - } - - addToQue(request); - - return recoveries; - } else { - - List resultList = new ArrayList(); - - for (Recovery f : recoveries) { - - resultList.add(save(f)); - } - - RecoveryRequest request = new RecoveryRequest(); - request.setRequestInfo(requestInfo); - request.setRecoverys(new ArrayList<>()); - - for (Recovery f : resultList) { - - contract = new RecoveryContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getRecoverys().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - @Transactional - public List update(List recoveries, - RequestInfo requestInfo) { - - ModelMapper mapper = new ModelMapper(); - RecoveryContract contract; - - if (persistThroughKafka != null && !persistThroughKafka.isEmpty() - && persistThroughKafka.equalsIgnoreCase("yes")) { - - RecoveryRequest request = new RecoveryRequest(); - request.setRequestInfo(requestInfo); - request.setRecoverys(new ArrayList<>()); - - for (Recovery f : recoveries) { - - contract = new RecoveryContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getRecoverys().add(contract); - - } - - addToQue(request); - - return recoveries; - } else { - - List resultList = new ArrayList(); - - for (Recovery f : recoveries) { - - resultList.add(update(f)); - } - - RecoveryRequest request = new RecoveryRequest(); - request.setRequestInfo(requestInfo); - request.setRecoverys(new ArrayList<>()); - - for (Recovery f : resultList) { - - contract = new RecoveryContract(); - contract.setCreatedDate(new Date()); - mapper.map(f, contract); - request.getRecoverys().add(contract); - - } - - addToSearchQueue(request); - - return resultList; - } - - } - - public String getNextSequence() { - return recoveryJdbcRepository.getSequence(RecoveryEntity.SEQUENCE_NAME); - } - - public Recovery findById(Recovery recovery) { - RecoveryEntity entity = recoveryJdbcRepository.findById(new RecoveryEntity().toEntity(recovery)); - return entity.toDomain(); - - } - - @Transactional - public Recovery save(Recovery recovery) { - RecoveryEntity entity = recoveryJdbcRepository.create(new RecoveryEntity().toEntity(recovery)); - return entity.toDomain(); - } - - @Transactional - public Recovery update(Recovery recovery) { - RecoveryEntity entity = recoveryJdbcRepository.update(new RecoveryEntity().toEntity(recovery)); - return entity.toDomain(); - } - - public void addToQue(RecoveryRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("recovery_create", request); - } else { - message.put("recovery_update", request); - } - recoveryQueueRepository.add(message); - } - - public void addToSearchQueue(RecoveryRequest request) { - Map message = new HashMap<>(); - - message.put("recovery_persisted", request); - - recoveryQueueRepository.addToSearch(message); - } - - public Pagination search(RecoverySearch domain) { - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - RecoverySearchContract recoverySearchContract = new RecoverySearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, recoverySearchContract); - return recoveryESRepository.search(recoverySearchContract); - } else { - return recoveryJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, Recovery recovery) { - return recoveryJdbcRepository.uniqueCheck(fieldName, new RecoveryEntity().toEntity(recovery)); - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SchemeESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SchemeESRepository.java deleted file mode 100644 index dd387ad30f5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SchemeESRepository.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.persistence.entity.SchemeEntity; -import org.egov.egf.master.web.contract.SchemeSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class SchemeESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(SchemeESRepository.class); - - public SchemeESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(SchemeSearchContract schemeSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(schemeSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToSchemeList(searchResponse, schemeSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToSchemeList(SearchResponse searchResponse, SchemeSearchContract schemeSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List schemes = new ArrayList(); - Scheme scheme = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - scheme = mapper.readValue(hit.getSourceAsString(), Scheme.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - schemes.add(scheme); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(schemes); - - return page; - } - - private SearchRequestBuilder getSearchRequest(SchemeSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), SchemeEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchScheme(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Scheme.class.getSimpleName().toLowerCase()) - .setTypes(Scheme.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SchemeRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SchemeRepository.java deleted file mode 100644 index 6d2b339e929..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SchemeRepository.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.domain.model.SchemeSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.SchemeEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.SchemeJdbcRepository; -import org.egov.egf.master.web.contract.SchemeSearchContract; -import org.egov.egf.master.web.requests.SchemeRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class SchemeRepository { - - @Autowired - private SchemeJdbcRepository schemeJdbcRepository; - - @Autowired - private MastersQueueRepository schemeQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private SchemeESRepository schemeESRepository; - - public Scheme findById(Scheme scheme) { - SchemeEntity entity = schemeJdbcRepository.findById(new SchemeEntity().toEntity(scheme)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return schemeJdbcRepository.getSequence(SchemeEntity.SEQUENCE_NAME); - } - - @Transactional - public Scheme save(Scheme scheme) { - SchemeEntity entity = schemeJdbcRepository.create(new SchemeEntity().toEntity(scheme)); - return entity.toDomain(); - } - - @Transactional - public Scheme update(Scheme scheme) { - SchemeEntity entity = schemeJdbcRepository.update(new SchemeEntity().toEntity(scheme)); - return entity.toDomain(); - } - - public void add(SchemeRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("scheme_create", request); - } else { - message.put("scheme_update", request); - } - schemeQueueRepository.add(message); - } - - public Pagination search(SchemeSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - SchemeSearchContract schemeSearchContract = new SchemeSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, schemeSearchContract); - return schemeESRepository.search(schemeSearchContract); - } else { - return schemeJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, Scheme scheme) { - return schemeJdbcRepository.uniqueCheck(fieldName, new SchemeEntity().toEntity(scheme)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SubSchemeESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SubSchemeESRepository.java deleted file mode 100644 index b225d695e72..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SubSchemeESRepository.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.SubScheme; -import org.egov.egf.master.persistence.entity.SubSchemeEntity; -import org.egov.egf.master.web.contract.SubSchemeSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class SubSchemeESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(SubSchemeESRepository.class); - - public SubSchemeESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(SubSchemeSearchContract subSchemeSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(subSchemeSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToSubSchemeList(searchResponse, subSchemeSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToSubSchemeList(SearchResponse searchResponse, - SubSchemeSearchContract subSchemeSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List subSchemes = new ArrayList(); - SubScheme subScheme = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - subScheme = mapper.readValue(hit.getSourceAsString(), SubScheme.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - subSchemes.add(subScheme); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(subSchemes); - - return page; - } - - private SearchRequestBuilder getSearchRequest(SubSchemeSearchContract criteria) { - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), SubSchemeEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchSubScheme(criteria); - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(SubScheme.class.getSimpleName().toLowerCase()) - .setTypes(SubScheme.class.getSimpleName().toLowerCase()); - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SubSchemeRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SubSchemeRepository.java deleted file mode 100644 index e3d4eddc075..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SubSchemeRepository.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.SubScheme; -import org.egov.egf.master.domain.model.SubSchemeSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.SubSchemeEntity; -import org.egov.egf.master.persistence.entity.SupplierEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.SubSchemeJdbcRepository; -import org.egov.egf.master.web.contract.SubSchemeSearchContract; -import org.egov.egf.master.web.requests.SubSchemeRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class SubSchemeRepository { - - @Autowired - private SubSchemeJdbcRepository subSchemeJdbcRepository; - - @Autowired - private MastersQueueRepository subSchemeQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private SubSchemeESRepository subSchemeESRepository; - - public SubScheme findById(SubScheme subScheme) { - SubSchemeEntity entity = subSchemeJdbcRepository.findById(new SubSchemeEntity().toEntity(subScheme)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return subSchemeJdbcRepository.getSequence(SubSchemeEntity.SEQUENCE_NAME); - } - - @Transactional - public SubScheme save(SubScheme subScheme) { - SubSchemeEntity entity = subSchemeJdbcRepository.create(new SubSchemeEntity().toEntity(subScheme)); - return entity.toDomain(); - } - - @Transactional - public SubScheme update(SubScheme subScheme) { - SubSchemeEntity entity = subSchemeJdbcRepository.update(new SubSchemeEntity().toEntity(subScheme)); - return entity.toDomain(); - } - - public void add(SubSchemeRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("subscheme_create", request); - } else { - message.put("subscheme_update", request); - } - subSchemeQueueRepository.add(message); - } - - public Pagination search(SubSchemeSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - SubSchemeSearchContract subSchemeSearchContract = new SubSchemeSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, subSchemeSearchContract); - return subSchemeESRepository.search(subSchemeSearchContract); - } else { - return subSchemeJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, SubScheme subScheme) { - return subSchemeJdbcRepository.uniqueCheck(fieldName, new SubSchemeEntity().toEntity(subScheme)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SupplierESRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SupplierESRepository.java deleted file mode 100644 index 3fb52e863b7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SupplierESRepository.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.ESRepository; -import org.egov.egf.master.domain.model.Supplier; -import org.egov.egf.master.persistence.entity.SupplierEntity; -import org.egov.egf.master.web.contract.SupplierSearchContract; -import org.elasticsearch.action.search.SearchRequestBuilder; -import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.client.transport.TransportClient; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.search.SearchHit; -import org.elasticsearch.search.sort.SortOrder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class SupplierESRepository extends ESRepository { - - private TransportClient esClient; - private ElasticSearchQueryFactory elasticSearchQueryFactory; - public static final Logger LOGGER = LoggerFactory.getLogger(SupplierESRepository.class); - - public SupplierESRepository(TransportClient esClient, ElasticSearchQueryFactory elasticSearchQueryFactory) { - this.esClient = esClient; - this.elasticSearchQueryFactory = elasticSearchQueryFactory; - } - - public Pagination search(SupplierSearchContract supplierSearchContract) { - final SearchRequestBuilder searchRequestBuilder = getSearchRequest(supplierSearchContract); - final SearchResponse searchResponse = searchRequestBuilder.execute().actionGet(); - return mapToSupplierList(searchResponse, supplierSearchContract); - } - - @SuppressWarnings("deprecation") - private Pagination mapToSupplierList(SearchResponse searchResponse, SupplierSearchContract supplierSearchContract) { - Pagination page = new Pagination<>(); - if (searchResponse.getHits() == null || searchResponse.getHits().getTotalHits() == 0L) { - return page; - } - List suppliers = new ArrayList(); - Supplier supplier = null; - for (SearchHit hit : searchResponse.getHits()) { - - ObjectMapper mapper = new ObjectMapper(); - // JSON from file to Object - try { - supplier = mapper.readValue(hit.getSourceAsString(), Supplier.class); - } catch (JsonParseException e1) { - // TODO Auto-generated catch block - LOGGER.error("Error while parsing JSON: " + e1.getMessage()); - } catch (JsonMappingException e1) { - // TODO Auto-generated catch block - LOGGER.error("JSON mapping exception occurred: " + e1.getMessage()); - } catch (IOException e1) { - // TODO Auto-generated catch block - LOGGER.error("IO exception occurred: " + e1.getMessage()); - } - - suppliers.add(supplier); - } - - page.setTotalResults(Long.valueOf(searchResponse.getHits().getTotalHits()).intValue()); - page.setPagedData(suppliers); - - return page; - } - - private SearchRequestBuilder getSearchRequest(SupplierSearchContract criteria) { - - List orderByList = new ArrayList<>(); - if (criteria.getSortBy() != null && !criteria.getSortBy().isEmpty()) { - validateSortByOrder(criteria.getSortBy()); - validateEntityFieldName(criteria.getSortBy(), SupplierEntity.class); - orderByList = elasticSearchQueryFactory.prepareOrderBys(criteria.getSortBy()); - } - - final BoolQueryBuilder boolQueryBuilder = elasticSearchQueryFactory.searchSupplier(criteria); - - SearchRequestBuilder searchRequestBuilder = esClient.prepareSearch(Supplier.class.getSimpleName().toLowerCase()) - .setTypes(Supplier.class.getSimpleName().toLowerCase()); - - if (!orderByList.isEmpty()) { - for (String orderBy : orderByList) { - searchRequestBuilder = searchRequestBuilder.addSort(orderBy.split(" ")[0], - orderBy.split(" ")[1].equalsIgnoreCase("asc") ? SortOrder.ASC : SortOrder.DESC); - } - } - - searchRequestBuilder.setQuery(boolQueryBuilder); - - return searchRequestBuilder; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SupplierRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SupplierRepository.java deleted file mode 100644 index 94fd25cbe48..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/repository/SupplierRepository.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Supplier; -import org.egov.egf.master.domain.model.SupplierSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.SupplierEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.SupplierJdbcRepository; -import org.egov.egf.master.web.contract.SupplierSearchContract; -import org.egov.egf.master.web.requests.SupplierRequest; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -public class SupplierRepository { - - @Autowired - private SupplierJdbcRepository supplierJdbcRepository; - - @Autowired - private MastersQueueRepository supplierQueueRepository; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private SupplierESRepository supplierESRepository; - - public Supplier findById(Supplier supplier) { - SupplierEntity entity = supplierJdbcRepository.findById(new SupplierEntity().toEntity(supplier)); - return entity.toDomain(); - - } - - public String getNextSequence(){ - return supplierJdbcRepository.getSequence(SupplierEntity.SEQUENCE_NAME); - } - - @Transactional - public Supplier save(Supplier supplier) { - SupplierEntity entity = supplierJdbcRepository.create(new SupplierEntity().toEntity(supplier)); - return entity.toDomain(); - } - - @Transactional - public Supplier update(Supplier supplier) { - SupplierEntity entity = supplierJdbcRepository.update(new SupplierEntity().toEntity(supplier)); - return entity.toDomain(); - } - - public void add(SupplierRequest request) { - Map message = new HashMap<>(); - - if (request.getRequestInfo().getAction().equalsIgnoreCase(Constants.ACTION_CREATE)) { - message.put("supplier_create", request); - } else { - message.put("supplier_update", request); - } - supplierQueueRepository.add(message); - } - - public Pagination search(SupplierSearch domain) { - - if (!financialConfigurationService.fetchDataFrom().isEmpty() - && financialConfigurationService.fetchDataFrom().equalsIgnoreCase("es")) { - SupplierSearchContract supplierSearchContract = new SupplierSearchContract(); - ModelMapper mapper = new ModelMapper(); - mapper.map(domain, supplierSearchContract); - return supplierESRepository.search(supplierSearchContract); - } else { - return supplierJdbcRepository.search(domain); - } - - } - - public boolean uniqueCheck(String fieldName, Supplier supplier) { - return supplierJdbcRepository.uniqueCheck(fieldName, new SupplierEntity().toEntity(supplier)); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountCodePurposeService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountCodePurposeService.java deleted file mode 100644 index 7f27aae6839..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountCodePurposeService.java +++ /dev/null @@ -1,218 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.egov.common.constants.Constants.ACTION_CREATE; -import static org.egov.common.constants.Constants.ACTION_UPDATE; -import static org.egov.common.constants.Constants.ACTION_VIEW; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.domain.repository.AccountCodePurposeRepository; -import org.egov.egf.master.web.requests.AccountCodePurposeRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class AccountCodePurposeService { - - @Autowired - private AccountCodePurposeRepository accountCodePurposeRepository; - - @Autowired - private SmartValidator validator; - - @Transactional - public List create(List accountCodePurposes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - accountCodePurposes = fetchRelated(accountCodePurposes); - - validate(accountCodePurposes, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountCodePurpose account : accountCodePurposes) { - account.setId(accountCodePurposeRepository.getNextSequence()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountCodePurposeRepository.save(accountCodePurposes, requestInfo); - - } - - @Transactional - public List update(List accountCodePurposes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - accountCodePurposes = fetchRelated(accountCodePurposes); - - validate(accountCodePurposes, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountCodePurposeRepository.update(accountCodePurposes, requestInfo); - - } - - private BindingResult validate(List accountcodepurposes, String method, BindingResult errors) { - - try { - switch (method) { - case ACTION_VIEW: - // validator.validate(accountCodePurposeContractRequest.getAccountCodePurpose(), - // errors); - break; - case ACTION_CREATE: - if (accountcodepurposes == null) { - throw new InvalidDataException("accountcodepurposes", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountCodePurpose accountCodePurpose : accountcodepurposes) { - validator.validate(accountCodePurpose, errors); - - if (!accountCodePurposeRepository.uniqueCheck("name", accountCodePurpose)) { - errors.addError(new FieldError("accountCodePurpose", "name", accountCodePurpose.getName(), - false, new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - - } - break; - case ACTION_UPDATE: - if (accountcodepurposes == null) { - throw new InvalidDataException("accountcodepurposes", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountCodePurpose accountCodePurpose : accountcodepurposes) { - if (accountCodePurpose.getId() == null) { - throw new InvalidDataException("id", ErrorCode.NULL_VALUE.getCode(), - accountCodePurpose.getId()); - } - validator.validate(accountCodePurpose, errors); - - if (!accountCodePurposeRepository.uniqueCheck("name", accountCodePurpose)) { - errors.addError(new FieldError("accountCodePurpose", "name", accountCodePurpose.getName(), - false, new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - - } - break; - case Constants.ACTION_SEARCH: - if (accountcodepurposes == null) { - throw new InvalidDataException("accountcodepurposes", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountCodePurpose accountcodepurpose : accountcodepurposes) { - if (accountcodepurpose.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - accountcodepurpose.getTenantId()); - } - - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List accountcodepurposes) { - for (AccountCodePurpose accountCodePurpose : accountcodepurposes) { - // fetch related items - accountCodePurpose.setTenantId(ApplicationThreadLocals.getTenantId().get()); - - } - - return accountcodepurposes; - } - - @Transactional - public List add(List accountcodepurposes, BindingResult errors) { - accountcodepurposes = fetchRelated(accountcodepurposes); - validate(accountcodepurposes, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountCodePurpose b : accountcodepurposes) - b.setId(accountCodePurposeRepository.getNextSequence()); - return accountcodepurposes; - - } - - @Transactional - public List update(List accountcodepurposes, BindingResult errors) { - accountcodepurposes = fetchRelated(accountcodepurposes); - validate(accountcodepurposes, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return accountcodepurposes; - - } - - public void addToQue(AccountCodePurposeRequest request) { - accountCodePurposeRepository.add(request); - } - - public Pagination search(AccountCodePurposeSearch accountCodePurposeSearch, - BindingResult errors) { - - try { - - List accountCodePurposes = new ArrayList<>(); - accountCodePurposes.add(accountCodePurposeSearch); - validate(accountCodePurposes, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountCodePurposeRepository.search(accountCodePurposeSearch); - } - - @Transactional - public AccountCodePurpose save(AccountCodePurpose accountCodePurpose) { - return accountCodePurposeRepository.save(accountCodePurpose); - } - - @Transactional - public AccountCodePurpose update(AccountCodePurpose accountCodePurpose) { - return accountCodePurposeRepository.update(accountCodePurpose); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountDetailKeyService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountDetailKeyService.java deleted file mode 100644 index 94a25afcfc8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountDetailKeyService.java +++ /dev/null @@ -1,213 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.repository.AccountDetailKeyRepository; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.egov.egf.master.web.requests.AccountDetailKeyRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class AccountDetailKeyService { - - @Autowired - private AccountDetailKeyRepository accountDetailKeyRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private AccountDetailTypeRepository accountDetailTypeRepository; - - @Transactional - public List create(List accountDetailKies, BindingResult errors, - RequestInfo requestInfo) { - - try { - - accountDetailKies = fetchRelated(accountDetailKies); - - validate(accountDetailKies, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountDetailKey b : accountDetailKies) { - b.setId(accountDetailKeyRepository.getNextSequence()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountDetailKeyRepository.save(accountDetailKies, requestInfo); - - } - - @Transactional - public List update(List accountDetailKies, BindingResult errors, - RequestInfo requestInfo) { - - try { - - accountDetailKies = fetchRelated(accountDetailKies); - - validate(accountDetailKies, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountDetailKeyRepository.update(accountDetailKies, requestInfo); - - } - - private BindingResult validate(List accountdetailkeys, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(accountDetailKeyContractRequest.getAccountDetailKey(), - // errors); - break; - case Constants.ACTION_CREATE: - if (accountdetailkeys == null) { - throw new InvalidDataException("accountdetailkeys", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountDetailKey accountDetailKey : accountdetailkeys) { - validator.validate(accountDetailKey, errors); - } - break; - case Constants.ACTION_UPDATE: - if (accountdetailkeys == null) { - throw new InvalidDataException("accountdetailkeys", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountDetailKey accountDetailKey : accountdetailkeys) { - if (accountDetailKey.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - accountDetailKey.getId()); - } - validator.validate(accountDetailKey, errors); - } - break; - case Constants.ACTION_SEARCH: - if (accountdetailkeys == null) { - throw new InvalidDataException("accountdetailkeys", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountDetailKey accountdetailkey : accountdetailkeys) { - if (accountdetailkey.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - accountdetailkey.getId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - - } - - public List fetchRelated(List accountdetailkeys) { - for (AccountDetailKey accountDetailKey : accountdetailkeys) { - accountDetailKey.setTenantId(ApplicationThreadLocals.getTenantId().get()); - // fetch related items - if (accountDetailKey.getAccountDetailType() != null) { - AccountDetailType accountDetailType = accountDetailTypeRepository - .findById(accountDetailKey.getAccountDetailType()); - if (accountDetailType == null) { - throw new InvalidDataException("accountDetailType", "accountDetailType.invalid", - " Invalid accountDetailType"); - } - accountDetailKey.setAccountDetailType(accountDetailType); - } - - } - - return accountdetailkeys; - } - - @Transactional - public List add(List accountdetailkeys, BindingResult errors) { - accountdetailkeys = fetchRelated(accountdetailkeys); - validate(accountdetailkeys, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountDetailKey key : accountdetailkeys) - key.setId(accountDetailKeyRepository.getNextSequence()); - return accountdetailkeys; - - } - - @Transactional - public List update(List accountdetailkeys, BindingResult errors) { - accountdetailkeys = fetchRelated(accountdetailkeys); - validate(accountdetailkeys, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return accountdetailkeys; - - } - - public void addToQue(AccountDetailKeyRequest request) { - accountDetailKeyRepository.add(request); - } - - public Pagination search(AccountDetailKeySearch accountDetailKeySearch, BindingResult errors) { - - try { - - List accountDetailKeys = new ArrayList<>(); - accountDetailKeys.add(accountDetailKeySearch); - validate(accountDetailKeys, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountDetailKeyRepository.search(accountDetailKeySearch); - } - - @Transactional - public AccountDetailKey save(AccountDetailKey accountDetailKey) { - return accountDetailKeyRepository.save(accountDetailKey); - } - - @Transactional - public AccountDetailKey update(AccountDetailKey accountDetailKey) { - return accountDetailKeyRepository.update(accountDetailKey); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountDetailTypeService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountDetailTypeService.java deleted file mode 100644 index 0ec4e1ea77f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountDetailTypeService.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.egov.egf.master.web.requests.AccountDetailTypeRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class AccountDetailTypeService { - - @Autowired - private AccountDetailTypeRepository accountDetailTypeRepository; - - @Autowired - private SmartValidator validator; - - @Transactional - public List create(List accountDetailTypes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - accountDetailTypes = fetchRelated(accountDetailTypes); - - validate(accountDetailTypes, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountDetailType b : accountDetailTypes) { - b.setId(accountDetailTypeRepository.getNextSequence()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountDetailTypeRepository.save(accountDetailTypes, requestInfo); - - } - - @Transactional - public List update(List accountDetailTypes, BindingResult errors, - RequestInfo requestInfo) { - - try { - - accountDetailTypes = fetchRelated(accountDetailTypes); - - validate(accountDetailTypes, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountDetailTypeRepository.update(accountDetailTypes, requestInfo); - - } - - private BindingResult validate(List accountdetailtypes, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(accountDetailTypeContractRequest.getAccountDetailType(), - // errors); - break; - case Constants.ACTION_CREATE: - if (accountdetailtypes == null) { - throw new InvalidDataException("accountdetailtypes", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountDetailType accountDetailType : accountdetailtypes) { - validator.validate(accountDetailType, errors); - if (!accountDetailTypeRepository.uniqueCheck("name", accountDetailType)) { - errors.addError(new FieldError("accountDetailType", "name", accountDetailType.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (accountdetailtypes == null) { - throw new InvalidDataException("accountdetailtypes", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountDetailType accountDetailType : accountdetailtypes) { - if (accountDetailType.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - accountDetailType.getId()); - } - validator.validate(accountDetailType, errors); - if (!accountDetailTypeRepository.uniqueCheck("name", accountDetailType)) { - errors.addError(new FieldError("accountDetailType", "name", accountDetailType.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (accountdetailtypes == null) { - throw new InvalidDataException("accountdetailtypes", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountDetailType accountdetailtype : accountdetailtypes) { - if (accountdetailtype.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - accountdetailtype.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List accountdetailtypes) { - for (AccountDetailType accountDetailType : accountdetailtypes) { - // fetch related items - accountDetailType.setTenantId(ApplicationThreadLocals.getTenantId().get()); - - } - - return accountdetailtypes; - } - - @Transactional - public List add(List accountdetailtypes, BindingResult errors) { - accountdetailtypes = fetchRelated(accountdetailtypes); - validate(accountdetailtypes, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountDetailType b : accountdetailtypes) - b.setId(accountDetailTypeRepository.getNextSequence()); - return accountdetailtypes; - - } - - @Transactional - public List update(List accountdetailtypes, BindingResult errors) { - accountdetailtypes = fetchRelated(accountdetailtypes); - validate(accountdetailtypes, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return accountdetailtypes; - - } - - public void addToQue(AccountDetailTypeRequest request) { - accountDetailTypeRepository.add(request); - } - - public Pagination search(AccountDetailTypeSearch accountDetailTypeSearch, BindingResult errors) { - - try { - - List accountDetailTypes = new ArrayList<>(); - accountDetailTypes.add(accountDetailTypeSearch); - validate(accountDetailTypes, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountDetailTypeRepository.search(accountDetailTypeSearch); - } - - @Transactional - public AccountDetailType save(AccountDetailType accountDetailType) { - return accountDetailTypeRepository.save(accountDetailType); - } - - @Transactional - public AccountDetailType update(AccountDetailType accountDetailType) { - return accountDetailTypeRepository.update(accountDetailType); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountEntityService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountEntityService.java deleted file mode 100644 index 78f2bb04aee..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/AccountEntityService.java +++ /dev/null @@ -1,225 +0,0 @@ -package org.egov.egf.master.domain.service; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.egov.egf.master.domain.repository.AccountEntityRepository; -import org.egov.egf.master.web.requests.AccountEntityRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -import java.util.ArrayList; -import java.util.List; - -@Service -@Transactional(readOnly = true) -public class AccountEntityService { - - @Autowired - private AccountEntityRepository accountEntityRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private AccountDetailTypeRepository accountDetailTypeRepository; - - @Transactional - public List create(List accountEntities, BindingResult errors, RequestInfo requestInfo) { - - try { - - accountEntities = fetchRelated(accountEntities); - - validate(accountEntities, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountEntity b : accountEntities) { - b.setId(accountEntityRepository.getNextSequence()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountEntityRepository.save(accountEntities, requestInfo); - - } - - @Transactional - public List update(List accountEntities, BindingResult errors, RequestInfo requestInfo) { - - try { - - accountEntities = fetchRelated(accountEntities); - - validate(accountEntities, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountEntityRepository.update(accountEntities, requestInfo); - - } - - private BindingResult validate(List accountentities, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(accountEntityContractRequest.getAccountEntity(), - // errors); - break; - case Constants.ACTION_CREATE: - if (accountentities == null) { - throw new InvalidDataException("accountentities", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountEntity accountEntity : accountentities) { - validator.validate(accountEntity, errors); - if (!accountEntityRepository.uniqueCheck("name", accountEntity)) { - errors.addError(new FieldError("accountEntity", "name", accountEntity.getName(), false, - new String[]{ErrorCode.NON_UNIQUE_VALUE.getCode()}, null, null)); - } - if (!accountEntityRepository.uniqueCheck("code", accountEntity)) { - errors.addError(new FieldError("accountEntity", "code", accountEntity.getCode(), false, - new String[]{ErrorCode.NON_UNIQUE_VALUE.getCode()}, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (accountentities == null) { - throw new InvalidDataException("accountentities", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountEntity accountEntity : accountentities) { - if (accountEntity.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), accountEntity.getId()); - } - validator.validate(accountEntity, errors); - if (!accountEntityRepository.uniqueCheck("name", accountEntity)) { - errors.addError(new FieldError("accountEntity", "name", accountEntity.getName(), false, - new String[]{ErrorCode.NON_UNIQUE_VALUE.getCode()}, null, null)); - } - if (!accountEntityRepository.uniqueCheck("code", accountEntity)) { - errors.addError(new FieldError("accountEntity", "code", accountEntity.getCode(), false, - new String[]{ErrorCode.NON_UNIQUE_VALUE.getCode()}, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (accountentities == null) { - throw new InvalidDataException("accountentities", ErrorCode.NOT_NULL.getCode(), null); - } - for (AccountEntity accountEntity : accountentities) { - if (accountEntity.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - accountEntity.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List accountentities) { - for (AccountEntity accountEntity : accountentities) { - // fetch related items - accountEntity.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (accountEntity.getAccountDetailType() != null) { - AccountDetailType accountDetailType = accountDetailTypeRepository - .findById(accountEntity.getAccountDetailType()); - if (accountDetailType == null) { - throw new InvalidDataException("accountDetailType", "accountDetailType.invalid", - " Invalid accountDetailType"); - } - accountEntity.setAccountDetailType(accountDetailType); - } - - } - - return accountentities; - } - - @Transactional - public List add(List accountentities, BindingResult errors) { - accountentities = fetchRelated(accountentities); - validate(accountentities, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (AccountEntity b : accountentities) b.setId(accountEntityRepository.getNextSequence()); - return accountentities; - - } - - @Transactional - public List update(List accountentities, BindingResult errors) { - accountentities = fetchRelated(accountentities); - validate(accountentities, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return accountentities; - - } - - public void addToQue(AccountEntityRequest request) { - accountEntityRepository.add(request); - } - - public Pagination search(AccountEntitySearch accountEntitySearch, BindingResult errors) { - - try { - - List accountentities = new ArrayList<>(); - accountentities.add(accountEntitySearch); - validate(accountentities, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return accountEntityRepository.search(accountEntitySearch); - } - - @Transactional - public AccountEntity save(AccountEntity accountEntity) { - return accountEntityRepository.save(accountEntity); - } - - @Transactional - public AccountEntity update(AccountEntity accountEntity) { - return accountEntityRepository.update(accountEntity); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankAccountService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankAccountService.java deleted file mode 100644 index 1cd0629f93a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankAccountService.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.repository.BankAccountRepository; -import org.egov.egf.master.domain.repository.BankBranchRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.domain.repository.FundRepository; -import org.egov.egf.master.web.requests.BankAccountRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class BankAccountService { - - @Autowired - private BankAccountRepository bankAccountRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private ChartOfAccountRepository chartOfAccountRepository; - @Autowired - private BankBranchRepository bankBranchRepository; - @Autowired - private FundRepository fundRepository; - - @Transactional - public List create(List bankAccounts, BindingResult errors, RequestInfo requestInfo) { - - try { - - bankAccounts = fetchRelated(bankAccounts); - - validate(bankAccounts, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (BankAccount b : bankAccounts) { - b.setId(bankAccountRepository.getNextSequence()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankAccountRepository.save(bankAccounts, requestInfo); - - } - - @Transactional - public List update(List bankAccounts, BindingResult errors, RequestInfo requestInfo) { - - try { - - bankAccounts = fetchRelated(bankAccounts); - - validate(bankAccounts, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankAccountRepository.update(bankAccounts, requestInfo); - - } - - private BindingResult validate(List bankaccounts, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(bankAccountContractRequest.getBankAccount(), - // errors); - break; - case Constants.ACTION_CREATE: - if (bankaccounts == null) { - throw new InvalidDataException("bankaccounts", ErrorCode.NOT_NULL.getCode(), null); - } - for (BankAccount bankAccount : bankaccounts) { - validator.validate(bankAccount, errors); - if (!bankAccountRepository.uniqueCheck("accountNumber", bankAccount)) { - errors.addError(new FieldError("bankAccount", "name", bankAccount.getAccountNumber(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (bankaccounts == null) { - throw new InvalidDataException("bankaccounts", ErrorCode.NOT_NULL.getCode(), null); - } - for (BankAccount bankAccount : bankaccounts) { - if (bankAccount.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - bankAccount.getId()); - } - validator.validate(bankAccount, errors); - if (!bankAccountRepository.uniqueCheck("accountNumber", bankAccount)) { - errors.addError(new FieldError("bankAccount", "name", bankAccount.getAccountNumber(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (bankaccounts == null) { - throw new InvalidDataException("bankaccounts", ErrorCode.NOT_NULL.getCode(), null); - } - for (BankAccount bankaccount : bankaccounts) { - if (bankaccount.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - bankaccount.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List bankaccounts) { - for (BankAccount bankAccount : bankaccounts) { - // fetch related items - bankAccount.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (bankAccount.getBankBranch() != null) { - BankBranch bankBranch = bankBranchRepository.findById(bankAccount.getBankBranch()); - if (bankBranch == null) { - throw new InvalidDataException("bankBranch", "bankBranch.invalid", " Invalid bankBranch"); - } - bankAccount.setBankBranch(bankBranch); - } - if (bankAccount.getChartOfAccount() != null) { - ChartOfAccount chartOfAccount = chartOfAccountRepository.findById(bankAccount.getChartOfAccount()); - if (chartOfAccount == null) { - throw new InvalidDataException("chartOfAccount", "chartOfAccount.invalid", - " Invalid chartOfAccount"); - } - bankAccount.setChartOfAccount(chartOfAccount); - } - if (bankAccount.getFund() != null) { - Fund fund = fundRepository.findById(bankAccount.getFund()); - if (fund == null) { - throw new InvalidDataException("fund", "fund.invalid", " Invalid fund"); - } - bankAccount.setFund(fund); - } - - } - - return bankaccounts; - } - - @Transactional - public List update(List bankaccounts, BindingResult errors) { - bankaccounts = fetchRelated(bankaccounts); - validate(bankaccounts, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return bankaccounts; - - } - - public void addToQue(BankAccountRequest request) { - bankAccountRepository.add(request); - } - - public Pagination search(BankAccountSearch bankAccountSearch, BindingResult errors) { - - try { - - List bankAccounts = new ArrayList<>(); - bankAccounts.add(bankAccountSearch); - validate(bankAccounts, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankAccountRepository.search(bankAccountSearch); - } - - @Transactional - public BankAccount save(BankAccount bankAccount) { - return bankAccountRepository.save(bankAccount); - } - - @Transactional - public BankAccount update(BankAccount bankAccount) { - return bankAccountRepository.update(bankAccount); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankBranchService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankBranchService.java deleted file mode 100644 index 89592f16456..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankBranchService.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.domain.repository.BankBranchRepository; -import org.egov.egf.master.domain.repository.BankRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class BankBranchService { - - @Autowired - private BankBranchRepository bankBranchRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private BankRepository bankRepository; - - @Transactional - public List create(List bankBranches, BindingResult errors, RequestInfo requestInfo) { - - try { - - bankBranches = fetchRelated(bankBranches); - - validate(bankBranches, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (BankBranch b : bankBranches) { - b.setId(bankBranchRepository.getNextSequence()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankBranchRepository.save(bankBranches, requestInfo); - - } - - @Transactional - public List update(List bankBranches, BindingResult errors, RequestInfo requestInfo) { - - try { - - bankBranches = fetchRelated(bankBranches); - - validate(bankBranches, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankBranchRepository.update(bankBranches, requestInfo); - - } - - private BindingResult validate(List bankbranches, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(bankBranchContractRequest.getBankBranch(), - // errors); - break; - case Constants.ACTION_CREATE: - if (bankbranches == null) { - throw new InvalidDataException("bankbranches", ErrorCode.NOT_NULL.getCode(), null); - } - for (BankBranch bankBranch : bankbranches) { - validator.validate(bankBranch, errors); - if (!bankBranchRepository.uniqueCheck("name", bankBranch)) { - errors.addError(new FieldError("bankBranch", "name", bankBranch.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!bankBranchRepository.uniqueCheck("code", bankBranch)) { - errors.addError(new FieldError("bankBranch", "code", bankBranch.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (bankbranches == null) { - throw new InvalidDataException("bankbranches", ErrorCode.NOT_NULL.getCode(), null); - } - for (BankBranch bankBranch : bankbranches) { - if (bankBranch.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), bankBranch.getId()); - } - validator.validate(bankBranch, errors); - if (!bankBranchRepository.uniqueCheck("name", bankBranch)) { - errors.addError(new FieldError("bankBranch", "name", bankBranch.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!bankBranchRepository.uniqueCheck("code", bankBranch)) { - errors.addError(new FieldError("bankBranch", "code", bankBranch.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (bankbranches == null) { - throw new InvalidDataException("bankbranches", ErrorCode.NOT_NULL.getCode(), null); - } - for (BankBranch bankbranch : bankbranches) { - if (bankbranch.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - bankbranch.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List bankbranches) { - for (BankBranch bankBranch : bankbranches) { - // fetch related items - bankBranch.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (bankBranch.getTenantId() != null) - if (bankBranch.getBank() != null && bankBranch.getBank().getId() != null) { - bankBranch.getBank().setTenantId(bankBranch.getTenantId()); - Bank bank = bankRepository.findById(bankBranch.getBank()); - if (bank == null) { - throw new InvalidDataException("bank", "bank.invalid", " Invalid bank"); - } - bankBranch.setBank(bank); - } - - } - - return bankbranches; - } - - @Transactional - public List update(List bankbranches, BindingResult errors) { - bankbranches = fetchRelated(bankbranches); - validate(bankbranches, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return bankbranches; - - } - - public Pagination search(BankBranchSearch bankBranchSearch, BindingResult errors) { - - try { - - List bankBranches = new ArrayList<>(); - bankBranches.add(bankBranchSearch); - validate(bankBranches, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankBranchRepository.search(bankBranchSearch); - } - - @Transactional - public BankBranch save(BankBranch bankBranch) { - return bankBranchRepository.save(bankBranch); - } - - @Transactional - public BankBranch update(BankBranch bankBranch) { - return bankBranchRepository.update(bankBranch); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankService.java deleted file mode 100644 index 614b3cd7f90..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BankService.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.domain.repository.BankRepository; -import org.egov.egf.master.persistence.repository.BankJdbcRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class BankService { - - @Autowired - private BankRepository bankRepository; - - @Autowired - private BankJdbcRepository bankJdbcRepository; - - @Autowired - private SmartValidator validator; - - @Transactional - public List create(List banks, BindingResult errors, RequestInfo requestInfo) { - - try { - - banks = fetchRelated(banks); - - validate(banks, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (Bank b : banks) { - b.setId(bankRepository.getNextSequence()); - b.setTenantId(ApplicationThreadLocals.getTenantId().get()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankRepository.save(banks, requestInfo); - - } - - @Transactional - public List update(List banks, BindingResult errors, RequestInfo requestInfo) { - - try { - - banks = fetchRelated(banks); - - validate(banks, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankRepository.update(banks, requestInfo); - - } - - private BindingResult validate(List banks, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(bankContractRequest.getBank(), errors); - break; - case Constants.ACTION_CREATE: - if (banks == null) { - throw new InvalidDataException("banks", ErrorCode.NOT_NULL.getCode(), null); - } - for (Bank bank : banks) { - validator.validate(bank, errors); - if (!bankRepository.uniqueCheck("name", bank)) { - errors.addError(new FieldError("bank", "name", bank.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!bankRepository.uniqueCheck("code", bank)) { - errors.addError(new FieldError("bank", "code", bank.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (banks == null) { - throw new InvalidDataException("banks", ErrorCode.NOT_NULL.getCode(), null); - } - for (Bank bank : banks) { - if (bank.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), bank.getId()); - } - validator.validate(bank, errors); - if (!bankRepository.uniqueCheck("name", bank)) { - errors.addError(new FieldError("bank", "name", bank.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!bankRepository.uniqueCheck("code", bank)) { - errors.addError(new FieldError("bank", "code", bank.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (banks == null) { - throw new InvalidDataException("banks", ErrorCode.NOT_NULL.getCode(), null); - } - for (Bank bank : banks) { - if (bank.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - bank.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List banks) { - - return banks; - } - - @Transactional - public List update(List banks, BindingResult errors) { - banks = fetchRelated(banks); - validate(banks, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return banks; - - } - - public Pagination search(BankSearch bankSearch, BindingResult errors) { - - try { - - List banks = new ArrayList<>(); - banks.add(bankSearch); - validate(banks, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return bankRepository.search(bankSearch); - } - - @Transactional - public Bank save(Bank bank) { - return bankRepository.save(bank); - } - - @Transactional - public Bank update(Bank bank) { - return bankRepository.update(bank); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BudgetGroupService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BudgetGroupService.java deleted file mode 100644 index b9d90a95c55..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/BudgetGroupService.java +++ /dev/null @@ -1,181 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.BudgetGroup; -import org.egov.egf.master.domain.model.BudgetGroupSearch; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.repository.BudgetGroupRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.web.requests.BudgetGroupRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class BudgetGroupService { - - @Autowired - private BudgetGroupRepository budgetGroupRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private ChartOfAccountRepository chartOfAccountRepository; - - private BindingResult validate(List budgetgroups, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(budgetGroupContractRequest.getBudgetGroup(), - // errors); - break; - case Constants.ACTION_CREATE: - if (budgetgroups == null) { - throw new InvalidDataException("budgetgroups", ErrorCode.NOT_NULL.getCode(), null); - } - for (BudgetGroup budgetGroup : budgetgroups) { - validator.validate(budgetGroup, errors); - if (!budgetGroupRepository.uniqueCheck("name", budgetGroup)) { - errors.addError(new FieldError("budgetGroup", "name", budgetGroup.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (budgetgroups == null) { - throw new InvalidDataException("budgetgroups", ErrorCode.NOT_NULL.getCode(), null); - } - for (BudgetGroup budgetGroup : budgetgroups) { - if (budgetGroup.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), budgetGroup.getId()); - } - validator.validate(budgetGroup, errors); - if (!budgetGroupRepository.uniqueCheck("name", budgetGroup)) { - errors.addError(new FieldError("budgetGroup", "name", budgetGroup.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (budgetgroups == null) { - throw new InvalidDataException("budgetgroups", ErrorCode.NOT_NULL.getCode(), null); - } - for (BudgetGroup budgetgroup : budgetgroups) { - if (budgetgroup.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - budgetgroup.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List budgetgroups) { - for (BudgetGroup budgetGroup : budgetgroups) { - // fetch related items - budgetGroup.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (budgetGroup.getMajorCode() != null) { - ChartOfAccount majorCode = chartOfAccountRepository.findById(budgetGroup.getMajorCode()); - if (majorCode == null) { - throw new InvalidDataException("majorCode", "majorCode.invalid", " Invalid majorCode"); - } - budgetGroup.setMajorCode(majorCode); - } - if (budgetGroup.getMaxCode() != null) { - ChartOfAccount maxCode = chartOfAccountRepository.findById(budgetGroup.getMaxCode()); - if (maxCode == null) { - throw new InvalidDataException("maxCode", "maxCode.invalid", " Invalid maxCode"); - } - budgetGroup.setMaxCode(maxCode); - } - if (budgetGroup.getMinCode() != null) { - ChartOfAccount minCode = chartOfAccountRepository.findById(budgetGroup.getMinCode()); - if (minCode == null) { - throw new InvalidDataException("minCode", "minCode.invalid", " Invalid minCode"); - } - budgetGroup.setMinCode(minCode); - } - - } - - return budgetgroups; - } - - @Transactional - public List add(List budgetgroups, BindingResult errors) { - budgetgroups = fetchRelated(budgetgroups); - validate(budgetgroups, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(BudgetGroup b:budgetgroups)b.setId(budgetGroupRepository.getNextSequence()); - return budgetgroups; - - } - - @Transactional - public List update(List budgetgroups, BindingResult errors) { - budgetgroups = fetchRelated(budgetgroups); - validate(budgetgroups, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return budgetgroups; - - } - - public void addToQue(BudgetGroupRequest request) { - budgetGroupRepository.add(request); - } - - public Pagination search(BudgetGroupSearch budgetGroupSearch, BindingResult errors) { - - try { - - List budgetGroups = new ArrayList<>(); - budgetGroups.add(budgetGroupSearch); - validate(budgetGroups, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return budgetGroupRepository.search(budgetGroupSearch); - } - - @Transactional - public BudgetGroup save(BudgetGroup budgetGroup) { - return budgetGroupRepository.save(budgetGroup); - } - - @Transactional - public BudgetGroup update(BudgetGroup budgetGroup) { - return budgetGroupRepository.update(budgetGroup); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/ChartOfAccountDetailService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/ChartOfAccountDetailService.java deleted file mode 100644 index 56c5d3a9b1f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/ChartOfAccountDetailService.java +++ /dev/null @@ -1,178 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountDetailRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.web.requests.ChartOfAccountDetailRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class ChartOfAccountDetailService { - - @Autowired - private ChartOfAccountDetailRepository chartOfAccountDetailRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private ChartOfAccountRepository chartOfAccountRepository; - @Autowired - private AccountDetailTypeRepository accountDetailTypeRepository; - - private BindingResult validate(List chartofaccountdetails, String method, - BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(chartOfAccountDetailContractRequest.getChartOfAccountDetail(), - // errors); - break; - case Constants.ACTION_CREATE: - if (chartofaccountdetails == null) { - throw new InvalidDataException("chartofaccountdetails", ErrorCode.NOT_NULL.getCode(), - null); - } - for (ChartOfAccountDetail chartOfAccountDetail : chartofaccountdetails) { - validator.validate(chartOfAccountDetail, errors); - } - break; - case Constants.ACTION_UPDATE: - if (chartofaccountdetails == null) { - throw new InvalidDataException("chartofaccountdetails", ErrorCode.NOT_NULL.getCode(), - null); - } - for (ChartOfAccountDetail chartOfAccountDetail : chartofaccountdetails) { - if (chartOfAccountDetail.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - chartOfAccountDetail.getId()); - } - validator.validate(chartOfAccountDetail, errors); - } - break; - case Constants.ACTION_SEARCH: - if (chartofaccountdetails == null) { - throw new InvalidDataException("chartofaccountdetails", ErrorCode.NOT_NULL.getCode(), - null); - } - for (ChartOfAccountDetail chartofaccountdetail : chartofaccountdetails) { - if (chartofaccountdetail.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - chartofaccountdetail.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List chartofaccountdetails) { - for (ChartOfAccountDetail chartOfAccountDetail : chartofaccountdetails) { - // fetch related items - chartOfAccountDetail.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (chartOfAccountDetail.getChartOfAccount() != null) { - ChartOfAccount chartOfAccount = chartOfAccountRepository - .findById(chartOfAccountDetail.getChartOfAccount()); - if (chartOfAccount == null) { - throw new InvalidDataException("chartOfAccount", "chartOfAccount.invalid", - " Invalid chartOfAccount"); - } - chartOfAccountDetail.setChartOfAccount(chartOfAccount); - } - if (chartOfAccountDetail.getAccountDetailType() != null) { - AccountDetailType accountDetailType = accountDetailTypeRepository - .findById(chartOfAccountDetail.getAccountDetailType()); - if (accountDetailType == null) { - throw new InvalidDataException("accountDetailType", "accountDetailType.invalid", - " Invalid accountDetailType"); - } - chartOfAccountDetail.setAccountDetailType(accountDetailType); - } - - } - - return chartofaccountdetails; - } - - @Transactional - public List add(List chartofaccountdetails, BindingResult errors) { - chartofaccountdetails = fetchRelated(chartofaccountdetails); - validate(chartofaccountdetails, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(ChartOfAccountDetail b:chartofaccountdetails)b.setId(chartOfAccountDetailRepository.getNextSequence()); - return chartofaccountdetails; - - } - - @Transactional - public List update(List chartofaccountdetails, BindingResult errors) { - chartofaccountdetails = fetchRelated(chartofaccountdetails); - validate(chartofaccountdetails, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return chartofaccountdetails; - - } - - public void addToQue(ChartOfAccountDetailRequest request) { - chartOfAccountDetailRepository.add(request); - } - - public Pagination search(ChartOfAccountDetailSearch chartOfAccountDetailSearch, BindingResult errors) { - - try { - - List chartOfAccountDetails = new ArrayList<>(); - chartOfAccountDetails.add(chartOfAccountDetailSearch); - validate(chartOfAccountDetails, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return chartOfAccountDetailRepository.search(chartOfAccountDetailSearch); - } - - @Transactional - public ChartOfAccountDetail save(ChartOfAccountDetail chartOfAccountDetail) { - return chartOfAccountDetailRepository.save(chartOfAccountDetail); - } - - @Transactional - public ChartOfAccountDetail update(ChartOfAccountDetail chartOfAccountDetail) { - return chartOfAccountDetailRepository.update(chartOfAccountDetail); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/ChartOfAccountService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/ChartOfAccountService.java deleted file mode 100644 index 7eb944e2bdc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/ChartOfAccountService.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.repository.AccountCodePurposeRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.web.requests.ChartOfAccountRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class ChartOfAccountService { - - @Autowired - private ChartOfAccountRepository chartOfAccountRepository; - - @Autowired - private SmartValidator validator; - - @Autowired - private AccountCodePurposeRepository accountCodePurposeRepository; - - private BindingResult validate(List chartofaccounts, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(chartOfAccountContractRequest.getChartOfAccount(), - // errors); - break; - case Constants.ACTION_CREATE: - if (chartofaccounts == null) { - throw new InvalidDataException("chartofaccounts", ErrorCode.NOT_NULL.getCode(), null); - } - for (ChartOfAccount chartOfAccount : chartofaccounts) { - validator.validate(chartOfAccount, errors); - if (!chartOfAccountRepository.uniqueCheck("name", chartOfAccount)) { - errors.addError(new FieldError("chartOfAccount", "name", chartOfAccount.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!chartOfAccountRepository.uniqueCheck("glcode", chartOfAccount)) { - errors.addError(new FieldError("chartOfAccount", "glcode", chartOfAccount.getGlcode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (chartofaccounts == null) { - throw new InvalidDataException("chartofaccounts", ErrorCode.NOT_NULL.getCode(), null); - } - for (ChartOfAccount chartOfAccount : chartofaccounts) { - if (chartOfAccount.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), chartOfAccount.getId()); - } - validator.validate(chartOfAccount, errors); - if (!chartOfAccountRepository.uniqueCheck("name", chartOfAccount)) { - errors.addError(new FieldError("chartOfAccount", "name", chartOfAccount.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!chartOfAccountRepository.uniqueCheck("glcode", chartOfAccount)) { - errors.addError(new FieldError("chartOfAccount", "glcode", chartOfAccount.getGlcode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (chartofaccounts == null) { - throw new InvalidDataException("chartofaccounts", ErrorCode.NOT_NULL.getCode(), null); - } - for (ChartOfAccount chartofaccount : chartofaccounts) { - if (chartofaccount.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - chartofaccount.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List chartofaccounts) { - for (ChartOfAccount chartOfAccount : chartofaccounts) { - // fetch related items - chartOfAccount.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (chartOfAccount.getAccountCodePurpose() != null) { - AccountCodePurpose accountCodePurpose = accountCodePurposeRepository - .findById(chartOfAccount.getAccountCodePurpose()); - if (accountCodePurpose == null) { - throw new InvalidDataException("accountCodePurpose", "accountCodePurpose.invalid", - " Invalid accountCodePurpose"); - } - chartOfAccount.setAccountCodePurpose(accountCodePurpose); - } - if (chartOfAccount.getParentId() != null) { - ChartOfAccount parentId = chartOfAccountRepository.findById(chartOfAccount.getParentId()); - if (parentId == null) { - throw new InvalidDataException("parentId", "parentId.invalid", " Invalid parentId"); - } - chartOfAccount.setParentId(parentId); - } - - } - - return chartofaccounts; - } - - @Transactional - public List add(List chartofaccounts, BindingResult errors) { - chartofaccounts = fetchRelated(chartofaccounts); - validate(chartofaccounts, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(ChartOfAccount b:chartofaccounts)b.setId(chartOfAccountRepository.getNextSequence()); - return chartofaccounts; - - } - - @Transactional - public List update(List chartofaccounts, BindingResult errors) { - chartofaccounts = fetchRelated(chartofaccounts); - validate(chartofaccounts, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return chartofaccounts; - - } - - public void addToQue(ChartOfAccountRequest request) { - chartOfAccountRepository.add(request); - } - - public Pagination search(ChartOfAccountSearch chartOfAccountSearch, BindingResult errors) { - - try { - - List chartOfAccounts = new ArrayList<>(); - chartOfAccounts.add(chartOfAccountSearch); - validate(chartOfAccounts, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return chartOfAccountRepository.search(chartOfAccountSearch); - } - - @Transactional - public ChartOfAccount save(ChartOfAccount chartOfAccount) { - return chartOfAccountRepository.save(chartOfAccount); - } - - @Transactional - public ChartOfAccount update(ChartOfAccount chartOfAccount) { - return chartOfAccountRepository.update(chartOfAccount); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialConfigurationService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialConfigurationService.java deleted file mode 100644 index d3306eb35aa..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialConfigurationService.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.FinancialConfiguration; -import org.egov.egf.master.domain.model.FinancialConfigurationSearch; -import org.egov.egf.master.domain.repository.FinancialConfigurationRepository; -import org.egov.egf.master.web.requests.FinancialConfigurationRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FinancialConfigurationService { - - @Autowired - private FinancialConfigurationRepository financialConfigurationRepository; - - @Autowired - private SmartValidator validator; - - @Value("${fetch_data_from}") - private String fetchDataFrom; - - private BindingResult validate(List financialconfigurations, String method, - BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(financialConfigurationContractRequest.getFinancialConfiguration(), - // errors); - break; - case Constants.ACTION_CREATE: - if (financialconfigurations == null) { - throw new InvalidDataException("financialconfigurations", ErrorCode.NOT_NULL.getCode(), - null); - } - for (FinancialConfiguration financialConfiguration : financialconfigurations) { - validator.validate(financialConfiguration, errors); - if (!financialConfigurationRepository.uniqueCheck("name", financialConfiguration)) { - errors.addError(new FieldError("financialConfiguration", "name", financialConfiguration.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (financialconfigurations == null) { - throw new InvalidDataException("financialconfigurations", ErrorCode.NOT_NULL.getCode(), - null); - } - for (FinancialConfiguration financialConfiguration : financialconfigurations) { - if (financialConfiguration.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - financialConfiguration.getId()); - } - validator.validate(financialConfiguration, errors); - if (!financialConfigurationRepository.uniqueCheck("name", financialConfiguration)) { - errors.addError(new FieldError("financialConfiguration", "name", financialConfiguration.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (financialconfigurations == null) { - throw new InvalidDataException("financialconfigurations", ErrorCode.NOT_NULL.getCode(), - null); - } - for (FinancialConfiguration financialconfiguration : financialconfigurations) { - if (financialconfiguration.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - financialconfiguration.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List financialconfigurations) { - for (FinancialConfiguration financialConfiguration : financialconfigurations) { - // fetch related items - financialConfiguration.setTenantId(ApplicationThreadLocals.getTenantId().get()); - - } - - return financialconfigurations; - } - - @Transactional - public List add(List financialconfigurations, - BindingResult errors) { - financialconfigurations = fetchRelated(financialconfigurations); - validate(financialconfigurations, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return financialconfigurations; - - } - - @Transactional - public List update(List financialconfigurations, - BindingResult errors) { - financialconfigurations = fetchRelated(financialconfigurations); - validate(financialconfigurations, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return financialconfigurations; - - } - - public void addToQue(FinancialConfigurationRequest request) { - financialConfigurationRepository.add(request); - } - - public Pagination search(FinancialConfigurationSearch financialConfigurationSearch, BindingResult errors) { - - try { - - List financialConfigurations = new ArrayList<>(); - financialConfigurations.add(financialConfigurationSearch); - validate(financialConfigurations, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return financialConfigurationRepository.search(financialConfigurationSearch); - } - - @Transactional - public FinancialConfiguration save(FinancialConfiguration financialConfiguration) { - return financialConfigurationRepository.save(financialConfiguration); - } - - @Transactional - public FinancialConfiguration update(FinancialConfiguration financialConfiguration) { - return financialConfigurationRepository.update(financialConfiguration); - } - - public String fetchDataFrom() { - return fetchDataFrom; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialStatusService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialStatusService.java deleted file mode 100644 index 7794a89bac3..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialStatusService.java +++ /dev/null @@ -1,166 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.FinancialStatus; -import org.egov.egf.master.domain.model.FinancialStatusSearch; -import org.egov.egf.master.domain.repository.FinancialStatusRepository; -import org.egov.egf.master.web.requests.FinancialStatusRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FinancialStatusService { - - @Autowired - private FinancialStatusRepository financialStatusRepository; - - @Autowired - private SmartValidator validator; - - private BindingResult validate(List financialstatuses, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(financialStatusContractRequest.getFinancialStatus(), - // errors); - break; - case Constants.ACTION_CREATE: - if (financialstatuses == null) { - throw new InvalidDataException("financialstatuses", ErrorCode.NOT_NULL.getCode(), - null); - } - for (FinancialStatus financialStatus : financialstatuses) { - validator.validate(financialStatus, errors); - if (!financialStatusRepository.uniqueCheck("name", financialStatus)) { - errors.addError(new FieldError("financialStatus", "name", financialStatus.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!financialStatusRepository.uniqueCheck("code", financialStatus)) { - errors.addError(new FieldError("financialStatus", "code", financialStatus.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (financialstatuses == null) { - throw new InvalidDataException("financialstatuses", ErrorCode.NOT_NULL.getCode(), - null); - } - for (FinancialStatus financialStatus : financialstatuses) { - if (financialStatus.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), financialStatus.getId()); - } - validator.validate(financialStatus, errors); - if (!financialStatusRepository.uniqueCheck("name", financialStatus)) { - errors.addError(new FieldError("financialStatus", "name", financialStatus.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!financialStatusRepository.uniqueCheck("code", financialStatus)) { - errors.addError(new FieldError("financialStatus", "code", financialStatus.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (financialstatuses == null) { - throw new InvalidDataException("financialstatuses", ErrorCode.NOT_NULL.getCode(), - null); - } - for (FinancialStatus financialstatus : financialstatuses) { - if (financialstatus.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - financialstatus.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List financialstatuses) { - for (FinancialStatus financialStatus : financialstatuses) { - // fetch related items - financialStatus.setTenantId(ApplicationThreadLocals.getTenantId().get()); - - } - - return financialstatuses; - } - - @Transactional - public List add(List financialstatuses, BindingResult errors) { - financialstatuses = fetchRelated(financialstatuses); - validate(financialstatuses, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return financialstatuses; - - } - - @Transactional - public List update(List financialstatuses, BindingResult errors) { - financialstatuses = fetchRelated(financialstatuses); - validate(financialstatuses, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return financialstatuses; - - } - - public void addToQue(FinancialStatusRequest request) { - financialStatusRepository.add(request); - } - - public Pagination search(FinancialStatusSearch financialStatusSearch, BindingResult errors) { - - try { - - List financialStatuses = new ArrayList<>(); - financialStatuses.add(financialStatusSearch); - validate(financialStatuses, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return financialStatusRepository.search(financialStatusSearch); - } - - @Transactional - public FinancialStatus save(FinancialStatus financialStatus) { - return financialStatusRepository.save(financialStatus); - } - - @Transactional - public FinancialStatus update(FinancialStatus financialStatus) { - return financialStatusRepository.update(financialStatus); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialYearService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialYearService.java deleted file mode 100644 index aaac97b6058..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FinancialYearService.java +++ /dev/null @@ -1,170 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.domain.model.FinancialYearSearch; -import org.egov.egf.master.domain.repository.FinancialYearRepository; -import org.egov.egf.master.web.requests.FinancialYearRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FinancialYearService { - - @Autowired - private FinancialYearRepository financialYearRepository; - - @Autowired - private SmartValidator validator; - - public BindingResult validate(List financialyears, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(financialYearContractRequest.getFinancialYear(), - // errors); - break; - case Constants.ACTION_CREATE: - if (financialyears == null) { - throw new InvalidDataException("financialyears", ErrorCode.NOT_NULL.getCode(), null); - } - for (FinancialYear financialYear : financialyears) { - validator.validate(financialYear, errors); - if (!financialYearRepository.uniqueCheck("finYearRange", financialYear)) { - errors.addError(new FieldError("financialYear", "finYearRange", financialYear.getFinYearRange(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!financialYearRepository.uniqueCheck("startingdate", financialYear)) { - errors.addError(new FieldError("financialYear", "startingdate", financialYear.getStartingDate(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!financialYearRepository.uniqueCheck("endingdate", financialYear)) { - errors.addError(new FieldError("financialYear", "endingdate", financialYear.getEndingDate(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (financialyears == null) { - throw new InvalidDataException("financialyears", ErrorCode.NOT_NULL.getCode(), null); - } - for (FinancialYear financialYear : financialyears) { - if (financialYear.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), financialYear.getId()); - } - validator.validate(financialYear, errors); - if (!financialYearRepository.uniqueCheck("finYearRange", financialYear)) { - errors.addError(new FieldError("financialYear", "finYearRange", financialYear.getFinYearRange(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!financialYearRepository.uniqueCheck("startingdate", financialYear)) { - errors.addError(new FieldError("financialYear", "startingdate", financialYear.getStartingDate(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!financialYearRepository.uniqueCheck("endingdate", financialYear)) { - errors.addError(new FieldError("financialYear", "endingdate", financialYear.getEndingDate(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (financialyears == null) { - throw new InvalidDataException("financialyears", ErrorCode.NOT_NULL.getCode(), null); - } - for (FinancialYear financialyear : financialyears) { - if (financialyear.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - financialyear.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List financialyears) { - for (FinancialYear financialYear : financialyears) { - // fetch related items - financialYear.setTenantId(ApplicationThreadLocals.getTenantId().get()); - - } - - return financialyears; - } - - @Transactional - public List add(List financialyears, BindingResult errors) { - financialyears = fetchRelated(financialyears); - validate(financialyears, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(FinancialYear b:financialyears)b.setId(financialYearRepository.getNextSequence()); - return financialyears; - - } - - public List update(List financialyears, BindingResult errors) { - financialyears = fetchRelated(financialyears); - validate(financialyears, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return financialyears; - - } - - public void addToQue(FinancialYearRequest request) { - financialYearRepository.add(request); - } - - public Pagination search(FinancialYearSearch financialYearSearch, BindingResult errors) { - - try { - - List financialYears = new ArrayList<>(); - financialYears.add(financialYearSearch); - validate(financialYears, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return financialYearRepository.search(financialYearSearch); - } - - @Transactional - public FinancialYear save(FinancialYear financialYear) { - return financialYearRepository.save(financialYear); - } - - @Transactional - public FinancialYear update(FinancialYear financialYear) { - return financialYearRepository.update(financialYear); - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FiscalPeriodService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FiscalPeriodService.java deleted file mode 100644 index 26ad0fa73bc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FiscalPeriodService.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.domain.model.FiscalPeriod; -import org.egov.egf.master.domain.model.FiscalPeriodSearch; -import org.egov.egf.master.domain.repository.FinancialYearRepository; -import org.egov.egf.master.domain.repository.FiscalPeriodRepository; -import org.egov.egf.master.web.requests.FiscalPeriodRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FiscalPeriodService { - - @Autowired - private FiscalPeriodRepository fiscalPeriodRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private FinancialYearRepository financialYearRepository; - - private BindingResult validate(List fiscalperiods, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(fiscalPeriodContractRequest.getFiscalPeriod(), - // errors); - break; - case Constants.ACTION_CREATE: - if (fiscalperiods == null) { - throw new InvalidDataException("fiscalperiods", ErrorCode.NOT_NULL.getCode(), null); - } - for (FiscalPeriod fiscalPeriod : fiscalperiods) { - validator.validate(fiscalPeriod, errors); - if (!fiscalPeriodRepository.uniqueCheck("name", fiscalPeriod)) { - errors.addError(new FieldError("fiscalPeriod", "name", fiscalPeriod.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (fiscalperiods == null) { - throw new InvalidDataException("fiscalperiods", ErrorCode.NOT_NULL.getCode(), null); - } - for (FiscalPeriod fiscalPeriod : fiscalperiods) { - if (fiscalPeriod.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), fiscalPeriod.getId()); - } - validator.validate(fiscalPeriod, errors); - if (!fiscalPeriodRepository.uniqueCheck("name", fiscalPeriod)) { - errors.addError(new FieldError("fiscalPeriod", "name", fiscalPeriod.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (fiscalperiods == null) { - throw new InvalidDataException("fiscalperiods", ErrorCode.NOT_NULL.getCode(), null); - } - for (FiscalPeriod fiscalperiod : fiscalperiods) { - if (fiscalperiod.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - fiscalperiod.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List fiscalperiods) { - for (FiscalPeriod fiscalPeriod : fiscalperiods) { - // fetch related items - fiscalPeriod.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (fiscalPeriod.getFinancialYear() != null) { - FinancialYear financialYear = financialYearRepository.findById(fiscalPeriod.getFinancialYear()); - if (financialYear == null) { - throw new InvalidDataException("financialYear", "financialYear.invalid", " Invalid financialYear"); - } - fiscalPeriod.setFinancialYear(financialYear); - } - - } - - return fiscalperiods; - } - - @Transactional - public List add(List fiscalperiods, BindingResult errors) { - fiscalperiods = fetchRelated(fiscalperiods); - validate(fiscalperiods, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(FiscalPeriod b:fiscalperiods)b.setId(fiscalPeriodRepository.getNextSequence()); - return fiscalperiods; - - } - - @Transactional - public List update(List fiscalperiods, BindingResult errors) { - fiscalperiods = fetchRelated(fiscalperiods); - validate(fiscalperiods, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return fiscalperiods; - - } - - public void addToQue(FiscalPeriodRequest request) { - fiscalPeriodRepository.add(request); - } - - public Pagination search(FiscalPeriodSearch fiscalPeriodSearch, BindingResult errors) { - - try { - - List fiscalPeriods = new ArrayList<>(); - fiscalPeriods.add(fiscalPeriodSearch); - validate(fiscalPeriods, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return fiscalPeriodRepository.search(fiscalPeriodSearch); - } - - @Transactional - public FiscalPeriod save(FiscalPeriod fiscalPeriod) { - return fiscalPeriodRepository.save(fiscalPeriod); - } - - @Transactional - public FiscalPeriod update(FiscalPeriod fiscalPeriod) { - return fiscalPeriodRepository.update(fiscalPeriod); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FunctionService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FunctionService.java deleted file mode 100644 index 6601b8bde5f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FunctionService.java +++ /dev/null @@ -1,197 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.domain.repository.FunctionRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FunctionService { - - @Autowired - private FunctionRepository functionRepository; - - @Autowired - private SmartValidator validator; - - @Transactional - public List create(List functions, BindingResult errors, RequestInfo requestInfo) { - - try { - - functions = fetchRelated(functions); - - validate(functions, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (Function b : functions) { - b.setId(functionRepository.getNextSequence()); - b.add(); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return functionRepository.save(functions, requestInfo); - - } - - @Transactional - public List update(List functions, BindingResult errors, RequestInfo requestInfo) { - - try { - - functions = fetchRelated(functions); - - validate(functions, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (Function b : functions) { - b.update(); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return functionRepository.update(functions, requestInfo); - - } - - private BindingResult validate(List functions, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(functionContractRequest.getFunction(), - // errors); - break; - case Constants.ACTION_CREATE: - if (functions == null) { - throw new InvalidDataException("functions", ErrorCode.NOT_NULL.getCode(), null); - } - for (Function function : functions) { - validator.validate(function, errors); - if (!functionRepository.uniqueCheck("name", function)) { - errors.addError(new FieldError("function", "name", function.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!functionRepository.uniqueCheck("code", function)) { - errors.addError(new FieldError("function", "code", function.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (functions == null) { - throw new InvalidDataException("functions", ErrorCode.NOT_NULL.getCode(), null); - } - for (Function function : functions) { - if (function.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), function.getId()); - } - validator.validate(function, errors); - if (!functionRepository.uniqueCheck("name", function)) { - errors.addError(new FieldError("function", "name", function.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!functionRepository.uniqueCheck("code", function)) { - errors.addError(new FieldError("function", "code", function.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (functions == null) { - throw new InvalidDataException("functions", ErrorCode.NOT_NULL.getCode(), null); - } - for (Function function : functions) { - if (function.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - function.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List functions) { - for (Function function : functions) { - // fetch related items - function.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (function.getTenantId() != null) - if (function.getParentId() != null && function.getParentId().getId() != null) { - function.getParentId().setTenantId(function.getTenantId()); - Function parentId = functionRepository.findById(function.getParentId()); - if (parentId == null) { - throw new InvalidDataException("parentId", "parentId.invalid", " Invalid parentId"); - } - function.setParentId(parentId); - } - - } - - return functions; - } - - public Pagination search(FunctionSearch functionSearch, BindingResult errors) { - - try { - - List functions = new ArrayList<>(); - functions.add(functionSearch); - validate(functions, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return functionRepository.search(functionSearch); - } - - @Transactional - public Function save(Function function) { - return functionRepository.save(function); - } - - @Transactional - public Function update(Function function) { - return functionRepository.update(function); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FunctionaryService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FunctionaryService.java deleted file mode 100644 index bb86ec1de24..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FunctionaryService.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Functionary; -import org.egov.egf.master.domain.model.FunctionarySearch; -import org.egov.egf.master.domain.repository.FunctionaryRepository; -import org.egov.egf.master.web.requests.FunctionaryRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FunctionaryService { - - @Autowired - private FunctionaryRepository functionaryRepository; - - @Autowired - private SmartValidator validator; - - private BindingResult validate(List functionaries, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(functionaryContractRequest.getFunctionary(), - // errors); - break; - case Constants.ACTION_CREATE: - if (functionaries == null) { - throw new InvalidDataException("functionaries", ErrorCode.NOT_NULL.getCode(), null); - } - for (Functionary functionary : functionaries) { - validator.validate(functionary, errors); - if (!functionaryRepository.uniqueCheck("name", functionary)) { - errors.addError(new FieldError("functionary", "name", functionary.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!functionaryRepository.uniqueCheck("code", functionary)) { - errors.addError(new FieldError("functionary", "code", functionary.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (functionaries == null) { - throw new InvalidDataException("functionaries", ErrorCode.NOT_NULL.getCode(), null); - } - for (Functionary functionary : functionaries) { - if (functionary.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), functionary.getId()); - } - validator.validate(functionary, errors); - if (!functionaryRepository.uniqueCheck("name", functionary)) { - errors.addError(new FieldError("functionary", "name", functionary.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!functionaryRepository.uniqueCheck("code", functionary)) { - errors.addError(new FieldError("functionary", "code", functionary.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (functionaries == null) { - throw new InvalidDataException("functionaries", ErrorCode.NOT_NULL.getCode(), null); - } - for (Functionary functionary : functionaries) { - if (functionary.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - functionary.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List functionaries) { - for (Functionary functionary : functionaries) { - // fetch related items - functionary.setTenantId(ApplicationThreadLocals.getTenantId().get()); - - } - - return functionaries; - } - - @Transactional - public List add(List functionaries, BindingResult errors) { - functionaries = fetchRelated(functionaries); - validate(functionaries, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(Functionary b:functionaries)b.setId(functionaryRepository.getNextSequence()); - return functionaries; - - } - - @Transactional - public List update(List functionaries, BindingResult errors) { - functionaries = fetchRelated(functionaries); - validate(functionaries, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return functionaries; - - } - - public void addToQue(FunctionaryRequest request) { - functionaryRepository.add(request); - } - - public Pagination search(FunctionarySearch functionarySearch, BindingResult errors) { - - try { - - List functionaries = new ArrayList<>(); - functionaries.add(functionarySearch); - validate(functionaries, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return functionaryRepository.search(functionarySearch); - } - - @Transactional - public Functionary save(Functionary functionary) { - return functionaryRepository.save(functionary); - } - - @Transactional - public Functionary update(Functionary functionary) { - return functionaryRepository.update(functionary); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FundService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FundService.java deleted file mode 100644 index 69e2a55f983..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FundService.java +++ /dev/null @@ -1,207 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.egov.common.constants.Constants.ACTION_VIEW; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.domain.repository.FundRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FundService { - - @Autowired - private FundRepository fundRepository; - - @Autowired - private SmartValidator validator; - - @Transactional - public List create(List funds, BindingResult errors, RequestInfo requestInfo) { - - try { - - funds = fetchRelated(funds); - validate(funds, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (Fund b : funds) { - b.setId(fundRepository.getNextSequence()); - b.add(); - } - - } catch (CustomBindException e) { - throw e; - } - - return fundRepository.save(funds, requestInfo); - - } - - @Transactional - public List update(List funds, BindingResult errors, RequestInfo requestInfo) { - - try { - - funds = fetchRelated(funds); - - validate(funds, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (Fund b : funds) { - b.update(); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return fundRepository.update(funds, requestInfo); - - } - - private BindingResult validate(List funds, String method, BindingResult errors) { - - try { - switch (method) { - case ACTION_VIEW: - // validator.validate(fundContractRequest.getFund(), errors); - break; - case Constants.ACTION_CREATE: - if (funds == null) { - throw new InvalidDataException("funds", ErrorCode.NOT_NULL.getCode(), null); - } - for (Fund fund : funds) { - validator.validate(fund, errors); - if (!fundRepository.uniqueCheck("name", fund)) { - errors.addError(new FieldError("fund", "name", fund.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!fundRepository.uniqueCheck("code", fund)) { - errors.addError(new FieldError("fund", "code", fund.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!fundRepository.uniqueCheck("identifier", fund)) { - errors.addError(new FieldError("fund", "identifier", fund.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - - } - break; - case Constants.ACTION_UPDATE: - if (funds == null) { - throw new InvalidDataException("funds", ErrorCode.NOT_NULL.getCode(), null); - } - for (Fund fund : funds) { - if (fund.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), fund.getId()); - } - validator.validate(fund, errors); - if (!fundRepository.uniqueCheck("name", fund)) { - errors.addError(new FieldError("fund", "name", fund.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!fundRepository.uniqueCheck("code", fund)) { - errors.addError(new FieldError("fund", "code", fund.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!fundRepository.uniqueCheck("identifier", fund)) { - errors.addError(new FieldError("fund", "identifier", fund.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - - } - break; - case Constants.ACTION_SEARCH: - if (funds == null) { - throw new InvalidDataException("funds", ErrorCode.NOT_NULL.getCode(), null); - } - for (Fund fund : funds) { - if (fund.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - fund.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List funds) { - for (Fund fund : funds) { - // fetch related items - fund.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (fund.getTenantId() != null) - if (fund.getParent() != null && fund.getParent().getId() != null) { - fund.getParent().setTenantId(fund.getTenantId()); - Fund parentId = fundRepository.findById(fund.getParent()); - if (parentId == null) { - throw new InvalidDataException("parentId", ErrorCode.INVALID_REF_VALUE.getCode(), - fund.getParent().getId()); - } - fund.setParent(parentId); - } - - } - - return funds; - } - - public Pagination search(FundSearch fundSearch, BindingResult errors) { - - try { - - List funds = new ArrayList<>(); - funds.add(fundSearch); - validate(funds, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return fundRepository.search(fundSearch); - } - - @Transactional - public Fund save(Fund fund) { - return fundRepository.save(fund); - } - - @Transactional - public Fund update(Fund fund) { - return fundRepository.update(fund); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FundsourceService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FundsourceService.java deleted file mode 100644 index 7e0e493c3b7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/FundsourceService.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Fundsource; -import org.egov.egf.master.domain.model.FundsourceSearch; -import org.egov.egf.master.domain.repository.FundsourceRepository; -import org.egov.egf.master.web.requests.FundsourceRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class FundsourceService { - - @Autowired - private FundsourceRepository fundsourceRepository; - - @Autowired - private SmartValidator validator; - - - private BindingResult validate(List fundsources, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(fundsourceContractRequest.getFundsource(), - // errors); - break; - case Constants.ACTION_CREATE: - if (fundsources == null) { - throw new InvalidDataException("fundsources", ErrorCode.NOT_NULL.getCode(), null); - } - for (Fundsource fundsource : fundsources) { - validator.validate(fundsource, errors); - if (!fundsourceRepository.uniqueCheck("code", fundsource)) { - errors.addError(new FieldError("fundsource", "code", fundsource.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (fundsources == null) { - throw new InvalidDataException("fundsources", ErrorCode.NOT_NULL.getCode(), null); - } - for (Fundsource fundsource : fundsources) { - if (fundsource.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), fundsource.getId()); - } - validator.validate(fundsource, errors); - if (!fundsourceRepository.uniqueCheck("code", fundsource)) { - errors.addError(new FieldError("fundsource", "code", fundsource.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (fundsources == null) { - throw new InvalidDataException("fundsources", ErrorCode.NOT_NULL.getCode(), null); - } - for (Fundsource fundsource : fundsources) { - if (fundsource.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - fundsource.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List fundsources) { - for (Fundsource fundsource : fundsources) { - // fetch related items - fundsource.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (fundsource.getParent() != null) { - Fundsource fundSource = fundsourceRepository.findById(fundsource.getParent()); - if (fundSource == null) { - throw new InvalidDataException("fundSource", "fundSource.invalid", " Invalid fundSource"); - } - fundsource.setParent(fundSource); - } - - } - - return fundsources; - } - - @Transactional - public List add(List fundsources, BindingResult errors) { - fundsources = fetchRelated(fundsources); - validate(fundsources, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(Fundsource b:fundsources)b.setId(fundsourceRepository.getNextSequence()); - return fundsources; - - } - - @Transactional - public List update(List fundsources, BindingResult errors) { - fundsources = fetchRelated(fundsources); - validate(fundsources, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return fundsources; - - } - - public void addToQue(FundsourceRequest request) { - fundsourceRepository.add(request); - } - - public Pagination search(FundsourceSearch fundsourceSearch, BindingResult errors) { - - try { - - List fundsources = new ArrayList<>(); - fundsources.add(fundsourceSearch); - validate(fundsources, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return fundsourceRepository.search(fundsourceSearch); - } - - @Transactional - public Fundsource save(Fundsource fundsource) { - return fundsourceRepository.save(fundsource); - } - - @Transactional - public Fundsource update(Fundsource fundsource) { - return fundsourceRepository.update(fundsource); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/RecoveryService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/RecoveryService.java deleted file mode 100644 index 9cae8fcd321..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/RecoveryService.java +++ /dev/null @@ -1,201 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.domain.repository.RecoveryRepository; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class RecoveryService { - - @Autowired - private RecoveryRepository recoveryRepository; - - @Autowired - private SmartValidator validator; - - @Autowired - private ChartOfAccountRepository chartOfAccountRepository; - - @Transactional - public List create(List recoveries, BindingResult errors, - RequestInfo requestInfo) { - - try { - - recoveries = fetchRelated(recoveries); - - validate(recoveries, Constants.ACTION_CREATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for (Recovery b : recoveries) { - b.setId(recoveryRepository.getNextSequence()); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return recoveryRepository.save(recoveries, requestInfo); - - } - - @Transactional - public List update(List recoveries, BindingResult errors, - RequestInfo requestInfo) { - - try { - - recoveries = fetchRelated(recoveries); - - validate(recoveries, Constants.ACTION_UPDATE, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return recoveryRepository.update(recoveries, requestInfo); - - } - - private BindingResult validate(List recoveries, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(fundContractRequest.getFund(), errors); - break; - case Constants.ACTION_CREATE: - if (recoveries == null) { - throw new InvalidDataException("recoveries", ErrorCode.NOT_NULL.getCode(), null); - } - for (Recovery recovery : recoveries) { - validator.validate(recovery, errors); - if (!recoveryRepository.uniqueCheck("name", recovery)) { - errors.addError(new FieldError("recovery", "name", recovery.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!recoveryRepository.uniqueCheck("code", recovery)) { - errors.addError(new FieldError("recovery", "code", recovery.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (recoveries == null) { - throw new InvalidDataException("recoveries", ErrorCode.NOT_NULL.getCode(), null); - } - for (Recovery recovery : recoveries) { - if (recovery.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), recovery.getId()); - } - validator.validate(recovery, errors); - if (!recoveryRepository.uniqueCheck("name", recovery)) { - errors.addError(new FieldError("recovery", "name", recovery.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!recoveryRepository.uniqueCheck("code", recovery)) { - errors.addError(new FieldError("recovery", "code", recovery.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (recoveries == null) { - throw new InvalidDataException("recoveries", ErrorCode.NOT_NULL.getCode(), null); - } - for (Recovery recovery : recoveries) { - if (recovery.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - recovery.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List recoveries) { - for (Recovery recovery : recoveries) { - // fetch related items - recovery.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if(recovery.getChartOfAccount() != null) { - ChartOfAccountSearch chartOfAccountSearch = new ChartOfAccountSearch(); - chartOfAccountSearch.setGlcode(recovery.getChartOfAccount().getGlcode()); - Pagination response = chartOfAccountRepository.search(chartOfAccountSearch); - if (response == null || response.getPagedData() == null || response.getPagedData().isEmpty()) { - throw new InvalidDataException("chartOfAccount", "chartOfAccount.invalid", " Invalid chartOfAccount"); - }else{ - recovery.setChartOfAccount(response.getPagedData().get(0)); - } - } - } - - return recoveries; - - } - - public Pagination search(RecoverySearch recoverySearch, BindingResult errors) { - - try { - - List recoveries = new ArrayList<>(); - recoveries.add(recoverySearch); - validate(recoveries, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return recoveryRepository.search(recoverySearch); - } - - @Transactional - public Recovery save(Recovery recovery) { - return recoveryRepository.save(recovery); - } - - @Transactional - public Recovery update(Recovery recovery) { - return recoveryRepository.update(recovery); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SchemeService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SchemeService.java deleted file mode 100644 index 3c3e4f72a7d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SchemeService.java +++ /dev/null @@ -1,175 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.domain.model.SchemeSearch; -import org.egov.egf.master.domain.repository.FundRepository; -import org.egov.egf.master.domain.repository.SchemeRepository; -import org.egov.egf.master.web.requests.SchemeRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class SchemeService { - - @Autowired - private SchemeRepository schemeRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private FundRepository fundRepository; - - private BindingResult validate(List schemes, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(schemeContractRequest.getScheme(), - // errors); - break; - case Constants.ACTION_CREATE: - if (schemes == null) { - throw new InvalidDataException("schemes", ErrorCode.NOT_NULL.getCode(), null); - } - for (Scheme scheme : schemes) { - validator.validate(scheme, errors); - if (!schemeRepository.uniqueCheck("name", scheme)) { - errors.addError(new FieldError("scheme", "name", scheme.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!schemeRepository.uniqueCheck("code", scheme)) { - errors.addError(new FieldError("scheme", "code", scheme.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (schemes == null) { - throw new InvalidDataException("schemes", ErrorCode.NOT_NULL.getCode(), null); - } - for (Scheme scheme : schemes) { - if (scheme.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), scheme.getId()); - } - validator.validate(scheme, errors); - if (!schemeRepository.uniqueCheck("name", scheme)) { - errors.addError(new FieldError("scheme", "name", scheme.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - if (!schemeRepository.uniqueCheck("code", scheme)) { - errors.addError(new FieldError("scheme", "code", scheme.getCode(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (schemes == null) { - throw new InvalidDataException("schemes", ErrorCode.NOT_NULL.getCode(), null); - } - for (Scheme scheme : schemes) { - if (scheme.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - scheme.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List schemes) { - for (Scheme scheme : schemes) { - // fetch related items - scheme.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (scheme.getFund() != null) { - Fund fund = fundRepository.findById(scheme.getFund()); - if (fund == null) { - throw new InvalidDataException("fund", "fund.invalid", " Invalid fund"); - } - scheme.setFund(fund); - } - - } - - return schemes; - } - - @Transactional - public List add(List schemes, BindingResult errors) { - schemes = fetchRelated(schemes); - validate(schemes, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(Scheme b:schemes)b.setId(schemeRepository.getNextSequence()); - return schemes; - - } - - @Transactional - public List update(List schemes, BindingResult errors) { - schemes = fetchRelated(schemes); - validate(schemes, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return schemes; - - } - - public void addToQue(SchemeRequest request) { - schemeRepository.add(request); - } - - public Pagination search(SchemeSearch schemeSearch, BindingResult errors) { - - try { - - List schemes = new ArrayList<>(); - schemes.add(schemeSearch); - validate(schemes, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return schemeRepository.search(schemeSearch); - } - - @Transactional - public Scheme save(Scheme scheme) { - return schemeRepository.save(scheme); - } - - @Transactional - public Scheme update(Scheme scheme) { - return schemeRepository.update(scheme); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SubSchemeService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SubSchemeService.java deleted file mode 100644 index 7a8b3d2e7f2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SubSchemeService.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.domain.model.SubScheme; -import org.egov.egf.master.domain.model.SubSchemeSearch; -import org.egov.egf.master.domain.repository.SchemeRepository; -import org.egov.egf.master.domain.repository.SubSchemeRepository; -import org.egov.egf.master.web.requests.SubSchemeRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class SubSchemeService { - - @Autowired - private SubSchemeRepository subSchemeRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private SchemeRepository schemeRepository; - - private BindingResult validate(List subschemes, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(subSchemeContractRequest.getSubScheme(), - // errors); - break; - case Constants.ACTION_CREATE: - if (subschemes == null) { - throw new InvalidDataException("subschemes", ErrorCode.NOT_NULL.getCode(), null); - } - for (SubScheme subScheme : subschemes) { - validator.validate(subScheme, errors); - if (!subSchemeRepository.uniqueCheck("code", subScheme)) { - errors.addError(new FieldError("subScheme", "name", subScheme.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (subschemes == null) { - throw new InvalidDataException("subschemes", ErrorCode.NOT_NULL.getCode(), null); - } - for (SubScheme subScheme : subschemes) { - if (subScheme.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), subScheme.getId()); - } - validator.validate(subScheme, errors); - if (!subSchemeRepository.uniqueCheck("name", subScheme)) { - errors.addError(new FieldError("subScheme", "name", subScheme.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (subschemes == null) { - throw new InvalidDataException("subschemes", ErrorCode.NOT_NULL.getCode(), null); - } - for (SubScheme subscheme : subschemes) { - if (subscheme.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - subscheme.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List subschemes) { - for (SubScheme subScheme : subschemes) { - // fetch related items - subScheme.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (subScheme.getScheme() != null) { - Scheme scheme = schemeRepository.findById(subScheme.getScheme()); - if (scheme == null) { - throw new InvalidDataException("scheme", "scheme.invalid", " Invalid scheme"); - } - subScheme.setScheme(scheme); - } - - } - - return subschemes; - } - - @Transactional - public List add(List subschemes, BindingResult errors) { - subschemes = fetchRelated(subschemes); - validate(subschemes, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(SubScheme b:subschemes)b.setId(subSchemeRepository.getNextSequence()); - return subschemes; - - } - - @Transactional - public List update(List subschemes, BindingResult errors) { - subschemes = fetchRelated(subschemes); - validate(subschemes, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return subschemes; - - } - - public void addToQue(SubSchemeRequest request) { - subSchemeRepository.add(request); - } - - public Pagination search(SubSchemeSearch subSchemeSearch, BindingResult errors) { - - try { - - List subSchemes = new ArrayList<>(); - subSchemes.add(subSchemeSearch); - validate(subSchemes, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return subSchemeRepository.search(subSchemeSearch); - } - - @Transactional - public SubScheme save(SubScheme subScheme) { - return subSchemeRepository.save(subScheme); - } - - @Transactional - public SubScheme update(SubScheme subScheme) { - return subSchemeRepository.update(subScheme); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SupplierService.java b/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SupplierService.java deleted file mode 100644 index 3237f801298..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/domain/service/SupplierService.java +++ /dev/null @@ -1,178 +0,0 @@ -package org.egov.egf.master.domain.service; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.Supplier; -import org.egov.egf.master.domain.model.SupplierSearch; -import org.egov.egf.master.domain.repository.BankAccountRepository; -import org.egov.egf.master.domain.repository.BankRepository; -import org.egov.egf.master.domain.repository.SupplierRepository; -import org.egov.egf.master.web.requests.SupplierRequest; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.validation.ObjectError; -import org.springframework.validation.SmartValidator; - -@Service -@Transactional(readOnly = true) -public class SupplierService { - - @Autowired - private SupplierRepository supplierRepository; - - @Autowired - private SmartValidator validator; - @Autowired - private BankAccountRepository bankAccountRepository; - @Autowired - private BankRepository bankRepository; - - private BindingResult validate(List suppliers, String method, BindingResult errors) { - - try { - switch (method) { - case Constants.ACTION_VIEW: - // validator.validate(supplierContractRequest.getSupplier(), - // errors); - break; - case Constants.ACTION_CREATE: - if (suppliers == null) { - throw new InvalidDataException("suppliers", ErrorCode.NOT_NULL.getCode(), null); - } - for (Supplier supplier : suppliers) { - validator.validate(supplier, errors); - if (!supplierRepository.uniqueCheck("code", supplier)) { - errors.addError(new FieldError("supplier", "name", supplier.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_UPDATE: - if (suppliers == null) { - throw new InvalidDataException("suppliers", ErrorCode.NOT_NULL.getCode(), null); - } - for (Supplier supplier : suppliers) { - if (supplier.getId() == null) { - throw new InvalidDataException("id", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), supplier.getId()); - } - validator.validate(supplier, errors); - if (!supplierRepository.uniqueCheck("name", supplier)) { - errors.addError(new FieldError("supplier", "name", supplier.getName(), false, - new String[] { ErrorCode.NON_UNIQUE_VALUE.getCode() }, null, null)); - } - } - break; - case Constants.ACTION_SEARCH: - if (suppliers == null) { - throw new InvalidDataException("suppliers", ErrorCode.NOT_NULL.getCode(), null); - } - for (Supplier supplier : suppliers) { - if (supplier.getTenantId() == null) { - throw new InvalidDataException("tenantId", ErrorCode.MANDATORY_VALUE_MISSING.getCode(), - supplier.getTenantId()); - } - } - break; - default: - - } - } catch (IllegalArgumentException e) { - errors.addError(new ObjectError("Missing data", e.getMessage())); - } - return errors; - } - - public List fetchRelated(List suppliers) { - for (Supplier supplier : suppliers) { - // fetch related items - supplier.setTenantId(ApplicationThreadLocals.getTenantId().get()); - if (supplier.getBankAccount() != null) { - BankAccount bankAccount = bankAccountRepository.findById(supplier.getBankAccount()); - if (bankAccount == null) { - throw new InvalidDataException("bankAccount", "bankAccount.invalid", " Invalid bankAccount"); - } - supplier.setBankAccount(bankAccount); - } - if (supplier.getBank() != null) { - Bank bank = bankRepository.findById(supplier.getBank()); - if (bank == null) { - throw new InvalidDataException("bank", "bank.invalid", " Invalid bank"); - } - supplier.setBank(bank); - } - - } - - return suppliers; - } - - @Transactional - public List add(List suppliers, BindingResult errors) { - suppliers = fetchRelated(suppliers); - validate(suppliers, Constants.ACTION_CREATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - for(Supplier s:suppliers)s.setId(supplierRepository.getNextSequence()); - return suppliers; - - } - - @Transactional - public List update(List suppliers, BindingResult errors) { - suppliers = fetchRelated(suppliers); - validate(suppliers, Constants.ACTION_UPDATE, errors); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - return suppliers; - - } - - public void addToQue(SupplierRequest request) { - supplierRepository.add(request); - } - - public Pagination search(SupplierSearch supplierSearch, BindingResult errors) { - - try { - - List suppliers = new ArrayList<>(); - suppliers.add(supplierSearch); - validate(suppliers, Constants.ACTION_SEARCH, errors); - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - } catch (CustomBindException e) { - - throw new CustomBindException(errors); - } - - return supplierRepository.search(supplierSearch); - } - - @Transactional - public Supplier save(Supplier supplier) { - return supplierRepository.save(supplier); - } - - @Transactional - public Supplier update(Supplier supplier) { - return supplierRepository.update(supplier); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountCodePurposeEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountCodePurposeEntity.java deleted file mode 100644 index 2545bbbb0f8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountCodePurposeEntity.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.AccountCodePurpose; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class AccountCodePurposeEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_accountcodepurpose"; - public static final String SEQUENCE_NAME = "seq_egf_accountcodepurpose"; - private String id; - private String name; - - public AccountCodePurpose toDomain() { - AccountCodePurpose accountCodePurpose = new AccountCodePurpose(); - super.toDomain(accountCodePurpose); - accountCodePurpose.setId(this.id); - accountCodePurpose.setName(this.name); - return accountCodePurpose; - } - - public AccountCodePurposeEntity toEntity(AccountCodePurpose accountCodePurpose) { - super.toEntity((Auditable) accountCodePurpose); - this.id = accountCodePurpose.getId(); - this.name = accountCodePurpose.getName(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountCodePurposeSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountCodePurposeSearchEntity.java deleted file mode 100644 index 4ac8680d4da..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountCodePurposeSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountCodePurposeSearchEntity extends AccountCodePurposeEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public AccountCodePurpose toDomain(){ -AccountCodePurpose accountCodePurpose = new AccountCodePurpose (); -super.toDomain( accountCodePurpose);return accountCodePurpose ;} - -public AccountCodePurposeSearchEntity toEntity( AccountCodePurposeSearch accountCodePurposeSearch){ -super.toEntity(( AccountCodePurpose)accountCodePurposeSearch); -this.pageSize=accountCodePurposeSearch.getPageSize(); this.offset=accountCodePurposeSearch.getOffset(); this.sortBy=accountCodePurposeSearch.getSortBy(); this.ids=accountCodePurposeSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailKeyEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailKeyEntity.java deleted file mode 100644 index 07f5e1c9136..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailKeyEntity.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailType; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class AccountDetailKeyEntity extends AuditableEntity -{ - public static final String TABLE_NAME = "egf_accountdetailkey"; - public static final String SEQUENCE_NAME = "seq_egf_accountdetailkey"; - private String id; - private String key; - private String accountDetailTypeId; - - public AccountDetailKey toDomain() { - AccountDetailKey accountDetailKey = new AccountDetailKey(); - super.toDomain(accountDetailKey); - accountDetailKey.setId(this.id); - accountDetailKey.setKey(this.key); - accountDetailKey.setAccountDetailType(AccountDetailType.builder().id(accountDetailTypeId).build()); - return accountDetailKey; - } - - public AccountDetailKeyEntity toEntity(AccountDetailKey accountDetailKey) { - super.toEntity((Auditable) accountDetailKey); - this.id = accountDetailKey.getId(); - this.key = accountDetailKey.getKey(); - this.accountDetailTypeId = accountDetailKey.getAccountDetailType() != null ? accountDetailKey.getAccountDetailType() - .getId() : null; - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailKeySearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailKeySearchEntity.java deleted file mode 100644 index 0e4d0e5cc86..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailKeySearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountDetailKeySearchEntity extends AccountDetailKeyEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public AccountDetailKey toDomain(){ -AccountDetailKey accountDetailKey = new AccountDetailKey (); -super.toDomain( accountDetailKey);return accountDetailKey ;} - -public AccountDetailKeySearchEntity toEntity( AccountDetailKeySearch accountDetailKeySearch){ -super.toEntity(( AccountDetailKey)accountDetailKeySearch); -this.pageSize=accountDetailKeySearch.getPageSize(); this.offset=accountDetailKeySearch.getOffset(); this.sortBy=accountDetailKeySearch.getSortBy(); this.ids=accountDetailKeySearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailTypeEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailTypeEntity.java deleted file mode 100644 index 172ac6edcdc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailTypeEntity.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.AccountDetailType; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class AccountDetailTypeEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_accountdetailtype"; - public static final String SEQUENCE_NAME = "seq_egf_accountdetailtype"; - private String id; - private String name; - private String description; - private String tablename; - private Boolean active; - private String fullyQualifiedName; - - public AccountDetailType toDomain() { - AccountDetailType accountDetailType = new AccountDetailType(); - super.toDomain(accountDetailType); - accountDetailType.setId(this.id); - accountDetailType.setName(this.name); - accountDetailType.setDescription(this.description); - accountDetailType.setTableName(this.tablename); - accountDetailType.setActive(this.active); - accountDetailType.setFullyQualifiedName(this.fullyQualifiedName); - return accountDetailType; - } - - public AccountDetailTypeEntity toEntity(AccountDetailType accountDetailType) { - super.toEntity((Auditable) accountDetailType); - this.id = accountDetailType.getId(); - this.name = accountDetailType.getName(); - this.description = accountDetailType.getDescription(); - this.tablename = accountDetailType.getTableName(); - this.active = accountDetailType.getActive(); - this.fullyQualifiedName = accountDetailType.getFullyQualifiedName(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailTypeSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailTypeSearchEntity.java deleted file mode 100644 index 82acd897301..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountDetailTypeSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountDetailTypeSearchEntity extends AccountDetailTypeEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public AccountDetailType toDomain(){ -AccountDetailType accountDetailType = new AccountDetailType (); -super.toDomain( accountDetailType);return accountDetailType ;} - -public AccountDetailTypeSearchEntity toEntity( AccountDetailTypeSearch accountDetailTypeSearch){ -super.toEntity(( AccountDetailType)accountDetailTypeSearch); -this.pageSize=accountDetailTypeSearch.getPageSize(); this.offset=accountDetailTypeSearch.getOffset(); this.sortBy=accountDetailTypeSearch.getSortBy(); this.ids=accountDetailTypeSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountEntityEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountEntityEntity.java deleted file mode 100644 index 91e6d347e5b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountEntityEntity.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountEntity; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class AccountEntityEntity extends AuditableEntity -{ - public static final String TABLE_NAME = "egf_accountentity"; - public static final String SEQUENCE_NAME = "seq_egf_accountentitymaster"; - private String id; - private String accountDetailTypeId; - private String code; - private String name; - private Boolean active; - private String description; - - public AccountEntity toDomain() { - AccountEntity accountEntity = new AccountEntity(); - super.toDomain(accountEntity); - accountEntity.setId(this.id); - accountEntity.setAccountDetailType(AccountDetailType.builder().id(accountDetailTypeId).build()); - accountEntity.setCode(this.code); - accountEntity.setName(this.name); - accountEntity.setActive(this.active); - accountEntity.setDescription(this.description); - return accountEntity; - } - - public AccountEntityEntity toEntity(AccountEntity accountEntity) { - super.toEntity((Auditable) accountEntity); - this.id = accountEntity.getId(); - this.accountDetailTypeId = accountEntity.getAccountDetailType() != null ? accountEntity.getAccountDetailType().getId() - : null; - this.code = accountEntity.getCode(); - this.name = accountEntity.getName(); - this.active = accountEntity.getActive(); - this.description = accountEntity.getDescription(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountEntitySearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountEntitySearchEntity.java deleted file mode 100644 index 531193758a9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/AccountEntitySearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountEntitySearchEntity extends AccountEntityEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public AccountEntity toDomain(){ -AccountEntity accountEntity = new AccountEntity (); -super.toDomain( accountEntity);return accountEntity ;} - -public AccountEntitySearchEntity toEntity( AccountEntitySearch accountEntitySearch){ -super.toEntity(( AccountEntity)accountEntitySearch); -this.pageSize=accountEntitySearch.getPageSize(); this.offset=accountEntitySearch.getOffset(); this.sortBy=accountEntitySearch.getSortBy(); this.ids=accountEntitySearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankAccountEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankAccountEntity.java deleted file mode 100644 index 99141a74721..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankAccountEntity.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.enums.BankAccountType; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Fund; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class BankAccountEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_bankaccount"; - public static final String SEQUENCE_NAME = "seq_egf_bankaccount"; - private String id; - private String bankBranchId; - private String chartOfAccountId; - private String fundId; - private String accountNumber; - private String accountType; - private String description; - private Boolean active; - private String payTo; - private String type; - - public BankAccount toDomain() { - BankAccount bankAccount = new BankAccount(); - super.toDomain(bankAccount); - bankAccount.setId(this.id); - bankAccount.setBankBranch(BankBranch.builder().id(bankBranchId).build()); - bankAccount.setChartOfAccount(ChartOfAccount.builder().id(chartOfAccountId).build()); - bankAccount.setFund(Fund.builder().id(fundId).build()); - bankAccount.setAccountNumber(this.accountNumber); - bankAccount.setAccountType(this.accountType); - bankAccount.setDescription(this.description); - bankAccount.setActive(this.active); - bankAccount.setPayTo(this.payTo); - bankAccount.setType(BankAccountType.valueOf(this.type)); - return bankAccount; - } - - public BankAccountEntity toEntity(BankAccount bankAccount) { - super.toEntity((Auditable) bankAccount); - this.id = bankAccount.getId(); - this.bankBranchId = bankAccount.getBankBranch() != null ? bankAccount.getBankBranch().getId() : null; - this.chartOfAccountId = bankAccount.getChartOfAccount() != null ? bankAccount.getChartOfAccount().getId() - : null; - this.fundId = bankAccount.getFund() != null ? bankAccount.getFund().getId() : null; - this.accountNumber = bankAccount.getAccountNumber(); - this.accountType = bankAccount.getAccountType(); - this.description = bankAccount.getDescription(); - this.active = bankAccount.getActive(); - this.payTo = bankAccount.getPayTo(); - this.type = bankAccount.getType() != null ? bankAccount.getType().toString() : null; - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankAccountSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankAccountSearchEntity.java deleted file mode 100644 index 6c1c4cbffff..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankAccountSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankAccountSearchEntity extends BankAccountEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public BankAccount toDomain(){ -BankAccount bankAccount = new BankAccount (); -super.toDomain( bankAccount);return bankAccount ;} - -public BankAccountSearchEntity toEntity( BankAccountSearch bankAccountSearch){ -super.toEntity(( BankAccount)bankAccountSearch); -this.pageSize=bankAccountSearch.getPageSize(); this.offset=bankAccountSearch.getOffset(); this.sortBy=bankAccountSearch.getSortBy(); this.ids=bankAccountSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankBranchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankBranchEntity.java deleted file mode 100644 index 741f7d59dd1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankBranchEntity.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankBranch; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class BankBranchEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_bankbranch"; - public static final String SEQUENCE_NAME = "seq_egf_bankbranch"; - private String id; - private String bankId; - private String code; - private String name; - private String address; - private String address2; - private String city; - private String state; - private String pincode; - private String phone; - private String fax; - private String contactPerson; - private Boolean active; - private String description; - private String micr; - - public BankBranch toDomain() { - BankBranch bankBranch = new BankBranch(); - super.toDomain(bankBranch); - bankBranch.setId(this.id); - bankBranch.setBank(Bank.builder().id(bankId).build()); - bankBranch.setCode(this.code); - bankBranch.setName(this.name); - bankBranch.setAddress(this.address); - bankBranch.setAddress2(this.address2); - bankBranch.setCity(this.city); - bankBranch.setState(this.state); - bankBranch.setPincode(this.pincode); - bankBranch.setPhone(this.phone); - bankBranch.setFax(this.fax); - bankBranch.setContactPerson(this.contactPerson); - bankBranch.setActive(this.active); - bankBranch.setDescription(this.description); - bankBranch.setMicr(this.micr); - return bankBranch; - } - - public BankBranchEntity toEntity(BankBranch bankBranch) { - super.toEntity((Auditable) bankBranch); - this.id = bankBranch.getId(); - this.bankId = bankBranch.getBank() != null ? bankBranch.getBank().getId() : null; - this.code = bankBranch.getCode(); - this.name = bankBranch.getName(); - this.address = bankBranch.getAddress(); - this.address2 = bankBranch.getAddress2(); - this.city = bankBranch.getCity(); - this.state = bankBranch.getState(); - this.pincode = bankBranch.getPincode(); - this.phone = bankBranch.getPhone(); - this.fax = bankBranch.getFax(); - this.contactPerson = bankBranch.getContactPerson(); - this.active = bankBranch.getActive(); - this.description = bankBranch.getDescription(); - this.micr = bankBranch.getMicr(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankBranchSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankBranchSearchEntity.java deleted file mode 100644 index e18125a2852..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankBranchSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankBranchSearchEntity extends BankBranchEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public BankBranch toDomain(){ -BankBranch bankBranch = new BankBranch (); -super.toDomain( bankBranch);return bankBranch ;} - -public BankBranchSearchEntity toEntity( BankBranchSearch bankBranchSearch){ -super.toEntity(( BankBranch)bankBranchSearch); -this.pageSize=bankBranchSearch.getPageSize(); this.offset=bankBranchSearch.getOffset(); this.sortBy=bankBranchSearch.getSortBy(); this.ids=bankBranchSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankEntity.java deleted file mode 100644 index b66940f2c48..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankEntity.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Bank; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BankEntity extends AuditableEntity -{ - public static final String TABLE_NAME = "egf_bank"; - public static final String SEQUENCE_NAME = "seq_egf_bank"; - private String id; - private String code; - private String name; - private String description; - private Boolean active; - private String type; - - public Bank toDomain() { - Bank bank = new Bank(); - super.toDomain(bank); - bank.setId(this.id); - bank.setCode(this.code); - bank.setName(this.name); - bank.setDescription(this.description); - bank.setActive(this.active); - bank.setType(this.type); - return bank; - } - - public BankEntity toEntity(Bank bank) { - super.toEntity((Auditable) bank); - this.id = bank.getId(); - this.code = bank.getCode(); - this.name = bank.getName(); - this.description = bank.getDescription(); - this.active = bank.getActive(); - this.type = bank.getType(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankSearchEntity.java deleted file mode 100644 index 51c3f27a1af..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BankSearchEntity.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankSearchEntity extends BankEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - public Bank toDomain() { - Bank bank = new Bank(); - super.toDomain(bank); - return bank; - } - - public BankSearchEntity toEntity(BankSearch bankSearch) { - super.toEntity((Bank) bankSearch); - this.pageSize = bankSearch.getPageSize(); - this.offset = bankSearch.getOffset(); - this.sortBy = bankSearch.getSortBy(); - this.ids = bankSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BudgetGroupEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BudgetGroupEntity.java deleted file mode 100644 index 3cd7c297cc7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BudgetGroupEntity.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.enums.BudgetAccountType; -import org.egov.egf.master.domain.enums.BudgetingType; -import org.egov.egf.master.domain.model.BudgetGroup; -import org.egov.egf.master.domain.model.ChartOfAccount; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class BudgetGroupEntity extends AuditableEntity -{ - public static final String TABLE_NAME = "egf_budgetgroup"; - public static final String SEQUENCE_NAME = "seq_egf_budgetgroup"; - private String id; - private String name; - private String description; - private String majorCodeId; - private String maxCodeId; - private String minCodeId; - private String accountType; - private String budgetingType; - private Boolean active; - - public BudgetGroup toDomain() { - BudgetGroup budgetGroup = new BudgetGroup(); - super.toDomain(budgetGroup); - budgetGroup.setId(this.id); - budgetGroup.setName(this.name); - budgetGroup.setDescription(this.description); - budgetGroup.setMajorCode(ChartOfAccount.builder().id(majorCodeId).build()); - budgetGroup.setMaxCode(ChartOfAccount.builder().id(maxCodeId).build()); - budgetGroup.setMinCode(ChartOfAccount.builder().id(minCodeId).build()); - budgetGroup.setAccountType(BudgetAccountType.valueOf(this.accountType)); - budgetGroup.setBudgetingType(BudgetingType.valueOf(this.budgetingType)); - budgetGroup.setActive(this.active); - return budgetGroup; - } - - public BudgetGroupEntity toEntity(BudgetGroup budgetGroup) { - super.toEntity((Auditable) budgetGroup); - this.id = budgetGroup.getId(); - this.name = budgetGroup.getName(); - this.description = budgetGroup.getDescription(); - this.majorCodeId = budgetGroup.getMajorCode() != null ? budgetGroup.getMajorCode().getId() : null; - this.maxCodeId = budgetGroup.getMaxCode() != null ? budgetGroup.getMaxCode().getId() : null; - this.minCodeId = budgetGroup.getMinCode() != null ? budgetGroup.getMinCode().getId() : null; - this.accountType = budgetGroup.getAccountType() != null ? budgetGroup.getAccountType().toString() : null; - this.budgetingType = budgetGroup.getBudgetingType() != null ? budgetGroup.getBudgetingType().toString() : null; - this.active = budgetGroup.getActive(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BudgetGroupSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BudgetGroupSearchEntity.java deleted file mode 100644 index 98a9f362e67..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/BudgetGroupSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.BudgetGroup; -import org.egov.egf.master.domain.model.BudgetGroupSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BudgetGroupSearchEntity extends BudgetGroupEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public BudgetGroup toDomain(){ -BudgetGroup budgetGroup = new BudgetGroup (); -super.toDomain( budgetGroup);return budgetGroup ;} - -public BudgetGroupSearchEntity toEntity( BudgetGroupSearch budgetGroupSearch){ -super.toEntity(( BudgetGroup)budgetGroupSearch); -this.pageSize=budgetGroupSearch.getPageSize(); this.offset=budgetGroupSearch.getOffset(); this.sortBy=budgetGroupSearch.getSortBy(); this.ids=budgetGroupSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountDetailEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountDetailEntity.java deleted file mode 100644 index a43eb815af8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountDetailEntity.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class ChartOfAccountDetailEntity extends AuditableEntity -{ - public static final String TABLE_NAME = "egf_chartofaccountdetail"; - public static final String SEQUENCE_NAME = "seq_egf_chartofaccountdetail"; - private String id; - private String chartOfAccountId; - private String accountDetailTypeId; - - public ChartOfAccountDetail toDomain() { - ChartOfAccountDetail chartOfAccountDetail = new ChartOfAccountDetail(); - super.toDomain(chartOfAccountDetail); - chartOfAccountDetail.setId(this.id); - chartOfAccountDetail.setChartOfAccount(ChartOfAccount.builder().id(chartOfAccountId).build()); - chartOfAccountDetail.setAccountDetailType(AccountDetailType.builder().id(accountDetailTypeId).build()); - return chartOfAccountDetail; - } - - public ChartOfAccountDetailEntity toEntity(ChartOfAccountDetail chartOfAccountDetail) { - super.toEntity((Auditable) chartOfAccountDetail); - this.id = chartOfAccountDetail.getId(); - this.chartOfAccountId = chartOfAccountDetail.getChartOfAccount() != null ? chartOfAccountDetail.getChartOfAccount() - .getId() : null; - this.accountDetailTypeId = chartOfAccountDetail.getAccountDetailType() != null ? chartOfAccountDetail - .getAccountDetailType().getId() : null; - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountDetailSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountDetailSearchEntity.java deleted file mode 100644 index 2a12d55f163..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountDetailSearchEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class ChartOfAccountDetailSearchEntity extends ChartOfAccountDetailEntity { - private String ids; - private String chartOfAccountIds; - private String sortBy; - private Integer pageSize; - private Integer offset; - - public ChartOfAccountDetail toDomain() { - ChartOfAccountDetail chartOfAccountDetail = new ChartOfAccountDetail(); - super.toDomain(chartOfAccountDetail); - return chartOfAccountDetail; - } - - public ChartOfAccountDetailSearchEntity toEntity(ChartOfAccountDetailSearch chartOfAccountDetailSearch) { - super.toEntity((ChartOfAccountDetail) chartOfAccountDetailSearch); - this.pageSize = chartOfAccountDetailSearch.getPageSize(); - this.offset = chartOfAccountDetailSearch.getOffset(); - this.sortBy = chartOfAccountDetailSearch.getSortBy(); - this.ids = chartOfAccountDetailSearch.getIds(); - this.chartOfAccountIds = chartOfAccountDetailSearch.getChartOfAccountIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountEntity.java deleted file mode 100644 index bcbf5173c1c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountEntity.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.ChartOfAccount; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class ChartOfAccountEntity extends AuditableEntity -{ - public static final String TABLE_NAME = "egf_chartofaccount"; - public static final String SEQUENCE_NAME = "seq_egf_chartofaccount"; - private String id; - private String glcode; - private String name; - private String accountCodePurposeId; - private String description; - private Boolean isActiveForPosting; - private String parentId; - private Character type; - private Long classification; - private Boolean functionRequired; - private Boolean budgetCheckRequired; - private String majorCode; - private Boolean isSubLedger; - - public ChartOfAccount toDomain() { - ChartOfAccount chartOfAccount = new ChartOfAccount(); - super.toDomain(chartOfAccount); - chartOfAccount.setId(this.id); - chartOfAccount.setGlcode(this.glcode); - chartOfAccount.setName(this.name); - chartOfAccount.setAccountCodePurpose(AccountCodePurpose.builder().id(accountCodePurposeId).build()); - chartOfAccount.setDescription(this.description); - chartOfAccount.setIsActiveForPosting(this.isActiveForPosting); - chartOfAccount.setParentId(ChartOfAccount.builder().id(parentId).build()); - chartOfAccount.setType(this.type); - chartOfAccount.setClassification(this.classification); - chartOfAccount.setFunctionRequired(this.functionRequired); - chartOfAccount.setBudgetCheckRequired(this.budgetCheckRequired); - chartOfAccount.setMajorCode(this.majorCode); - chartOfAccount.setIsSubLedger(this.isSubLedger); - return chartOfAccount; - } - - public ChartOfAccountEntity toEntity(ChartOfAccount chartOfAccount) { - super.toEntity((Auditable) chartOfAccount); - this.id = chartOfAccount.getId(); - this.glcode = chartOfAccount.getGlcode(); - this.name = chartOfAccount.getName(); - this.accountCodePurposeId = chartOfAccount.getAccountCodePurpose() != null ? chartOfAccount.getAccountCodePurpose() - .getId() : null; - this.description = chartOfAccount.getDescription(); - this.isActiveForPosting = chartOfAccount.getIsActiveForPosting(); - this.parentId = chartOfAccount.getParentId() != null ? chartOfAccount.getParentId().getId() : null; - this.type = chartOfAccount.getType(); - this.classification = chartOfAccount.getClassification(); - this.functionRequired = chartOfAccount.getFunctionRequired(); - this.budgetCheckRequired = chartOfAccount.getBudgetCheckRequired(); - this.majorCode = chartOfAccount.getMajorCode(); - this.isSubLedger = chartOfAccount.getIsSubLedger(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountSearchEntity.java deleted file mode 100644 index 5330fd3734f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/ChartOfAccountSearchEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class ChartOfAccountSearchEntity extends ChartOfAccountEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String glcodes; - - public ChartOfAccount toDomain() { - ChartOfAccount chartOfAccount = new ChartOfAccount(); - super.toDomain(chartOfAccount); - return chartOfAccount; - } - - public ChartOfAccountSearchEntity toEntity(ChartOfAccountSearch chartOfAccountSearch) { - super.toEntity((ChartOfAccount) chartOfAccountSearch); - this.pageSize = chartOfAccountSearch.getPageSize(); - this.offset = chartOfAccountSearch.getOffset(); - this.sortBy = chartOfAccountSearch.getSortBy(); - this.ids = chartOfAccountSearch.getIds(); - this.glcodes = chartOfAccountSearch.getGlcodes(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationEntity.java deleted file mode 100644 index 0deee9d7dac..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationEntity.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.FinancialConfiguration; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class FinancialConfigurationEntity extends AuditableEntity { - - public static final String TABLE_NAME = "egf_financialconfiguration"; - private String id; - private String name; - private String description; - private String module; - - public FinancialConfiguration toDomain() { - FinancialConfiguration financialConfiguration = new FinancialConfiguration(); - super.toDomain(financialConfiguration); - financialConfiguration.setId(this.id); - financialConfiguration.setName(this.name); - financialConfiguration.setDescription(this.description); - financialConfiguration.setModule(this.module); - return financialConfiguration; - } - - public FinancialConfigurationEntity toEntity(FinancialConfiguration financialConfiguration) { - super.toEntity((Auditable) financialConfiguration); - this.id = financialConfiguration.getId(); - this.name = financialConfiguration.getName(); - this.description = financialConfiguration.getDescription(); - this.module = financialConfiguration.getModule(); - return this; - } - -} - diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationSearchEntity.java deleted file mode 100644 index aff779c6598..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.FinancialConfiguration; -import org.egov.egf.master.domain.model.FinancialConfigurationSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialConfigurationSearchEntity extends FinancialConfigurationEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public FinancialConfiguration toDomain(){ -FinancialConfiguration financialConfiguration = new FinancialConfiguration (); -super.toDomain( financialConfiguration);return financialConfiguration ;} - -public FinancialConfigurationSearchEntity toEntity( FinancialConfigurationSearch financialConfigurationSearch){ -super.toEntity(( FinancialConfiguration)financialConfigurationSearch); -this.pageSize=financialConfigurationSearch.getPageSize(); this.offset=financialConfigurationSearch.getOffset(); this.sortBy=financialConfigurationSearch.getSortBy(); this.ids=financialConfigurationSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationValueEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationValueEntity.java deleted file mode 100644 index f829997942b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationValueEntity.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.util.Date; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.FinancialConfiguration; -import org.egov.egf.master.domain.model.FinancialConfigurationValue; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class FinancialConfigurationValueEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_financialconfigurationvalues"; - private String id; - private String financialConfigurationId; - private String value; - private Date effectiveFrom; - - public FinancialConfigurationValue toDomain() { - FinancialConfigurationValue financialConfigurationValue = new FinancialConfigurationValue(); - super.toDomain(financialConfigurationValue); - financialConfigurationValue.setId(this.id); - financialConfigurationValue - .setFinancialConfiguration(FinancialConfiguration.builder().id(financialConfigurationId).build()); - financialConfigurationValue.setValue(this.value); - financialConfigurationValue.setEffectiveFrom(this.effectiveFrom); - return financialConfigurationValue; - } - - public FinancialConfigurationValueEntity toEntity(FinancialConfigurationValue financialConfigurationValue) { - super.toEntity((Auditable) financialConfigurationValue); - this.id = financialConfigurationValue.getId(); - this.financialConfigurationId = financialConfigurationValue.getFinancialConfiguration() != null - ? financialConfigurationValue.getFinancialConfiguration().getId() : null; - this.value = financialConfigurationValue.getValue(); - this.effectiveFrom = financialConfigurationValue.getEffectiveFrom(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationValueSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationValueSearchEntity.java deleted file mode 100644 index 7e8f7ff01e5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialConfigurationValueSearchEntity.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.egf.master.domain.model.FinancialConfigurationValue; -import org.egov.egf.master.domain.model.FinancialConfigurationValueSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialConfigurationValueSearchEntity extends FinancialConfigurationValueEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - public FinancialConfigurationValue toDomain() { - FinancialConfigurationValue financialConfigurationValue = new FinancialConfigurationValue(); - super.toDomain(financialConfigurationValue); - return financialConfigurationValue; - } - - public FinancialConfigurationValueSearchEntity toEntity(FinancialConfigurationValueSearch financialConfigurationValueSearch) { - super.toEntity((FinancialConfigurationValue) financialConfigurationValueSearch); - this.pageSize = financialConfigurationValueSearch.getPageSize(); - this.offset = financialConfigurationValueSearch.getOffset(); - this.sortBy = financialConfigurationValueSearch.getSortBy(); - this.ids = financialConfigurationValueSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialStatusEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialStatusEntity.java deleted file mode 100644 index 7f687e5f01e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialStatusEntity.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.FinancialStatus; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class FinancialStatusEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_financialstatus"; - private String id; - private String moduleType; - private String code; - private String name; - private String description; - - public FinancialStatus toDomain() { - FinancialStatus financialStatus = new FinancialStatus(); - super.toDomain(financialStatus); - financialStatus.setId(this.id); - financialStatus.setModuleType(this.moduleType); - financialStatus.setCode(this.code); - financialStatus.setName(this.name); - financialStatus.setDescription(this.description); - return financialStatus; - } - - public FinancialStatusEntity toEntity(FinancialStatus financialStatus) { - super.toEntity((Auditable) financialStatus); - this.id = financialStatus.getId(); - this.moduleType = financialStatus.getModuleType(); - this.code = financialStatus.getCode(); - this.name = financialStatus.getName(); - this.description = financialStatus.getDescription(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialStatusSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialStatusSearchEntity.java deleted file mode 100644 index 785a69d7547..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialStatusSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.FinancialStatus; -import org.egov.egf.master.domain.model.FinancialStatusSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialStatusSearchEntity extends FinancialStatusEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public FinancialStatus toDomain(){ -FinancialStatus financialStatus = new FinancialStatus (); -super.toDomain( financialStatus);return financialStatus ;} - -public FinancialStatusSearchEntity toEntity( FinancialStatusSearch financialStatusSearch){ -super.toEntity(( FinancialStatus)financialStatusSearch); -this.pageSize=financialStatusSearch.getPageSize(); this.offset=financialStatusSearch.getOffset(); this.sortBy=financialStatusSearch.getSortBy(); this.ids=financialStatusSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialYearEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialYearEntity.java deleted file mode 100644 index 490540340fc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialYearEntity.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.util.Date; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.FinancialYear; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class FinancialYearEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_financialyear"; - public static final String SEQUENCE_NAME = "seq_egf_financialyear"; - private String id; - private String finYearRange; - private Date startingDate; - private Date endingDate; - private Boolean active; - private Boolean isActiveForPosting; - private Boolean isClosed; - private Boolean transferClosingBalance; - - public FinancialYear toDomain() { - FinancialYear financialYear = new FinancialYear(); - super.toDomain(financialYear); - financialYear.setId(this.id); - financialYear.setFinYearRange(this.finYearRange); - financialYear.setStartingDate(this.startingDate); - financialYear.setEndingDate(this.endingDate); - financialYear.setActive(this.active); - financialYear.setIsActiveForPosting(this.isActiveForPosting); - financialYear.setIsClosed(this.isClosed); - financialYear.setTransferClosingBalance(this.transferClosingBalance); - return financialYear; - } - - public FinancialYearEntity toEntity(FinancialYear financialYear) { - super.toEntity(financialYear); - this.id = financialYear.getId(); - this.finYearRange = financialYear.getFinYearRange(); - this.startingDate = financialYear.getStartingDate(); - this.endingDate = financialYear.getEndingDate(); - this.active = financialYear.getActive(); - this.isActiveForPosting = financialYear.getIsActiveForPosting(); - this.isClosed = financialYear.getIsClosed(); - this.transferClosingBalance = financialYear.getTransferClosingBalance(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialYearSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialYearSearchEntity.java deleted file mode 100644 index 4ef5e2419c7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FinancialYearSearchEntity.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.util.Date; - -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.domain.model.FinancialYearSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialYearSearchEntity extends FinancialYearEntity { - private Integer pageSize; - private Integer offset; - private String sortBy; - private Date asOnDate; - - @Override - public FinancialYear toDomain() { - FinancialYear financialYear = new FinancialYear(); - super.toDomain(financialYear); - return financialYear; - } - - public FinancialYearSearchEntity toEntity(FinancialYearSearch financialYearSearch) { - super.toEntity(financialYearSearch); - this.pageSize = financialYearSearch.getPageSize(); - this.offset = financialYearSearch.getOffset(); - this.sortBy = financialYearSearch.getSortBy(); - this.asOnDate = financialYearSearch.getAsOnDate(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FiscalPeriodEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FiscalPeriodEntity.java deleted file mode 100644 index f47a91022ec..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FiscalPeriodEntity.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.util.Date; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.domain.model.FiscalPeriod; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class FiscalPeriodEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_fiscalperiod"; - public static final String SEQUENCE_NAME = "seq_egf_fiscalperiod"; - private String id; - private String name; - private String financialYearId; - private Date startingDate; - private Date endingDate; - private Boolean active; - private Boolean isActiveForPosting; - private Boolean isClosed; - - public FiscalPeriod toDomain() { - FiscalPeriod fiscalPeriod = new FiscalPeriod(); - super.toDomain(fiscalPeriod); - fiscalPeriod.setId(this.id); - fiscalPeriod.setName(this.name); - fiscalPeriod.setFinancialYear(FinancialYear.builder().id(financialYearId).build()); - fiscalPeriod.setStartingDate(this.startingDate); - fiscalPeriod.setEndingDate(this.endingDate); - fiscalPeriod.setActive(this.active); - fiscalPeriod.setIsActiveForPosting(this.isActiveForPosting); - fiscalPeriod.setIsClosed(this.isClosed); - return fiscalPeriod; - } - - public FiscalPeriodEntity toEntity(FiscalPeriod fiscalPeriod) { - super.toEntity((Auditable) fiscalPeriod); - this.id = fiscalPeriod.getId(); - this.name = fiscalPeriod.getName(); - this.financialYearId = fiscalPeriod.getFinancialYear() != null ? fiscalPeriod.getFinancialYear().getId() : null; - this.startingDate = fiscalPeriod.getStartingDate(); - this.endingDate = fiscalPeriod.getEndingDate(); - this.active = fiscalPeriod.getActive(); - this.isActiveForPosting = fiscalPeriod.getIsActiveForPosting(); - this.isClosed = fiscalPeriod.getIsClosed(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FiscalPeriodSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FiscalPeriodSearchEntity.java deleted file mode 100644 index b8715eb04eb..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FiscalPeriodSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.FiscalPeriod; -import org.egov.egf.master.domain.model.FiscalPeriodSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FiscalPeriodSearchEntity extends FiscalPeriodEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public FiscalPeriod toDomain(){ -FiscalPeriod fiscalPeriod = new FiscalPeriod (); -super.toDomain( fiscalPeriod);return fiscalPeriod ;} - -public FiscalPeriodSearchEntity toEntity( FiscalPeriodSearch fiscalPeriodSearch){ -super.toEntity(( FiscalPeriod)fiscalPeriodSearch); -this.pageSize=fiscalPeriodSearch.getPageSize(); this.offset=fiscalPeriodSearch.getOffset(); this.sortBy=fiscalPeriodSearch.getSortBy(); this.ids=fiscalPeriodSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionEntity.java deleted file mode 100644 index 7bf1460e9f9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionEntity.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Function; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class FunctionEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_function"; - public static final String SEQUENCE_NAME = "seq_egf_function"; - private String id; - private String name; - private String code; - private Integer level; - private Boolean active; - private String parentId; - - public Function toDomain() { - Function function = new Function(); - super.toDomain(function); - function.setId(this.id); - function.setName(this.name); - function.setCode(this.code); - function.setLevel(this.level); - function.setActive(this.active); - function.setParentId(Function.builder().id(parentId).build()); - return function; - } - - public FunctionEntity toEntity(Function function) { - super.toEntity((Auditable) function); - this.id = function.getId(); - this.name = function.getName(); - this.code = function.getCode(); - this.level = function.getLevel(); - this.active = function.getActive(); - this.parentId = function.getParentId() != null ? function.getParentId().getId() : null; - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionSearchEntity.java deleted file mode 100644 index eb9a6c7fe35..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionSearchEntity.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FunctionSearchEntity extends FunctionEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - public Function toDomain() { - Function function = new Function(); - super.toDomain(function); - return function; - } - - public FunctionSearchEntity toEntity(FunctionSearch functionSearch) { - super.toEntity((Function) functionSearch); - this.pageSize = functionSearch.getPageSize(); - this.offset = functionSearch.getOffset(); - this.sortBy = functionSearch.getSortBy(); - this.ids = functionSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionaryEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionaryEntity.java deleted file mode 100644 index 4989fcc6b28..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionaryEntity.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Functionary; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class FunctionaryEntity extends AuditableEntity -{ - public static final String TABLE_NAME = "egf_functionary"; - public static final String SEQUENCE_NAME = "seq_egf_functionary"; - private String id; - private String code; - private String name; - private Boolean active; - - public Functionary toDomain() { - Functionary functionary = new Functionary(); - super.toDomain(functionary); - functionary.setId(this.id); - functionary.setCode(this.code); - functionary.setName(this.name); - functionary.setActive(this.active); - return functionary; - } - - public FunctionaryEntity toEntity(Functionary functionary) { - super.toEntity((Auditable) functionary); - this.id = functionary.getId(); - this.code = functionary.getCode(); - this.name = functionary.getName(); - this.active = functionary.getActive(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionarySearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionarySearchEntity.java deleted file mode 100644 index ee5f3f29dba..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FunctionarySearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.Functionary; -import org.egov.egf.master.domain.model.FunctionarySearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FunctionarySearchEntity extends FunctionaryEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public Functionary toDomain(){ -Functionary functionary = new Functionary (); -super.toDomain( functionary);return functionary ;} - -public FunctionarySearchEntity toEntity( FunctionarySearch functionarySearch){ -super.toEntity(( Functionary)functionarySearch); -this.pageSize=functionarySearch.getPageSize(); this.offset=functionarySearch.getOffset(); this.sortBy=functionarySearch.getSortBy(); this.ids=functionarySearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundEntity.java deleted file mode 100644 index 6e353465d3d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundEntity.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.persistence.entity; - -import javax.validation.constraints.NotNull; - -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Fund; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@AllArgsConstructor -@NoArgsConstructor -@Builder -@Getter -@Setter -public class FundEntity extends AuditableEntity { - - public static final String TABLE_NAME = "egf_fund"; - public static final String SEQUENCE_NAME = "seq_egf_fund"; - public static final String ALIAS = "fund"; - - private static final long serialVersionUID = 7977534010758407945L; - - protected String id; - - @Length(max = 50, min = 2) - @NotNull - protected String name; - - @Length(max = 50, min = 2) - @NotNull - protected String code; - @NotNull - protected Character identifier; - - @NotNull - protected Long level; - - @NotNull - protected Boolean active; - - protected String parentId; - - public Fund toDomain() { - - Fund fund = new Fund(); - Fund parent = null; - if (parentId != null) { - parent = Fund.builder().id(parentId).build(); - } - super.toDomain(fund); - fund.setId(this.id); - fund.setCode(this.code); - fund.setName(this.name); - fund.setIdentifier(this.identifier); - fund.setActive(this.active); - fund.setParent(parent); - fund.setLevel(this.level); - return fund; - - } - - public FundEntity toEntity(Fund fund) { - - super.toEntity(fund); - this.id = fund.getId(); - this.name = fund.getName(); - this.code = fund.getCode(); - this.identifier = fund.getIdentifier(); - this.level = 1l; - this.parentId = fund.getParent() != null ? fund.getParent().getId() : null; - this.active = fund.getActive(); - this.level = fund.getLevel(); - return this; - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundSearchEntity.java deleted file mode 100644 index 8381cdbec44..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.util.Date; - -import org.egov.egf.master.domain.model.FundSearch; - -import lombok.Data; - -@Data -public class FundSearchEntity extends FundEntity { - private Date fromDate; - private Date toDate; - private Integer pageSize; - private Integer offset = 0; - private String sortBy; - - public FundSearchEntity toEntity(FundSearch fundSearch) { - - super.toEntity(fundSearch); - this.pageSize = fundSearch.getPageSize(); - this.sortBy = fundSearch.getSortBy(); - return this; - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundsourceEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundsourceEntity.java deleted file mode 100644 index 68cb6605d9d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundsourceEntity.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.math.BigDecimal; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Fundsource; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class FundsourceEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_fundsource"; - public static final String SEQUENCE_NAME = "seq_egf_fundsource"; - private String id; - private String code; - private String name; - private String type; - private String parentId; - private BigDecimal llevel; - private Boolean active; - private Boolean isParent; - - public Fundsource toDomain() { - Fundsource fundsource = new Fundsource(); - Fundsource parent = null; - - super.toDomain(fundsource); - if (parentId != null) { - parent = Fundsource.builder().id(parentId).build(); - } - fundsource.setId(this.id); - fundsource.setCode(this.code); - fundsource.setName(this.name); - fundsource.setType(this.type); - fundsource.setParent(parent); - fundsource.setLlevel(this.llevel); - fundsource.setActive(this.active); - fundsource.setIsParent(this.isParent); - return fundsource; - } - - public FundsourceEntity toEntity(Fundsource fundsource) { - super.toEntity((Auditable) fundsource); - this.id = fundsource.getId(); - this.code = fundsource.getCode(); - this.name = fundsource.getName(); - this.type = fundsource.getType(); - this.parentId = fundsource.getParent() != null ? fundsource.getParent().getId() : null; - this.llevel = fundsource.getLlevel(); - this.active = fundsource.getActive(); - this.isParent = fundsource.getIsParent(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundsourceSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundsourceSearchEntity.java deleted file mode 100644 index fc27b1bcd2a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/FundsourceSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.Fundsource; -import org.egov.egf.master.domain.model.FundsourceSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FundsourceSearchEntity extends FundsourceEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public Fundsource toDomain(){ -Fundsource fundsource = new Fundsource (); -super.toDomain( fundsource);return fundsource ;} - -public FundsourceSearchEntity toEntity( FundsourceSearch fundsourceSearch){ -super.toEntity(( Fundsource)fundsourceSearch); -this.pageSize=fundsourceSearch.getPageSize(); this.offset=fundsourceSearch.getOffset(); this.sortBy=fundsourceSearch.getSortBy(); this.ids=fundsourceSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/RecoveryEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/RecoveryEntity.java deleted file mode 100644 index 893cdbda46c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/RecoveryEntity.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.persistence.entity; - -import lombok.*; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Recovery; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotNull; - -@AllArgsConstructor -@NoArgsConstructor -@Builder -@Getter -@Setter -public class RecoveryEntity extends AuditableEntity { - - public static final String TABLE_NAME = "egf_recovery"; - public static final String SEQUENCE_NAME = "seq_egf_recovery"; - public static final String ALIAS = "recovery"; - - private static final long serialVersionUID = 7977534010758407945L; - - protected String id; - - @Length(max = 50, min = 2) - @NotNull - protected String name; - - @Length(max = 50, min = 2) - @NotNull - protected String code; - - @NotNull - protected String chartOfAccountId; - - protected String type; - - protected Double flat; - - protected Double percentage; - - @NotNull - protected Boolean active; - - @Length(max = 100) - protected String remitted; - - @Length(max = 16) - protected String ifscCode; - - protected Character mode; - - protected Character remittanceMode; - - @Length(max = 32) - protected String accountNumber; - - - public Recovery toDomain() { - - Recovery recovery = new Recovery(); - recovery.setId(this.id); - recovery.setCode(this.code); - recovery.setName(this.name); - recovery.setAccountNumber(this.accountNumber); - recovery.setActive(this.active); - recovery.setChartOfAccount(ChartOfAccount.builder().glcode(this.chartOfAccountId).build()); - recovery.setFlat(this.flat); - recovery.setIfscCode(this.ifscCode); - recovery.setMode(this.mode); - recovery.setPercentage(this.percentage); - recovery.setRemittanceMode(this.remittanceMode); - recovery.setType(this.type); - recovery.setRemitted(this.remitted); - return recovery; - } - - public RecoveryEntity toEntity(Recovery recovery) { - - super.toEntity(recovery); - this.id = recovery.getId(); - this.code = recovery.getCode(); - this.name = recovery.getName(); - this.accountNumber = recovery.getAccountNumber(); - this.active = recovery.getActive(); - if(recovery.getChartOfAccount() != null && recovery.getChartOfAccount().getGlcode() != null) - this.chartOfAccountId = recovery.getChartOfAccount().getGlcode(); - this.flat = recovery.getFlat(); - this.ifscCode = recovery.getIfscCode(); - this.mode = recovery.getMode(); - this.percentage = recovery.getPercentage(); - this.remittanceMode = recovery.getRemittanceMode(); - this.type = recovery.getType(); - this.remitted = recovery.getRemitted(); - return this; - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/RecoverySearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/RecoverySearchEntity.java deleted file mode 100644 index d3ef73db501..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/RecoverySearchEntity.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import lombok.Data; -import org.egov.egf.master.domain.model.RecoverySearch; - -import java.util.Date; - -@Data -public class RecoverySearchEntity extends RecoveryEntity { - private Date fromDate; - private Date toDate; - private Integer pageSize; - private Integer offset = 0; - private String sortBy; - - public RecoverySearchEntity toEntity(RecoverySearch recoverySearch) { - - super.toEntity(recoverySearch); - this.pageSize = recoverySearch.getPageSize(); - this.sortBy = recoverySearch.getSortBy(); - return this; - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SchemeEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SchemeEntity.java deleted file mode 100644 index 7efe8ec357c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SchemeEntity.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.util.Date; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.Scheme; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class SchemeEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_scheme"; - public static final String SEQUENCE_NAME = "seq_egf_scheme"; - private String id; - private String fundId; - private String code; - private String name; - private Date validFrom; - private Date validTo; - private Boolean active; - private String description; - private String boundary; - - public Scheme toDomain() { - Scheme scheme = new Scheme(); - super.toDomain(scheme); - scheme.setId(this.id); - scheme.setFund(Fund.builder().id(fundId).build()); - scheme.setCode(this.code); - scheme.setName(this.name); - scheme.setValidFrom(this.validFrom); - scheme.setValidTo(this.validTo); - scheme.setActive(this.active); - scheme.setDescription(this.description); - scheme.setBoundary(this.boundary); - return scheme; - } - - public SchemeEntity toEntity(Scheme scheme) { - super.toEntity((Auditable) scheme); - this.id = scheme.getId(); - this.fundId = scheme.getFund() != null ? scheme.getFund().getId() : null; - this.code = scheme.getCode(); - this.name = scheme.getName(); - this.validFrom = scheme.getValidFrom(); - this.validTo = scheme.getValidTo(); - this.active = scheme.getActive(); - this.description = scheme.getDescription(); - this.boundary = scheme.getBoundary(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SchemeSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SchemeSearchEntity.java deleted file mode 100644 index 03e060c8e36..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SchemeSearchEntity.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.domain.model.SchemeSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SchemeSearchEntity extends SchemeEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - public Scheme toDomain() { - Scheme scheme = new Scheme(); - super.toDomain(scheme); - return scheme; - } - - public SchemeSearchEntity toEntity(SchemeSearch schemeSearch) { - super.toEntity((Scheme) schemeSearch); - this.pageSize = schemeSearch.getPageSize(); - this.offset = schemeSearch.getOffset(); - this.sortBy = schemeSearch.getSortBy(); - this.ids = schemeSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SubSchemeEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SubSchemeEntity.java deleted file mode 100644 index 0614ff11a1d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SubSchemeEntity.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import java.util.Date; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.domain.model.SubScheme; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class SubSchemeEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_subscheme"; - public static final String SEQUENCE_NAME = "seq_egf_subscheme"; - private String id; - private String schemeId; - private String code; - private String name; - private Date validFrom; - private Date validTo; - private Boolean active; - private String departmentId; - - public SubScheme toDomain() { - SubScheme subScheme = new SubScheme(); - super.toDomain(subScheme); - subScheme.setId(this.id); - subScheme.setScheme(Scheme.builder().id(schemeId).build()); - subScheme.setCode(this.code); - subScheme.setName(this.name); - subScheme.setValidFrom(this.validFrom); - subScheme.setValidTo(this.validTo); - subScheme.setActive(this.active); - subScheme.setDepartmentId(this.departmentId); - return subScheme; - } - - public SubSchemeEntity toEntity(SubScheme subScheme) { - super.toEntity((Auditable) subScheme); - this.id = subScheme.getId(); - this.schemeId = subScheme.getScheme() != null ? subScheme.getScheme().getId() : null; - this.code = subScheme.getCode(); - this.name = subScheme.getName(); - this.validFrom = subScheme.getValidFrom(); - this.validTo = subScheme.getValidTo(); - this.active = subScheme.getActive(); - this.departmentId = subScheme.getDepartmentId(); - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SubSchemeSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SubSchemeSearchEntity.java deleted file mode 100644 index 2c4ff6657dd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SubSchemeSearchEntity.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.egov.egf.master.persistence.entity ; -import org.egov.egf.master.domain.model.SubScheme; -import org.egov.egf.master.domain.model.SubSchemeSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SubSchemeSearchEntity extends SubSchemeEntity { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -public SubScheme toDomain(){ -SubScheme subScheme = new SubScheme (); -super.toDomain( subScheme);return subScheme ;} - -public SubSchemeSearchEntity toEntity( SubSchemeSearch subSchemeSearch){ -super.toEntity(( SubScheme)subSchemeSearch); -this.pageSize=subSchemeSearch.getPageSize(); this.offset=subSchemeSearch.getOffset(); this.sortBy=subSchemeSearch.getSortBy(); this.ids=subSchemeSearch.getIds(); return this;} - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SupplierEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SupplierEntity.java deleted file mode 100644 index afedc6156ed..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SupplierEntity.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.common.domain.model.Auditable; -import org.egov.common.persistence.entity.AuditableEntity; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.Supplier; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@Builder -public class SupplierEntity extends AuditableEntity { - public static final String TABLE_NAME = "egf_supplier"; - public static final String SEQUENCE_NAME = "seq_egf_supplier"; - private String id; - private String code; - private String name; - private String address; - private String mobile; - private String email; - private String description; - private Boolean active; - private String panNo; - private String tinNo; - private String registationNo; - private String bankAccountId; - private String ifscCode; - private String bankId; - - public Supplier toDomain() { - Supplier supplier = new Supplier(); - super.toDomain(supplier); - supplier.setId(this.id); - supplier.setCode(this.code); - supplier.setName(this.name); - supplier.setAddress(this.address); - supplier.setMobile(this.mobile); - supplier.setEmail(this.email); - supplier.setDescription(this.description); - supplier.setActive(this.active); - supplier.setPanNo(this.panNo); - supplier.setTinNo(this.tinNo); - supplier.setRegistationNo(this.registationNo); - supplier.setBankAccount(BankAccount.builder().id(bankAccountId).build()); - supplier.setIfscCode(this.ifscCode); - supplier.setBank(Bank.builder().id(bankId).build()); - return supplier; - } - - public SupplierEntity toEntity(Supplier supplier) { - super.toEntity((Auditable) supplier); - this.id = supplier.getId(); - this.code = supplier.getCode(); - this.name = supplier.getName(); - this.address = supplier.getAddress(); - this.mobile = supplier.getMobile(); - this.email = supplier.getEmail(); - this.description = supplier.getDescription(); - this.active = supplier.getActive(); - this.panNo = supplier.getPanNo(); - this.tinNo = supplier.getTinNo(); - this.registationNo = supplier.getRegistationNo(); - this.bankAccountId = supplier.getBankAccount() != null ? supplier.getBankAccount().getId() : null; - this.ifscCode = supplier.getIfscCode(); - this.bankId = supplier.getBank() != null ? supplier.getBank().getId() : null; - return this; - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SupplierSearchEntity.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SupplierSearchEntity.java deleted file mode 100644 index 6fe6a1cf55d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/entity/SupplierSearchEntity.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.egov.egf.master.persistence.entity; - -import org.egov.egf.master.domain.model.Supplier; -import org.egov.egf.master.domain.model.SupplierSearch; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SupplierSearchEntity extends SupplierEntity { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - - public Supplier toDomain() { - Supplier supplier = new Supplier(); - super.toDomain(supplier); - return supplier; - } - - public SupplierSearchEntity toEntity(SupplierSearch supplierSearch) { - super.toEntity((Supplier) supplierSearch); - this.pageSize = supplierSearch.getPageSize(); - this.offset = supplierSearch.getOffset(); - this.sortBy = supplierSearch.getSortBy(); - this.ids = supplierSearch.getIds(); - return this; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/FinancialMastersListener.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/FinancialMastersListener.java deleted file mode 100644 index 7b6505fc29e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/FinancialMastersListener.java +++ /dev/null @@ -1,952 +0,0 @@ -package org.egov.egf.master.persistence.queue; - -import java.util.Map; - -import org.egov.egf.master.domain.model.*; -import org.egov.egf.master.domain.service.*; -import org.egov.egf.master.web.contract.*; -import org.egov.egf.master.web.requests.*; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.ApplicationContext; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class FinancialMastersListener { - - @Value("${kafka.topics.egf.masters.completed.topic}") - private String completedTopic; - - @Value("${kafka.topics.egf.masters.fund.completed.key}") - private String fundCompletedKey; - - @Value("${kafka.topics.egf.masters.bank.completed.key}") - private String bankCompletedKey; - - @Value("${kafka.topics.egf.masters.bankbranch.completed.key}") - private String bankBranchCompletedKey; - - @Value("${kafka.topics.egf.masters.financialyear.completed.key}") - private String financialYearCompletedKey; - - @Value("${kafka.topics.egf.masters.fiscalperiod.completed.key}") - private String fiscalPeriodCompletedKey; - - @Value("${kafka.topics.egf.masters.function.completed.key}") - private String functionCompletedKey; - - @Value("${kafka.topics.egf.masters.functionary.completed.key}") - private String functionaryCompletedKey; - - @Value("${kafka.topics.egf.masters.fundsource.completed.key}") - private String fundsourceCompletedKey; - - @Value("${kafka.topics.egf.masters.scheme.completed.key}") - private String schemeCompletedKey; - - @Value("${kafka.topics.egf.masters.bankaccount.completed.key}") - private String bankAccountCompletedKey; - - @Value("${kafka.topics.egf.masters.subscheme.completed.key}") - private String subSchemeCompletedKey; - - @Value("${kafka.topics.egf.masters.supplier.completed.key}") - private String supplierCompletedKey; - - @Value("${kafka.topics.egf.masters.accountdetailtype.completed.key}") - private String accountDetailTypeCompletedKey; - - @Value("${kafka.topics.egf.masters.accountdetailkey.completed.key}") - private String accountDetailKeyCompletedKey; - - @Value("${kafka.topics.egf.masters.accountentity.completed.key}") - private String accountEntityCompletedKey; - - @Value("${kafka.topics.egf.masters.accountcodepurpose.completed.key}") - private String accountCodePurposeCompletedKey; - - @Value("${kafka.topics.egf.masters.chartofaccount.completed.key}") - private String chartOfAccountCompletedKey; - - @Value("${kafka.topics.egf.masters.chartofaccountdetail.completed.key}") - private String chartOfAccountDetailCompletedKey; - - @Value("${kafka.topics.egf.masters.budgetgroup.completed.key}") - private String budgetGroupCompletedKey; - - @Value("${kafka.topics.egf.masters.financialstatus.completed.key}") - private String financialStatusCompletedKey; - - @Value("${kafka.topics.egf.masters.financialconfiguration.completed.key}") - private String financialConfigurationCompletedKey; - - @Value("${kafka.topics.egf.masters.recovery.completed.key}") - private String recoveryCompletedKey; - - @Autowired - ApplicationContext applicationContext; - - @Autowired - ObjectMapper objectMapper; - - @Autowired - private FinancialProducer financialProducer; - - @Autowired - private FundService fundService; - - @Autowired - private BankService bankService; - - @Autowired - private FunctionService functionService; - - @Autowired - private BankBranchService bankBranchService; - - @Autowired - private BankAccountService bankAccountService; - - @Autowired - private AccountCodePurposeService accountCodePurposeService; - - @Autowired - private AccountDetailTypeService accountDetailTypeService; - - @Autowired - private AccountDetailKeyService accountDetailKeyService; - - @Autowired - private AccountEntityService accountEntityService; - - @Autowired - private BudgetGroupService budgetGroupService; - - @Autowired - private ChartOfAccountService chartOfAccountService; - - @Autowired - private ChartOfAccountDetailService chartOfAccountDetailService; - - @Autowired - private FinancialYearService financialYearService; - - @Autowired - private FiscalPeriodService fiscalPeriodService; - - @Autowired - private FunctionaryService functionaryService; - - @Autowired - private FundsourceService fundsourceService; - - @Autowired - private SchemeService schemeService; - - @Autowired - private SubSchemeService subSchemeService; - - @Autowired - private SupplierService supplierService; - - @Autowired - private FinancialStatusService financialStatusService; - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @Autowired - private RecoveryService recoveryService; - - @KafkaListener(id = "${kafka.topics.egf.masters.validated.id}", topics = "${kafka.topics.egf.masters.validated.topic}", groupId = "${kafka.topics.egf.masters.validated.group}") - public void process(Map mastersMap) { - // implement the details here - - if (mastersMap.get("bank_create") != null) { - BankRequest request = objectMapper.convertValue( - mastersMap.get("bank_create"), BankRequest.class); - ModelMapper mapper = new ModelMapper(); - for (BankContract bankContract : request.getBanks()) { - Bank domain = mapper.map(bankContract, Bank.class); - bankService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("bank_persisted", request); - financialProducer.sendMessage(completedTopic, bankCompletedKey, - mastersMap); - } - if (mastersMap.get("bank_update") != null) { - - BankRequest request = objectMapper.convertValue( - mastersMap.get("bank_update"), BankRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (BankContract bankContract : request.getBanks()) { - Bank domain = mapper.map(bankContract, Bank.class); - bankService.update(domain); - } - mastersMap.clear(); - mastersMap.put("bank_persisted", request); - financialProducer.sendMessage(completedTopic, bankCompletedKey, - mastersMap); - } - - if (mastersMap.get("bankbranch_create") != null) { - BankBranchRequest request = objectMapper.convertValue( - mastersMap.get("bankbranch_create"), BankBranchRequest.class); - ModelMapper mapper = new ModelMapper(); - for (BankBranchContract bankBranchContract : request.getBankBranches()) { - BankBranch domain = mapper.map(bankBranchContract, BankBranch.class); - bankBranchService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("bankbranch_persisted", request); - financialProducer.sendMessage(completedTopic, bankBranchCompletedKey, - mastersMap); - } - if (mastersMap.get("bankbranch_update") != null) { - - BankBranchRequest request = objectMapper.convertValue( - mastersMap.get("bankbranch_update"), BankBranchRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (BankBranchContract bankBranchContract : request.getBankBranches()) { - BankBranch domain = mapper.map(bankBranchContract, BankBranch.class); - bankBranchService.update(domain); - } - mastersMap.clear(); - mastersMap.put("bankbranch_persisted", request); - financialProducer.sendMessage(completedTopic, bankBranchCompletedKey, - mastersMap); - } - - if (mastersMap.get("fund_create") != null) { - FundRequest request = objectMapper.convertValue( - mastersMap.get("fund_create"), FundRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FundContract fundContract : request.getFunds()) { - Fund domain = mapper.map(fundContract, Fund.class); - fundService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("fund_persisted", request); - financialProducer.sendMessage(completedTopic, fundCompletedKey, - mastersMap); - } - if (mastersMap.get("fund_update") != null) { - - FundRequest request = objectMapper.convertValue( - mastersMap.get("fund_update"), FundRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FundContract fundContract : request.getFunds()) { - Fund domain = mapper.map(fundContract, Fund.class); - fundService.update(domain); - } - mastersMap.clear(); - mastersMap.put("fund_persisted", request); - financialProducer.sendMessage(completedTopic, fundCompletedKey, - mastersMap); - } - - if (mastersMap.get("financialyear_create") != null) { - FinancialYearRequest request = objectMapper.convertValue( - mastersMap.get("financialyear_create"), - FinancialYearRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FinancialYearContract financialYearContract : request - .getFinancialYears()) { - FinancialYear domain = mapper.map(financialYearContract, - FinancialYear.class); - financialYearService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("financialyear_persisted", request); - financialProducer.sendMessage(completedTopic, - financialYearCompletedKey, mastersMap); - } - if (mastersMap.get("financialyear_update") != null) { - - FinancialYearRequest request = objectMapper.convertValue( - mastersMap.get("financialyear_update"), - FinancialYearRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FinancialYearContract financialYearContract : request - .getFinancialYears()) { - FinancialYear domain = mapper.map(financialYearContract, - FinancialYear.class); - financialYearService.update(domain); - } - mastersMap.clear(); - mastersMap.put("financialyear_persisted", request); - financialProducer.sendMessage(completedTopic, - financialYearCompletedKey, mastersMap); - } - - if (mastersMap.get("fiscalperiod_create") != null) { - FiscalPeriodRequest request = objectMapper.convertValue( - mastersMap.get("fiscalperiod_create"), - FiscalPeriodRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FiscalPeriodContract fiscalPeriodContract : request - .getFiscalPeriods()) { - FiscalPeriod domain = mapper.map(fiscalPeriodContract, - FiscalPeriod.class); - fiscalPeriodService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("fiscalperiod_persisted", request); - financialProducer.sendMessage(completedTopic, - fiscalPeriodCompletedKey, mastersMap); - } - if (mastersMap.get("fiscalperiod_update") != null) { - - FiscalPeriodRequest request = objectMapper.convertValue( - mastersMap.get("fiscalperiod_update"), - FiscalPeriodRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FiscalPeriodContract fiscalPeriodContract : request - .getFiscalPeriods()) { - FiscalPeriod domain = mapper.map(fiscalPeriodContract, - FiscalPeriod.class); - fiscalPeriodService.update(domain); - } - mastersMap.clear(); - mastersMap.put("fiscalperiod_persisted", request); - financialProducer.sendMessage(completedTopic, - fiscalPeriodCompletedKey, mastersMap); - } - - if (mastersMap.get("function_create") != null) { - FunctionRequest request = objectMapper.convertValue( - mastersMap.get("function_create"), FunctionRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FunctionContract functionContract : request.getFunctions()) { - Function domain = mapper.map(functionContract, Function.class); - functionService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("function_persisted", request); - financialProducer.sendMessage(completedTopic, functionCompletedKey, - mastersMap); - } - if (mastersMap.get("function_update") != null) { - - FunctionRequest request = objectMapper.convertValue( - mastersMap.get("function_update"), FunctionRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FunctionContract functionContract : request.getFunctions()) { - Function domain = mapper.map(functionContract, Function.class); - functionService.update(domain); - } - mastersMap.clear(); - mastersMap.put("function_persisted", request); - financialProducer.sendMessage(completedTopic, functionCompletedKey, - mastersMap); - } - - if (mastersMap.get("functionary_create") != null) { - FunctionaryRequest request = objectMapper.convertValue( - mastersMap.get("functionary_create"), - FunctionaryRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FunctionaryContract functionaryContract : request - .getFunctionaries()) { - Functionary domain = mapper.map(functionaryContract, - Functionary.class); - functionaryService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("functionary_persisted", request); - financialProducer.sendMessage(completedTopic, - functionaryCompletedKey, mastersMap); - } - if (mastersMap.get("functionary_update") != null) { - - FunctionaryRequest request = objectMapper.convertValue( - mastersMap.get("functionary_update"), - FunctionaryRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FunctionaryContract functionaryContract : request - .getFunctionaries()) { - Functionary domain = mapper.map(functionaryContract, - Functionary.class); - functionaryService.update(domain); - } - mastersMap.clear(); - mastersMap.put("functionary_persisted", request); - financialProducer.sendMessage(completedTopic, - functionaryCompletedKey, mastersMap); - } - - if (mastersMap.get("fundsource_create") != null) { - FundsourceRequest request = objectMapper.convertValue( - mastersMap.get("fundsource_create"), - FundsourceRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FundsourceContract fundsourceContract : request - .getFundsources()) { - Fundsource domain = mapper.map(fundsourceContract, - Fundsource.class); - fundsourceService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("fundsource_persisted", request); - financialProducer.sendMessage(completedTopic, - fundsourceCompletedKey, mastersMap); - } - if (mastersMap.get("fundsource_update") != null) { - - FundsourceRequest request = objectMapper.convertValue( - mastersMap.get("fundsource_update"), - FundsourceRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FundsourceContract fundsourceContract : request - .getFundsources()) { - Fundsource domain = mapper.map(fundsourceContract, - Fundsource.class); - fundsourceService.update(domain); - } - mastersMap.clear(); - mastersMap.put("fundsource_persisted", request); - financialProducer.sendMessage(completedTopic, - fundsourceCompletedKey, mastersMap); - } - - if (mastersMap.get("scheme_create") != null) { - SchemeRequest request = objectMapper.convertValue( - mastersMap.get("scheme_create"), SchemeRequest.class); - ModelMapper mapper = new ModelMapper(); - for (SchemeContract schemeContract : request.getSchemes()) { - Scheme domain = mapper.map(schemeContract, Scheme.class); - schemeService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("scheme_persisted", request); - financialProducer.sendMessage(completedTopic, schemeCompletedKey, - mastersMap); - } - if (mastersMap.get("scheme_update") != null) { - - SchemeRequest request = objectMapper.convertValue( - mastersMap.get("scheme_update"), SchemeRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (SchemeContract schemeContract : request.getSchemes()) { - Scheme domain = mapper.map(schemeContract, Scheme.class); - schemeService.update(domain); - } - mastersMap.clear(); - mastersMap.put("scheme_persisted", request); - financialProducer.sendMessage(completedTopic, schemeCompletedKey, - mastersMap); - } - - if (mastersMap.get("bankaccount_create") != null) { - BankAccountRequest request = objectMapper.convertValue( - mastersMap.get("bankaccount_create"), - BankAccountRequest.class); - ModelMapper mapper = new ModelMapper(); - for (BankAccountContract bankAccountContract : request - .getBankAccounts()) { - BankAccount domain = mapper.map(bankAccountContract, - BankAccount.class); - bankAccountService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("bankaccount_persisted", request); - financialProducer.sendMessage(completedTopic, - bankAccountCompletedKey, mastersMap); - } - if (mastersMap.get("bankaccount_update") != null) { - - BankAccountRequest request = objectMapper.convertValue( - mastersMap.get("bankaccount_update"), - BankAccountRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (BankAccountContract bankAccountContract : request - .getBankAccounts()) { - BankAccount domain = mapper.map(bankAccountContract, - BankAccount.class); - bankAccountService.update(domain); - } - mastersMap.clear(); - mastersMap.put("bankaccount_persisted", request); - financialProducer.sendMessage(completedTopic, - bankAccountCompletedKey, mastersMap); - } - - if (mastersMap.get("subscheme_create") != null) { - SubSchemeRequest request = objectMapper.convertValue( - mastersMap.get("subscheme_create"), SubSchemeRequest.class); - ModelMapper mapper = new ModelMapper(); - for (SubSchemeContract subSchemeContract : request.getSubSchemes()) { - SubScheme domain = mapper.map(subSchemeContract, - SubScheme.class); - subSchemeService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("subscheme_persisted", request); - financialProducer.sendMessage(completedTopic, - subSchemeCompletedKey, mastersMap); - } - if (mastersMap.get("subscheme_update") != null) { - - SubSchemeRequest request = objectMapper.convertValue( - mastersMap.get("subscheme_update"), SubSchemeRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (SubSchemeContract subSchemeContract : request.getSubSchemes()) { - SubScheme domain = mapper.map(subSchemeContract, - SubScheme.class); - subSchemeService.update(domain); - } - mastersMap.clear(); - mastersMap.put("subscheme_persisted", request); - financialProducer.sendMessage(completedTopic, - subSchemeCompletedKey, mastersMap); - } - - if (mastersMap.get("supplier_create") != null) { - SupplierRequest request = objectMapper.convertValue( - mastersMap.get("supplier_create"), SupplierRequest.class); - ModelMapper mapper = new ModelMapper(); - for (SupplierContract supplierContract : request.getSuppliers()) { - Supplier domain = mapper.map(supplierContract, Supplier.class); - supplierService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("supplier_persisted", request); - financialProducer.sendMessage(completedTopic, supplierCompletedKey, - mastersMap); - } - if (mastersMap.get("supplier_update") != null) { - - SupplierRequest request = objectMapper.convertValue( - mastersMap.get("supplier_update"), SupplierRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (SupplierContract supplierContract : request.getSuppliers()) { - Supplier domain = mapper.map(supplierContract, Supplier.class); - supplierService.update(domain); - } - mastersMap.clear(); - mastersMap.put("supplier_persisted", request); - financialProducer.sendMessage(completedTopic, supplierCompletedKey, - mastersMap); - } - - if (mastersMap.get("accountdetailtype_create") != null) { - AccountDetailTypeRequest request = objectMapper.convertValue( - mastersMap.get("accountdetailtype_create"), - AccountDetailTypeRequest.class); - ModelMapper mapper = new ModelMapper(); - for (AccountDetailTypeContract accountDetailTypeContract : request - .getAccountDetailTypes()) { - AccountDetailType domain = mapper.map( - accountDetailTypeContract, AccountDetailType.class); - accountDetailTypeService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("accountdetailtype_persisted", request); - financialProducer.sendMessage(completedTopic, - accountDetailTypeCompletedKey, mastersMap); - } - if (mastersMap.get("accountdetailtype_update") != null) { - - AccountDetailTypeRequest request = objectMapper.convertValue( - mastersMap.get("accountdetailtype_update"), - AccountDetailTypeRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (AccountDetailTypeContract accountDetailTypeContract : request - .getAccountDetailTypes()) { - AccountDetailType domain = mapper.map( - accountDetailTypeContract, AccountDetailType.class); - accountDetailTypeService.update(domain); - } - mastersMap.clear(); - mastersMap.put("accountdetailtype_persisted", request); - financialProducer.sendMessage(completedTopic, - accountDetailTypeCompletedKey, mastersMap); - } - - if (mastersMap.get("accountdetailkey_create") != null) { - AccountDetailKeyRequest request = objectMapper.convertValue( - mastersMap.get("accountdetailkey_create"), - AccountDetailKeyRequest.class); - ModelMapper mapper = new ModelMapper(); - for (AccountDetailKeyContract accountDetailKeyContract : request - .getAccountDetailKeys()) { - AccountDetailKey domain = mapper.map(accountDetailKeyContract, - AccountDetailKey.class); - accountDetailKeyService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("accountdetailkey_persisted", request); - financialProducer.sendMessage(completedTopic, - accountDetailKeyCompletedKey, mastersMap); - } - if (mastersMap.get("accountdetailkey_update") != null) { - - AccountDetailKeyRequest request = objectMapper.convertValue( - mastersMap.get("accountdetailkey_update"), - AccountDetailKeyRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (AccountDetailKeyContract accountDetailKeyContract : request - .getAccountDetailKeys()) { - AccountDetailKey domain = mapper.map(accountDetailKeyContract, - AccountDetailKey.class); - accountDetailKeyService.update(domain); - } - mastersMap.clear(); - mastersMap.put("accountdetailkey_persisted", request); - financialProducer.sendMessage(completedTopic, - accountDetailKeyCompletedKey, mastersMap); - } - - if (mastersMap.get("accountentity_create") != null) { - AccountEntityRequest request = objectMapper.convertValue( - mastersMap.get("accountentity_create"), - AccountEntityRequest.class); - ModelMapper mapper = new ModelMapper(); - for (AccountEntityContract accountEntityContract : request - .getAccountEntities()) { - AccountEntity domain = mapper.map(accountEntityContract, - AccountEntity.class); - accountEntityService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("accountentity_persisted", request); - financialProducer.sendMessage(completedTopic, - accountEntityCompletedKey, mastersMap); - } - if (mastersMap.get("accountentity_update") != null) { - - AccountEntityRequest request = objectMapper.convertValue( - mastersMap.get("accountentity_update"), - AccountEntityRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (AccountEntityContract accountEntityContract : request - .getAccountEntities()) { - AccountEntity domain = mapper.map(accountEntityContract, - AccountEntity.class); - accountEntityService.update(domain); - } - mastersMap.clear(); - mastersMap.put("accountentity_persisted", request); - financialProducer.sendMessage(completedTopic, - accountEntityCompletedKey, mastersMap); - } - - if (mastersMap.get("accountcodepurpose_create") != null) { - AccountCodePurposeRequest request = objectMapper.convertValue( - mastersMap.get("accountcodepurpose_create"), - AccountCodePurposeRequest.class); - ModelMapper mapper = new ModelMapper(); - for (AccountCodePurposeContract accountCodePurposeContract : request - .getAccountCodePurposes()) { - AccountCodePurpose domain = mapper.map( - accountCodePurposeContract, AccountCodePurpose.class); - accountCodePurposeService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("accountcodepurpose_persisted", request); - financialProducer.sendMessage(completedTopic, - accountCodePurposeCompletedKey, mastersMap); - } - if (mastersMap.get("accountcodepurpose_update") != null) { - - AccountCodePurposeRequest request = objectMapper.convertValue( - mastersMap.get("accountcodepurpose_update"), - AccountCodePurposeRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (AccountCodePurposeContract accountCodePurposeContract : request - .getAccountCodePurposes()) { - AccountCodePurpose domain = mapper.map( - accountCodePurposeContract, AccountCodePurpose.class); - accountCodePurposeService.update(domain); - } - mastersMap.clear(); - mastersMap.put("accountcodepurpose_persisted", request); - financialProducer.sendMessage(completedTopic, - accountCodePurposeCompletedKey, mastersMap); - } - - if (mastersMap.get("chartofaccount_create") != null) { - ChartOfAccountRequest request = objectMapper.convertValue( - mastersMap.get("chartofaccount_create"), - ChartOfAccountRequest.class); - ModelMapper mapper = new ModelMapper(); - for (ChartOfAccountContract chartOfAccountContract : request - .getChartOfAccounts()) { - ChartOfAccount domain = mapper.map(chartOfAccountContract, - ChartOfAccount.class); - chartOfAccountService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("chartofaccount_persisted", request); - financialProducer.sendMessage(completedTopic, - chartOfAccountCompletedKey, mastersMap); - } - if (mastersMap.get("chartofaccount_update") != null) { - - ChartOfAccountRequest request = objectMapper.convertValue( - mastersMap.get("chartofaccount_update"), - ChartOfAccountRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (ChartOfAccountContract chartOfAccountContract : request - .getChartOfAccounts()) { - ChartOfAccount domain = mapper.map(chartOfAccountContract, - ChartOfAccount.class); - chartOfAccountService.update(domain); - } - mastersMap.clear(); - mastersMap.put("chartofaccount_persisted", request); - financialProducer.sendMessage(completedTopic, - chartOfAccountCompletedKey, mastersMap); - } - - if (mastersMap.get("chartofaccountdetail_create") != null) { - ChartOfAccountDetailRequest request = objectMapper.convertValue( - mastersMap.get("chartofaccountdetail_create"), - ChartOfAccountDetailRequest.class); - ModelMapper mapper = new ModelMapper(); - for (ChartOfAccountDetailContract chartOfAccountDetailContract : request - .getChartOfAccountDetails()) { - ChartOfAccountDetail domain = mapper.map( - chartOfAccountDetailContract, - ChartOfAccountDetail.class); - chartOfAccountDetailService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("chartofaccountdetail_persisted", request); - financialProducer.sendMessage(completedTopic, - chartOfAccountDetailCompletedKey, mastersMap); - } - if (mastersMap.get("chartofaccountdetail_update") != null) { - - ChartOfAccountDetailRequest request = objectMapper.convertValue( - mastersMap.get("chartofaccountdetail_update"), - ChartOfAccountDetailRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (ChartOfAccountDetailContract chartOfAccountDetailContract : request - .getChartOfAccountDetails()) { - ChartOfAccountDetail domain = mapper.map( - chartOfAccountDetailContract, - ChartOfAccountDetail.class); - chartOfAccountDetailService.update(domain); - } - mastersMap.clear(); - mastersMap.put("chartofaccountdetail_persisted", request); - financialProducer.sendMessage(completedTopic, - chartOfAccountDetailCompletedKey, mastersMap); - } - - if (mastersMap.get("budgetgroup_create") != null) { - BudgetGroupRequest request = objectMapper.convertValue( - mastersMap.get("budgetgroup_create"), - BudgetGroupRequest.class); - ModelMapper mapper = new ModelMapper(); - for (BudgetGroupContract budgetGroupContract : request - .getBudgetGroups()) { - BudgetGroup domain = mapper.map(budgetGroupContract, - BudgetGroup.class); - budgetGroupService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("budgetgroup_persisted", request); - financialProducer.sendMessage(completedTopic, - budgetGroupCompletedKey, mastersMap); - } - if (mastersMap.get("budgetgroup_update") != null) { - - BudgetGroupRequest request = objectMapper.convertValue( - mastersMap.get("budgetgroup_update"), - BudgetGroupRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (BudgetGroupContract budgetGroupContract : request - .getBudgetGroups()) { - BudgetGroup domain = mapper.map(budgetGroupContract, - BudgetGroup.class); - budgetGroupService.update(domain); - } - mastersMap.clear(); - mastersMap.put("budgetgroup_persisted", request); - financialProducer.sendMessage(completedTopic, - budgetGroupCompletedKey, mastersMap); - } - - if (mastersMap.get("financialstatus_create") != null) { - FinancialStatusRequest request = objectMapper.convertValue( - mastersMap.get("financialstatus_create"), - FinancialStatusRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FinancialStatusContract financialStatusContract : request - .getFinancialStatuses()) { - FinancialStatus domain = mapper.map(financialStatusContract, - FinancialStatus.class); - financialStatusService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("financialstatus_persisted", request); - financialProducer.sendMessage(completedTopic, - financialStatusCompletedKey, mastersMap); - } - if (mastersMap.get("financialstatus_update") != null) { - - FinancialStatusRequest request = objectMapper.convertValue( - mastersMap.get("financialstatus_update"), - FinancialStatusRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FinancialStatusContract financialStatusContract : request - .getFinancialStatuses()) { - FinancialStatus domain = mapper.map(financialStatusContract, - FinancialStatus.class); - financialStatusService.update(domain); - } - mastersMap.clear(); - mastersMap.put("financialstatus_persisted", request); - financialProducer.sendMessage(completedTopic, - financialStatusCompletedKey, mastersMap); - } - - if (mastersMap.get("financialconfiguration_create") != null) { - FinancialConfigurationRequest request = objectMapper.convertValue( - mastersMap.get("financialconfiguration_create"), - FinancialConfigurationRequest.class); - ModelMapper mapper = new ModelMapper(); - for (FinancialConfigurationContract financialConfigurationContract : request - .getFinancialConfigurations()) { - FinancialConfiguration domain = mapper.map( - financialConfigurationContract, - FinancialConfiguration.class); - financialConfigurationService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("financialconfiguration_persisted", request); - financialProducer.sendMessage(completedTopic, - financialConfigurationCompletedKey, mastersMap); - } - if (mastersMap.get("financialconfiguration_update") != null) { - - FinancialConfigurationRequest request = objectMapper.convertValue( - mastersMap.get("financialconfiguration_update"), - FinancialConfigurationRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (FinancialConfigurationContract financialConfigurationContract : request - .getFinancialConfigurations()) { - FinancialConfiguration domain = mapper.map( - financialConfigurationContract, - FinancialConfiguration.class); - financialConfigurationService.update(domain); - } - mastersMap.clear(); - mastersMap.put("financialconfiguration_persisted", request); - financialProducer.sendMessage(completedTopic, - financialConfigurationCompletedKey, mastersMap); - } - - if (mastersMap.get("bankbranch_create") != null) { - BankBranchRequest request = objectMapper.convertValue( - mastersMap.get("bankbranch_create"), BankBranchRequest.class); - ModelMapper mapper = new ModelMapper(); - for (BankBranchContract bankBranchContract : request.getBankBranches()) { - BankBranch domain = mapper.map(bankBranchContract, BankBranch.class); - bankBranchService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("bankbranch_persisted", request); - financialProducer.sendMessage(completedTopic, bankBranchCompletedKey, - mastersMap); - } - if (mastersMap.get("bankbranch_update") != null) { - - BankBranchRequest request = objectMapper.convertValue( - mastersMap.get("bankbranch_update"), BankBranchRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (BankBranchContract bankBranchContract : request.getBankBranches()) { - BankBranch domain = mapper.map(bankBranchContract, BankBranch.class); - bankBranchService.update(domain); - } - - mastersMap.clear(); - mastersMap.put("bankbranch_persisted", request); - financialProducer.sendMessage(completedTopic, bankBranchCompletedKey, - mastersMap); - } - if (mastersMap.get("recovery_create") != null) { - RecoveryRequest request = objectMapper.convertValue( - mastersMap.get("recovery_create"), RecoveryRequest.class); - ModelMapper mapper = new ModelMapper(); - for (RecoveryContract recoveryContract : request.getRecoverys()) { - Recovery domain = mapper.map(recoveryContract, Recovery.class); - recoveryService.save(domain); - } - - mastersMap.clear(); - mastersMap.put("recovery_persisted", request); - financialProducer.sendMessage(completedTopic, bankCompletedKey, - mastersMap); - } - if (mastersMap.get("recovery_update") != null) { - - RecoveryRequest request = objectMapper.convertValue( - mastersMap.get("recovery_update"), RecoveryRequest.class); - - ModelMapper mapper = new ModelMapper(); - for (RecoveryContract recoveryContract : request.getRecoverys()) { - Recovery domain = mapper.map(recoveryContract, Recovery.class); - recoveryService.update(domain); - } - mastersMap.clear(); - mastersMap.put("recovery_persisted", request); - financialProducer.sendMessage(completedTopic, bankCompletedKey, - mastersMap); - } - - - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/FinancialProducer.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/FinancialProducer.java deleted file mode 100644 index 191f75bb23e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/FinancialProducer.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.egov.egf.master.persistence.queue; - -import java.util.Map; - -import org.egov.tracer.kafka.LogAwareKafkaTemplate; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class FinancialProducer { - - private LogAwareKafkaTemplate kafkaTemplate; - - @Autowired - public FinancialProducer(LogAwareKafkaTemplate kafkaTemplate) { - this.kafkaTemplate = kafkaTemplate; - } - - public void sendMessage(String topic, String key, Map message) { - kafkaTemplate.send(topic, key, message); - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/MastersQueueRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/MastersQueueRepository.java deleted file mode 100644 index 24d0d6cc03c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/MastersQueueRepository.java +++ /dev/null @@ -1,353 +0,0 @@ -package org.egov.egf.master.persistence.queue; - -import java.util.Map; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -@Service -public class MastersQueueRepository { - - @Autowired - private FinancialProducer financialProducer; - - @Value("${kafka.topics.egf.masters.validated.topic}") - private String validatedTopic; - - @Value("${kafka.topics.egf.masters.completed.topic}") - private String completedTopic; - - @Value("${kafka.topics.egf.masters.fund.validated.key}") - private String fundValidatedKey; - - @Value("${kafka.topics.egf.masters.bank.validated.key}") - private String bankValidatedKey; - - @Value("${kafka.topics.egf.masters.bankbranch.validated.key}") - private String bankBranchValidatedKey; - - @Value("${kafka.topics.egf.masters.financialyear.validated.key}") - private String financialYearValidatedKey; - - @Value("${kafka.topics.egf.masters.fiscalperiod.validated.key}") - private String fiscalPeriodValidatedKey; - - @Value("${kafka.topics.egf.masters.function.validated.key}") - private String functionValidatedKey; - - @Value("${kafka.topics.egf.masters.functionary.validated.key}") - private String functionaryValidatedKey; - - @Value("${kafka.topics.egf.masters.fundsource.validated.key}") - private String fundsourceValidatedKey; - - @Value("${kafka.topics.egf.masters.scheme.validated.key}") - private String schemeValidatedKey; - - @Value("${kafka.topics.egf.masters.bankaccount.validated.key}") - private String bankAccountValidatedKey; - - @Value("${kafka.topics.egf.masters.subscheme.validated.key}") - private String subSchemeValidatedKey; - - @Value("${kafka.topics.egf.masters.supplier.validated.key}") - private String supplierValidatedKey; - - @Value("${kafka.topics.egf.masters.accountdetailtype.validated.key}") - private String accountDetailTypeValidatedKey; - - @Value("${kafka.topics.egf.masters.accountdetailkey.validated.key}") - private String accountDetailKeyValidatedKey; - - @Value("${kafka.topics.egf.masters.accountentity.validated.key}") - private String accountEntityValidatedKey; - - @Value("${kafka.topics.egf.masters.accountcodepurpose.validated.key}") - private String accountCodePurposeValidatedKey; - - @Value("${kafka.topics.egf.masters.chartofaccount.validated.key}") - private String chartOfAccountValidatedKey; - - @Value("${kafka.topics.egf.masters.chartofaccountdetail.validated.key}") - private String chartOfAccountDetailValidatedKey; - - @Value("${kafka.topics.egf.masters.budgetgroup.validated.key}") - private String budgetGroupValidatedKey; - - @Value("${kafka.topics.egf.masters.financialstatus.validated.key}") - private String financialStatusValidatedKey; - - @Value("${kafka.topics.egf.masters.financialconfiguration.validated.key}") - private String financialConfigurationValidatedKey; - - @Value("${kafka.topics.egf.masters.fund.completed.key}") - private String fundCompletedKey; - - @Value("${kafka.topics.egf.masters.bank.completed.key}") - private String bankCompletedKey; - - @Value("${kafka.topics.egf.masters.bankbranch.completed.key}") - private String bankBranchCompletedKey; - - @Value("${kafka.topics.egf.masters.financialyear.completed.key}") - private String financialYearCompletedKey; - - @Value("${kafka.topics.egf.masters.fiscalperiod.completed.key}") - private String fiscalPeriodCompletedKey; - - @Value("${kafka.topics.egf.masters.function.completed.key}") - private String functionCompletedKey; - - @Value("${kafka.topics.egf.masters.functionary.completed.key}") - private String functionaryCompletedKey; - - @Value("${kafka.topics.egf.masters.fundsource.completed.key}") - private String fundsourceCompletedKey; - - @Value("${kafka.topics.egf.masters.scheme.completed.key}") - private String schemeCompletedKey; - - @Value("${kafka.topics.egf.masters.bankaccount.completed.key}") - private String bankAccountCompletedKey; - - @Value("${kafka.topics.egf.masters.subscheme.completed.key}") - private String subSchemeCompletedKey; - - @Value("${kafka.topics.egf.masters.supplier.completed.key}") - private String supplierCompletedKey; - - @Value("${kafka.topics.egf.masters.accountdetailtype.completed.key}") - private String accountDetailTypeCompletedKey; - - @Value("${kafka.topics.egf.masters.accountdetailkey.completed.key}") - private String accountDetailKeyCompletedKey; - - @Value("${kafka.topics.egf.masters.accountentity.completed.key}") - private String accountEntityCompletedKey; - - @Value("${kafka.topics.egf.masters.accountcodepurpose.completed.key}") - private String accountCodePurposeCompletedKey; - - @Value("${kafka.topics.egf.masters.chartofaccount.completed.key}") - private String chartOfAccountCompletedKey; - - @Value("${kafka.topics.egf.masters.chartofaccountdetail.completed.key}") - private String chartOfAccountDetailCompletedKey; - - @Value("${kafka.topics.egf.masters.budgetgroup.completed.key}") - private String budgetGroupCompletedKey; - - @Value("${kafka.topics.egf.masters.financialstatus.completed.key}") - private String financialStatusCompletedKey; - - @Value("${kafka.topics.egf.masters.financialconfiguration.completed.key}") - private String financialConfigurationCompletedKey; - - @Value("${kafka.topics.egf.masters.recovery.validated.key}") - private String recoveryValidatedKey; - - @Value("${kafka.topics.egf.masters.recovery.completed.key}") - private String recoveryCompletedKey; - - private String key; - private String topicKey; - - public void add(Map topicMap) { - - for (Map.Entry entry : topicMap.entrySet()) { - System.out.println(entry.getKey() + "/" + entry.getValue()); - key = entry.getKey().split("_")[0]; - - if (key.equalsIgnoreCase("fund")) { - topicKey = fundValidatedKey; - break; - } - if (key.equalsIgnoreCase("bank")) { - topicKey = bankValidatedKey; - break; - } - if (key.equalsIgnoreCase("bankBranch")) { - topicKey = bankBranchValidatedKey; - break; - } - if (key.equalsIgnoreCase("financialYear")) { - topicKey = financialYearValidatedKey; - break; - } - if (key.equalsIgnoreCase("fiscalPeriod")) { - topicKey = fiscalPeriodValidatedKey; - break; - } - if (key.equalsIgnoreCase("function")) { - topicKey = functionValidatedKey; - break; - } - if (key.equalsIgnoreCase("functionary")) { - topicKey = functionaryValidatedKey; - break; - } - if (key.equalsIgnoreCase("fundsource")) { - topicKey = fundsourceValidatedKey; - break; - } - if (key.equalsIgnoreCase("scheme")) { - topicKey = schemeValidatedKey; - break; - } - if (key.equalsIgnoreCase("bankAccount")) { - topicKey = bankAccountValidatedKey; - break; - } - if (key.equalsIgnoreCase("subScheme")) { - topicKey = subSchemeValidatedKey; - break; - } - if (key.equalsIgnoreCase("supplier")) { - topicKey = supplierValidatedKey; - break; - } - if (key.equalsIgnoreCase("accountDetailType")) { - topicKey = accountDetailTypeValidatedKey; - break; - } - if (key.equalsIgnoreCase("accountDetailKey")) { - topicKey = accountDetailKeyValidatedKey; - break; - } - if (key.equalsIgnoreCase("accountEntity")) { - topicKey = accountEntityValidatedKey; - break; - } - if (key.equalsIgnoreCase("accountCodePurpose")) { - topicKey = accountCodePurposeValidatedKey; - break; - } - if (key.equalsIgnoreCase("chartOfAccount")) { - topicKey = chartOfAccountValidatedKey; - break; - } - if (key.equalsIgnoreCase("chartOfAccountDetail")) { - topicKey = chartOfAccountDetailValidatedKey; - break; - } - if (key.equalsIgnoreCase("budgetGroup")) { - topicKey = budgetGroupValidatedKey; - break; - } - if (key.equalsIgnoreCase("financialStatus")) { - topicKey = financialStatusValidatedKey; - break; - } - if (key.equalsIgnoreCase("financialConfiguration")) { - topicKey = financialConfigurationValidatedKey; - break; - } - if (key.equalsIgnoreCase("recovery")) { - topicKey = recoveryValidatedKey; - break; - } - } - - financialProducer.sendMessage(validatedTopic, topicKey, topicMap); - } - - public void addToSearch(Map topicMap) { - - for (Map.Entry entry : topicMap.entrySet()) { - System.out.println(entry.getKey() + "/" + entry.getValue()); - key = entry.getKey().split("_")[0]; - - if (key.equalsIgnoreCase("fund")) { - topicKey = fundCompletedKey; - break; - } - if (key.equalsIgnoreCase("bank")) { - topicKey = bankCompletedKey; - break; - } - if (key.equalsIgnoreCase("bankBranch")) { - topicKey = bankBranchCompletedKey; - break; - } - if (key.equalsIgnoreCase("financialYear")) { - topicKey = financialYearCompletedKey; - break; - } - if (key.equalsIgnoreCase("fiscalPeriod")) { - topicKey = fiscalPeriodCompletedKey; - break; - } - if (key.equalsIgnoreCase("function")) { - topicKey = functionCompletedKey; - break; - } - if (key.equalsIgnoreCase("functionary")) { - topicKey = functionaryCompletedKey; - break; - } - if (key.equalsIgnoreCase("fundsource")) { - topicKey = fundsourceCompletedKey; - break; - } - if (key.equalsIgnoreCase("scheme")) { - topicKey = schemeCompletedKey; - break; - } - if (key.equalsIgnoreCase("bankAccount")) { - topicKey = bankAccountCompletedKey; - break; - } - if (key.equalsIgnoreCase("subScheme")) { - topicKey = subSchemeCompletedKey; - break; - } - if (key.equalsIgnoreCase("supplier")) { - topicKey = supplierCompletedKey; - break; - } - if (key.equalsIgnoreCase("accountDetailType")) { - topicKey = accountDetailTypeCompletedKey; - break; - } - if (key.equalsIgnoreCase("accountDetailKey")) { - topicKey = accountDetailKeyCompletedKey; - break; - } - if (key.equalsIgnoreCase("accountEntity")) { - topicKey = accountEntityCompletedKey; - break; - } - if (key.equalsIgnoreCase("accountCodePurpose")) { - topicKey = accountCodePurposeCompletedKey; - break; - } - if (key.equalsIgnoreCase("chartOfAccount")) { - topicKey = chartOfAccountCompletedKey; - break; - } - if (key.equalsIgnoreCase("chartOfAccountDetail")) { - topicKey = chartOfAccountDetailCompletedKey; - break; - } - if (key.equalsIgnoreCase("budgetGroup")) { - topicKey = budgetGroupCompletedKey; - break; - } - if (key.equalsIgnoreCase("financialStatus")) { - topicKey = financialStatusCompletedKey; - break; - } - if (key.equalsIgnoreCase("financialConfiguration")) { - topicKey = financialConfigurationCompletedKey; - break; - } - if (key.equalsIgnoreCase("recovery")) { - topicKey = recoveryCompletedKey; - break; - } - } - - financialProducer.sendMessage(completedTopic, topicKey, topicMap); - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/ObjectMapperFactory.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/ObjectMapperFactory.java deleted file mode 100644 index 32e407aee2e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/queue/ObjectMapperFactory.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.egf.master.persistence.queue; - -import org.springframework.beans.factory.annotation.Autowired; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class ObjectMapperFactory { - - @Autowired - private ObjectMapper objectMapper; - - public ObjectMapper create() { - objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - return objectMapper; - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountCodePurposeJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountCodePurposeJdbcRepository.java deleted file mode 100644 index fc1bda477eb..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountCodePurposeJdbcRepository.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.persistence.entity.AccountCodePurposeEntity; -import org.egov.egf.master.persistence.entity.AccountCodePurposeSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class AccountCodePurposeJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(AccountCodePurposeJdbcRepository.class); - - static { - LOG.debug("init accountCodePurpose"); - init(AccountCodePurposeEntity.class); - LOG.debug("end init accountCodePurpose"); - } - - public AccountCodePurposeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public AccountCodePurposeEntity create(AccountCodePurposeEntity entity) { - super.create(entity); - return entity; - } - - public AccountCodePurposeEntity update(AccountCodePurposeEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(AccountCodePurposeSearch domain) { - AccountCodePurposeSearchEntity accountCodePurposeSearchEntity = new AccountCodePurposeSearchEntity(); - accountCodePurposeSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (accountCodePurposeSearchEntity.getSortBy() != null - && !accountCodePurposeSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(accountCodePurposeSearchEntity.getSortBy()); - validateEntityFieldName(accountCodePurposeSearchEntity.getSortBy(), AccountCodePurposeEntity.class); - } - - String orderBy = "order by name"; - if (accountCodePurposeSearchEntity.getSortBy() != null - && !accountCodePurposeSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + accountCodePurposeSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", AccountCodePurposeEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (accountCodePurposeSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", accountCodePurposeSearchEntity.getTenantId()); - } - if (accountCodePurposeSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", accountCodePurposeSearchEntity.getId()); - } - if (accountCodePurposeSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(accountCodePurposeSearchEntity.getIds().split(",")))); - } - if (accountCodePurposeSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", accountCodePurposeSearchEntity.getName()); - } - Pagination page = new Pagination<>(); - if (accountCodePurposeSearchEntity.getOffset() != null) { - page.setOffset(accountCodePurposeSearchEntity.getOffset()); - } - if (accountCodePurposeSearchEntity.getPageSize() != null) { - page.setPageSize(accountCodePurposeSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(AccountCodePurposeEntity.class); - - List accountCodePurposeEntities = namedParameterJdbcTemplate - .query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(accountCodePurposeEntities.size()); - - List accountcodepurposes = new ArrayList<>(); - for (AccountCodePurposeEntity accountCodePurposeEntity : accountCodePurposeEntities) { - - accountcodepurposes.add(accountCodePurposeEntity.toDomain()); - } - page.setPagedData(accountcodepurposes); - - return page; - } - - public AccountCodePurposeEntity findById(AccountCodePurposeEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List accountcodepurposes = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(AccountCodePurposeEntity.class)); - if (accountcodepurposes.isEmpty()) { - return null; - } else { - return accountcodepurposes.get(0); - } - - } - - public Boolean uniqueCheck(String fieldName, AccountCodePurposeEntity accountCodePurpose) { - return super.uniqueCheck(fieldName,accountCodePurpose); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountDetailKeyJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountDetailKeyJdbcRepository.java deleted file mode 100644 index a41dd174be8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountDetailKeyJdbcRepository.java +++ /dev/null @@ -1,169 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.persistence.entity.AccountDetailKeyEntity; -import org.egov.egf.master.persistence.entity.AccountDetailKeySearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class AccountDetailKeyJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(AccountDetailKeyJdbcRepository.class); - - static { - LOG.debug("init accountDetailKey"); - init(AccountDetailKeyEntity.class); - LOG.debug("end init accountDetailKey"); - } - - public AccountDetailKeyJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public AccountDetailKeyEntity create(AccountDetailKeyEntity entity) { - super.create(entity); - return entity; - } - - public AccountDetailKeyEntity update(AccountDetailKeyEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(AccountDetailKeySearch domain) { - AccountDetailKeySearchEntity accountDetailKeySearchEntity = new AccountDetailKeySearchEntity(); - accountDetailKeySearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (accountDetailKeySearchEntity.getSortBy() != null && !accountDetailKeySearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(accountDetailKeySearchEntity.getSortBy()); - validateEntityFieldName(accountDetailKeySearchEntity.getSortBy(), AccountDetailKeyEntity.class); - } - - String orderBy = "order by key"; - if (accountDetailKeySearchEntity.getSortBy() != null && !accountDetailKeySearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + accountDetailKeySearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", AccountDetailKeyEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (accountDetailKeySearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", accountDetailKeySearchEntity.getTenantId()); - } - if (accountDetailKeySearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", accountDetailKeySearchEntity.getId()); - } - if (accountDetailKeySearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(accountDetailKeySearchEntity.getIds().split(",")))); - } - if (accountDetailKeySearchEntity.getKey() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("key =:key"); - paramValues.put("key", accountDetailKeySearchEntity.getKey()); - } - if (accountDetailKeySearchEntity.getAccountDetailTypeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("accountDetailTypeId =:accountDetailType"); - paramValues.put("accountDetailType", accountDetailKeySearchEntity.getAccountDetailTypeId()); - } - - Pagination page = new Pagination<>(); - if (accountDetailKeySearchEntity.getOffset() != null) { - page.setOffset(accountDetailKeySearchEntity.getOffset()); - } - if (accountDetailKeySearchEntity.getPageSize() != null) { - page.setPageSize(accountDetailKeySearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(AccountDetailKeyEntity.class); - - List accountDetailKeyEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(accountDetailKeyEntities.size()); - - List accountdetailkeys = new ArrayList<>(); - for (AccountDetailKeyEntity accountDetailKeyEntity : accountDetailKeyEntities) { - - accountdetailkeys.add(accountDetailKeyEntity.toDomain()); - } - page.setPagedData(accountdetailkeys); - - return page; - } - - public AccountDetailKeyEntity findById(AccountDetailKeyEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List accountdetailkeys = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(AccountDetailKeyEntity.class)); - if (accountdetailkeys.isEmpty()) { - return null; - } else { - return accountdetailkeys.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountDetailTypeJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountDetailTypeJdbcRepository.java deleted file mode 100644 index ad40d5dc999..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountDetailTypeJdbcRepository.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.persistence.entity.AccountDetailTypeEntity; -import org.egov.egf.master.persistence.entity.AccountDetailTypeSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class AccountDetailTypeJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(AccountDetailTypeJdbcRepository.class); - - static { - LOG.debug("init accountDetailType"); - init(AccountDetailTypeEntity.class); - LOG.debug("end init accountDetailType"); - } - - public AccountDetailTypeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public AccountDetailTypeEntity create(AccountDetailTypeEntity entity) { - super.create(entity); - return entity; - } - - public AccountDetailTypeEntity update(AccountDetailTypeEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(AccountDetailTypeSearch domain) { - AccountDetailTypeSearchEntity accountDetailTypeSearchEntity = new AccountDetailTypeSearchEntity(); - accountDetailTypeSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (accountDetailTypeSearchEntity.getSortBy() != null && !accountDetailTypeSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(accountDetailTypeSearchEntity.getSortBy()); - validateEntityFieldName(accountDetailTypeSearchEntity.getSortBy(), AccountDetailTypeEntity.class); - } - - String orderBy = "order by name"; - if (accountDetailTypeSearchEntity.getSortBy() != null && !accountDetailTypeSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + accountDetailTypeSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", AccountDetailTypeEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (accountDetailTypeSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", accountDetailTypeSearchEntity.getTenantId()); - } - if (accountDetailTypeSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", accountDetailTypeSearchEntity.getId()); - } - if (accountDetailTypeSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", - new ArrayList(Arrays.asList(accountDetailTypeSearchEntity.getIds().split(",")))); - } - if (accountDetailTypeSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", accountDetailTypeSearchEntity.getName()); - } - if (accountDetailTypeSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", accountDetailTypeSearchEntity.getDescription()); - } - if (accountDetailTypeSearchEntity.getTablename() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tableName =:tableName"); - paramValues.put("tableName", accountDetailTypeSearchEntity.getTablename()); - } - if (accountDetailTypeSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", accountDetailTypeSearchEntity.getActive()); - } - if (accountDetailTypeSearchEntity.getFullyQualifiedName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("fullyQualifiedName =:fullyQualifiedName"); - paramValues.put("fullyQualifiedName", accountDetailTypeSearchEntity.getFullyQualifiedName()); - } - - Pagination page = new Pagination<>(); - if (accountDetailTypeSearchEntity.getOffset() != null) { - page.setOffset(accountDetailTypeSearchEntity.getOffset()); - } - if (accountDetailTypeSearchEntity.getPageSize() != null) { - page.setPageSize(accountDetailTypeSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(AccountDetailTypeEntity.class); - - List accountDetailTypeEntities = namedParameterJdbcTemplate - .query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(accountDetailTypeEntities.size()); - - List accountdetailtypes = new ArrayList<>(); - for (AccountDetailTypeEntity accountDetailTypeEntity : accountDetailTypeEntities) { - - accountdetailtypes.add(accountDetailTypeEntity.toDomain()); - } - page.setPagedData(accountdetailtypes); - - return page; - } - - public AccountDetailTypeEntity findById(AccountDetailTypeEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List accountdetailtypes = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(AccountDetailTypeEntity.class)); - if (accountdetailtypes.isEmpty()) { - return null; - } else { - return accountdetailtypes.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountEntityJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountEntityJdbcRepository.java deleted file mode 100644 index 9fb7fe733e6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/AccountEntityJdbcRepository.java +++ /dev/null @@ -1,190 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.persistence.entity.AccountEntityEntity; -import org.egov.egf.master.persistence.entity.AccountEntitySearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class AccountEntityJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(AccountEntityJdbcRepository.class); - - static { - LOG.debug("init accountEntity"); - init(AccountEntityEntity.class); - LOG.debug("end init accountEntity"); - } - - public AccountEntityJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public AccountEntityEntity create(AccountEntityEntity entity) { - super.create(entity); - return entity; - } - - public AccountEntityEntity update(AccountEntityEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(AccountEntitySearch domain) { - AccountEntitySearchEntity accountEntitySearchEntity = new AccountEntitySearchEntity(); - accountEntitySearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (accountEntitySearchEntity.getSortBy() != null && !accountEntitySearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(accountEntitySearchEntity.getSortBy()); - validateEntityFieldName(accountEntitySearchEntity.getSortBy(), AccountEntityEntity.class); - } - - String orderBy = "order by name"; - if (accountEntitySearchEntity.getSortBy() != null && !accountEntitySearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + accountEntitySearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", AccountEntityEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (accountEntitySearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", accountEntitySearchEntity.getTenantId()); - } - if (accountEntitySearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", accountEntitySearchEntity.getId()); - } - if (accountEntitySearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(accountEntitySearchEntity.getIds().split(",")))); - } - if (accountEntitySearchEntity.getAccountDetailTypeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("accountDetailTypeId =:accountDetailType"); - paramValues.put("accountDetailType", accountEntitySearchEntity.getAccountDetailTypeId()); - } - if (accountEntitySearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", accountEntitySearchEntity.getCode()); - } - if (accountEntitySearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", accountEntitySearchEntity.getName()); - } - if (accountEntitySearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", accountEntitySearchEntity.getActive()); - } - if (accountEntitySearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", accountEntitySearchEntity.getDescription()); - } - - Pagination page = new Pagination<>(); - if (accountEntitySearchEntity.getOffset() != null) { - page.setOffset(accountEntitySearchEntity.getOffset()); - } - if (accountEntitySearchEntity.getPageSize() != null) { - page.setPageSize(accountEntitySearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(AccountEntityEntity.class); - - List accountEntityEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(accountEntityEntities.size()); - - List accountentities = new ArrayList<>(); - for (AccountEntityEntity accountEntityEntity : accountEntityEntities) { - - accountentities.add(accountEntityEntity.toDomain()); - } - page.setPagedData(accountentities); - - return page; - } - - public AccountEntityEntity findById(AccountEntityEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List accountentities = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(AccountEntityEntity.class)); - if (accountentities.isEmpty()) { - return null; - } else { - return accountentities.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankAccountJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankAccountJdbcRepository.java deleted file mode 100644 index 31eb795432a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankAccountJdbcRepository.java +++ /dev/null @@ -1,216 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.persistence.entity.BankAccountEntity; -import org.egov.egf.master.persistence.entity.BankAccountSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class BankAccountJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(BankAccountJdbcRepository.class); - - static { - LOG.debug("init bankAccount"); - init(BankAccountEntity.class); - LOG.debug("end init bankAccount"); - } - - public BankAccountJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public BankAccountEntity create(BankAccountEntity entity) { - super.create(entity); - return entity; - } - - public BankAccountEntity update(BankAccountEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(BankAccountSearch domain) { - BankAccountSearchEntity bankAccountSearchEntity = new BankAccountSearchEntity(); - bankAccountSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (bankAccountSearchEntity.getSortBy() != null && !bankAccountSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(bankAccountSearchEntity.getSortBy()); - validateEntityFieldName(bankAccountSearchEntity.getSortBy(), BankAccountEntity.class); - } - - String orderBy = "order by accountNumber"; - if (bankAccountSearchEntity.getSortBy() != null && !bankAccountSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + bankAccountSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", BankAccountEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (bankAccountSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", bankAccountSearchEntity.getTenantId()); - } - if (bankAccountSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", bankAccountSearchEntity.getId()); - } - if (bankAccountSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(bankAccountSearchEntity.getIds().split(",")))); - } - if (bankAccountSearchEntity.getBankBranchId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("bankBranchId =:bankBranch"); - paramValues.put("bankBranch", bankAccountSearchEntity.getBankBranchId()); - } - if (bankAccountSearchEntity.getChartOfAccountId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("chartOfAccountId =:chartOfAccount"); - paramValues.put("chartOfAccount", bankAccountSearchEntity.getChartOfAccountId()); - } - if (bankAccountSearchEntity.getFundId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("fundId =:fund"); - paramValues.put("fund", bankAccountSearchEntity.getFundId()); - } - if (bankAccountSearchEntity.getAccountNumber() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("accountNumber =:accountNumber"); - paramValues.put("accountNumber", bankAccountSearchEntity.getAccountNumber()); - } - if (bankAccountSearchEntity.getAccountType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("accountType =:accountType"); - paramValues.put("accountType", bankAccountSearchEntity.getAccountType()); - } - if (bankAccountSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", bankAccountSearchEntity.getDescription()); - } - if (bankAccountSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", bankAccountSearchEntity.getActive()); - } - if (bankAccountSearchEntity.getPayTo() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("payTo =:payTo"); - paramValues.put("payTo", bankAccountSearchEntity.getPayTo()); - } - if (bankAccountSearchEntity.getType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("type =:type"); - paramValues.put("type", bankAccountSearchEntity.getType().toString()); - } - - Pagination page = new Pagination<>(); - if (bankAccountSearchEntity.getOffset() != null) { - page.setOffset(bankAccountSearchEntity.getOffset()); - } - if (bankAccountSearchEntity.getPageSize() != null) { - page.setPageSize(bankAccountSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(BankAccountEntity.class); - - List bankAccountEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(bankAccountEntities.size()); - - List bankaccounts = new ArrayList<>(); - for (BankAccountEntity bankAccountEntity : bankAccountEntities) { - - bankaccounts.add(bankAccountEntity.toDomain()); - } - page.setPagedData(bankaccounts); - - return page; - } - - public BankAccountEntity findById(BankAccountEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List bankaccounts = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(BankAccountEntity.class)); - if (bankaccounts.isEmpty()) { - return null; - } else { - return bankaccounts.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankBranchJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankBranchJdbcRepository.java deleted file mode 100644 index 1e63a0df724..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankBranchJdbcRepository.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.persistence.entity.BankBranchEntity; -import org.egov.egf.master.persistence.entity.BankBranchSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class BankBranchJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(BankBranchJdbcRepository.class); - - static { - LOG.debug("init bankBranch"); - init(BankBranchEntity.class); - LOG.debug("end init bankBranch"); - } - - public BankBranchJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public BankBranchEntity create(BankBranchEntity entity) { - super.create(entity); - return entity; - } - - public BankBranchEntity update(BankBranchEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(BankBranchSearch domain) { - BankBranchSearchEntity bankBranchSearchEntity = new BankBranchSearchEntity(); - bankBranchSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (bankBranchSearchEntity.getSortBy() != null && !bankBranchSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(bankBranchSearchEntity.getSortBy()); - validateEntityFieldName(bankBranchSearchEntity.getSortBy(), BankBranchEntity.class); - } - - String orderBy = "order by name"; - if (bankBranchSearchEntity.getSortBy() != null && !bankBranchSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + bankBranchSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", BankBranchEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (bankBranchSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", bankBranchSearchEntity.getTenantId()); - } - if (bankBranchSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", bankBranchSearchEntity.getId()); - } - if (bankBranchSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(bankBranchSearchEntity.getIds().split(",")))); - } - if (bankBranchSearchEntity.getBankId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("bankId =:bank"); - paramValues.put("bank", bankBranchSearchEntity.getBankId()); - } - if (bankBranchSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", bankBranchSearchEntity.getCode()); - } - if (bankBranchSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", bankBranchSearchEntity.getName()); - } - if (bankBranchSearchEntity.getAddress() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("address =:address"); - paramValues.put("address", bankBranchSearchEntity.getAddress()); - } - if (bankBranchSearchEntity.getAddress2() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("address2 =:address2"); - paramValues.put("address2", bankBranchSearchEntity.getAddress2()); - } - if (bankBranchSearchEntity.getCity() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("city =:city"); - paramValues.put("city", bankBranchSearchEntity.getCity()); - } - if (bankBranchSearchEntity.getState() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("state =:state"); - paramValues.put("state", bankBranchSearchEntity.getState()); - } - if (bankBranchSearchEntity.getPincode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("pincode =:pincode"); - paramValues.put("pincode", bankBranchSearchEntity.getPincode()); - } - if (bankBranchSearchEntity.getPhone() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("phone =:phone"); - paramValues.put("phone", bankBranchSearchEntity.getPhone()); - } - if (bankBranchSearchEntity.getFax() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("fax =:fax"); - paramValues.put("fax", bankBranchSearchEntity.getFax()); - } - if (bankBranchSearchEntity.getContactPerson() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("contactPerson =:contactPerson"); - paramValues.put("contactPerson", bankBranchSearchEntity.getContactPerson()); - } - if (bankBranchSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", bankBranchSearchEntity.getActive()); - } - if (bankBranchSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", bankBranchSearchEntity.getDescription()); - } - if (bankBranchSearchEntity.getMicr() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("micr =:micr"); - paramValues.put("micr", bankBranchSearchEntity.getMicr()); - } - - Pagination page = new Pagination<>(); - if (bankBranchSearchEntity.getOffset() != null) { - page.setOffset(bankBranchSearchEntity.getOffset()); - } - if (bankBranchSearchEntity.getPageSize() != null) { - page.setPageSize(bankBranchSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(BankBranchEntity.class); - - List bankBranchEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(bankBranchEntities.size()); - - List bankbranches = new ArrayList<>(); - for (BankBranchEntity bankBranchEntity : bankBranchEntities) { - - bankbranches.add(bankBranchEntity.toDomain()); - } - page.setPagedData(bankbranches); - - return page; - } - - public BankBranchEntity findById(BankBranchEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List bankbranches = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(BankBranchEntity.class)); - if (bankbranches.isEmpty()) { - return null; - } else { - return bankbranches.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankJdbcRepository.java deleted file mode 100644 index e21611e2824..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BankJdbcRepository.java +++ /dev/null @@ -1,187 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.persistence.entity.BankEntity; -import org.egov.egf.master.persistence.entity.BankSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class BankJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(BankJdbcRepository.class); - - static { - LOG.debug("init bank"); - init(BankEntity.class); - LOG.debug("end init bank"); - } - - public BankJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public BankEntity create(BankEntity entity) { - super.create(entity); - return entity; - } - - public BankEntity update(BankEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(BankSearch domain) { - BankSearchEntity bankSearchEntity = new BankSearchEntity(); - bankSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (bankSearchEntity.getSortBy() != null && !bankSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(bankSearchEntity.getSortBy()); - validateEntityFieldName(bankSearchEntity.getSortBy(), BankEntity.class); - } - - String orderBy = "order by name"; - if (bankSearchEntity.getSortBy() != null && !bankSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + bankSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", BankEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (bankSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", bankSearchEntity.getTenantId()); - } - if (bankSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", bankSearchEntity.getId()); - } - if (bankSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(bankSearchEntity.getIds().split(",")))); - } - if (bankSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", bankSearchEntity.getCode()); - } - if (bankSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", bankSearchEntity.getName()); - } - if (bankSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", bankSearchEntity.getDescription()); - } - if (bankSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", bankSearchEntity.getActive()); - } - if (bankSearchEntity.getType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("type =:type"); - paramValues.put("type", bankSearchEntity.getType()); - } - - Pagination page = new Pagination<>(); - if (bankSearchEntity.getOffset() != null) { - page.setOffset(bankSearchEntity.getOffset()); - } - if (bankSearchEntity.getPageSize() != null) { - page.setPageSize(bankSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(BankEntity.class); - - List bankEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(bankEntities.size()); - - List banks = new ArrayList<>(); - for (BankEntity bankEntity : bankEntities) { - - banks.add(bankEntity.toDomain()); - } - page.setPagedData(banks); - - return page; - } - - public BankEntity findById(BankEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List banks = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(BankEntity.class)); - if (banks.isEmpty()) { - return null; - } else { - return banks.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BudgetGroupJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BudgetGroupJdbcRepository.java deleted file mode 100644 index e8029bb9296..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/BudgetGroupJdbcRepository.java +++ /dev/null @@ -1,211 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.BudgetGroup; -import org.egov.egf.master.domain.model.BudgetGroupSearch; -import org.egov.egf.master.persistence.entity.BudgetGroupEntity; -import org.egov.egf.master.persistence.entity.BudgetGroupSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class BudgetGroupJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(BudgetGroupJdbcRepository.class); - - static { - LOG.debug("init budgetGroup"); - init(BudgetGroupEntity.class); - LOG.debug("end init budgetGroup"); - } - - public BudgetGroupJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public BudgetGroupEntity create(BudgetGroupEntity entity) { - super.create(entity); - return entity; - } - - public BudgetGroupEntity update(BudgetGroupEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(BudgetGroupSearch domain) { - BudgetGroupSearchEntity budgetGroupSearchEntity = new BudgetGroupSearchEntity(); - budgetGroupSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (budgetGroupSearchEntity.getSortBy() != null && !budgetGroupSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(budgetGroupSearchEntity.getSortBy()); - validateEntityFieldName(budgetGroupSearchEntity.getSortBy(), BudgetGroupEntity.class); - } - - String orderBy = "order by name"; - if (budgetGroupSearchEntity.getSortBy() != null && !budgetGroupSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + budgetGroupSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", BudgetGroupEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (budgetGroupSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", budgetGroupSearchEntity.getTenantId()); - } - if (budgetGroupSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", budgetGroupSearchEntity.getId()); - } - if (budgetGroupSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(budgetGroupSearchEntity.getIds().split(",")))); - } - if (budgetGroupSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", budgetGroupSearchEntity.getName()); - } - if (budgetGroupSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", budgetGroupSearchEntity.getDescription()); - } - if (budgetGroupSearchEntity.getMajorCodeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("majorCode =:majorCode"); - paramValues.put("majorCode", budgetGroupSearchEntity.getMajorCodeId()); - } - if (budgetGroupSearchEntity.getMaxCodeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("maxCode =:maxCode"); - paramValues.put("maxCode", budgetGroupSearchEntity.getMaxCodeId()); - } - if (budgetGroupSearchEntity.getMinCodeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("minCode =:minCode"); - paramValues.put("minCode", budgetGroupSearchEntity.getMinCodeId()); - } - if (budgetGroupSearchEntity.getAccountType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("accountType =:accountType"); - paramValues.put("accountType", budgetGroupSearchEntity.getAccountType().toString()); - } - if (budgetGroupSearchEntity.getBudgetingType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("budgetingType =:budgetingType"); - paramValues.put("budgetingType", budgetGroupSearchEntity.getBudgetingType().toString()); - } - if (budgetGroupSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", budgetGroupSearchEntity.getActive()); - } - - Pagination page = new Pagination<>(); - if (budgetGroupSearchEntity.getOffset() != null) { - page.setOffset(budgetGroupSearchEntity.getOffset()); - } - if (budgetGroupSearchEntity.getPageSize() != null) { - page.setPageSize(budgetGroupSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(BudgetGroupEntity.class); - - List budgetGroupEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(budgetGroupEntities.size()); - - List budgetgroups = new ArrayList<>(); - for (BudgetGroupEntity budgetGroupEntity : budgetGroupEntities) { - - budgetgroups.add(budgetGroupEntity.toDomain()); - } - page.setPagedData(budgetgroups); - - return page; - } - - public BudgetGroupEntity findById(BudgetGroupEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List budgetgroups = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(BudgetGroupEntity.class)); - if (budgetgroups.isEmpty()) { - return null; - } else { - return budgetgroups.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/ChartOfAccountDetailJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/ChartOfAccountDetailJdbcRepository.java deleted file mode 100644 index 2310cc8e91f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/ChartOfAccountDetailJdbcRepository.java +++ /dev/null @@ -1,225 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.persistence.entity.ChartOfAccountDetailEntity; -import org.egov.egf.master.persistence.entity.ChartOfAccountDetailSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class ChartOfAccountDetailJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(ChartOfAccountDetailJdbcRepository.class); - - private final AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository; - - static { - LOG.debug("init chartOfAccountDetail"); - init(ChartOfAccountDetailEntity.class); - LOG.debug("end init chartOfAccountDetail"); - } - - public ChartOfAccountDetailJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, - AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - this.accountDetailTypeJdbcRepository = accountDetailTypeJdbcRepository; - } - - public ChartOfAccountDetailEntity create(ChartOfAccountDetailEntity entity) { - super.create(entity); - return entity; - } - - public ChartOfAccountDetailEntity update(ChartOfAccountDetailEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(ChartOfAccountDetailSearch domain) { - ChartOfAccountDetailSearchEntity chartOfAccountDetailSearchEntity = new ChartOfAccountDetailSearchEntity(); - chartOfAccountDetailSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (chartOfAccountDetailSearchEntity.getSortBy() != null - && !chartOfAccountDetailSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(chartOfAccountDetailSearchEntity.getSortBy()); - validateEntityFieldName(chartOfAccountDetailSearchEntity.getSortBy(), ChartOfAccountDetailEntity.class); - } - - String orderBy = "order by chartOfAccountId"; - if (chartOfAccountDetailSearchEntity.getSortBy() != null - && !chartOfAccountDetailSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + chartOfAccountDetailSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", ChartOfAccountDetailEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (chartOfAccountDetailSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", chartOfAccountDetailSearchEntity.getTenantId()); - } - if (chartOfAccountDetailSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", chartOfAccountDetailSearchEntity.getId()); - } - if (chartOfAccountDetailSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(chartOfAccountDetailSearchEntity.getIds().split(",")))); - } - - if (chartOfAccountDetailSearchEntity.getChartOfAccountIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("chartOfAccountId in(:chartOfAccountIds) "); - paramValues.put("chartOfAccountIds", - new ArrayList(Arrays.asList(chartOfAccountDetailSearchEntity.getChartOfAccountIds().split(",")))); - } - if (chartOfAccountDetailSearchEntity.getChartOfAccountId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("chartOfAccountId =:chartOfAccount"); - paramValues.put("chartOfAccount", chartOfAccountDetailSearchEntity.getChartOfAccountId()); - } - if (chartOfAccountDetailSearchEntity.getAccountDetailTypeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("accountDetailTypeId =:accountDetailType"); - paramValues.put("accountDetailType", chartOfAccountDetailSearchEntity.getAccountDetailTypeId()); - } - - Pagination page = new Pagination<>(); - if (chartOfAccountDetailSearchEntity.getOffset() != null) { - page.setOffset(chartOfAccountDetailSearchEntity.getOffset()); - } - if (chartOfAccountDetailSearchEntity.getPageSize() != null) { - page.setPageSize(chartOfAccountDetailSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(ChartOfAccountDetailEntity.class); - StringBuffer adtIds = new StringBuffer(); - - List chartOfAccountDetailEntities = namedParameterJdbcTemplate - .query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(chartOfAccountDetailEntities.size()); - - List chartofaccountdetails = new ArrayList<>(); - for (ChartOfAccountDetailEntity chartOfAccountDetailEntity : chartOfAccountDetailEntities) { - if (adtIds.length() >= 1) - adtIds.append(","); - - adtIds.append(chartOfAccountDetailEntity.getAccountDetailTypeId()); - chartofaccountdetails.add(chartOfAccountDetailEntity.toDomain()); - } - - populateAccountDetailTypes(chartofaccountdetails, adtIds.toString()); - - page.setPagedData(chartofaccountdetails); - - return page; - } - - private void populateAccountDetailTypes(List chartOfAccountDetails, String adtIds) { - Map adtMap = new HashMap<>(); - String tenantId = null; - AccountDetailTypeSearch search; - search = new AccountDetailTypeSearch(); - - if (chartOfAccountDetails != null && !chartOfAccountDetails.isEmpty()) - tenantId = chartOfAccountDetails.get(0).getTenantId(); - - search.setIds(adtIds); - search.setTenantId(tenantId); - - Pagination adts = accountDetailTypeJdbcRepository.search(search); - - if (adts != null && adts.getPagedData() != null && !adts.getPagedData().isEmpty()) { - - for (AccountDetailType adt : adts.getPagedData()) { - - adtMap.put(adt.getId(), adt); - - } - } - - for (ChartOfAccountDetail coad : chartOfAccountDetails) { - - if (adtMap.get(coad.getId()) != null) { - coad.setAccountDetailType(adtMap.get(coad.getAccountDetailType().getId())); - } - - } - - } - - public ChartOfAccountDetailEntity findById(ChartOfAccountDetailEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List chartofaccountdetails = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(ChartOfAccountDetailEntity.class)); - if (chartofaccountdetails.isEmpty()) { - return null; - } else { - return chartofaccountdetails.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/ChartOfAccountJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/ChartOfAccountJdbcRepository.java deleted file mode 100644 index 76d0f242d95..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/ChartOfAccountJdbcRepository.java +++ /dev/null @@ -1,315 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.persistence.entity.ChartOfAccountEntity; -import org.egov.egf.master.persistence.entity.ChartOfAccountSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class ChartOfAccountJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(ChartOfAccountJdbcRepository.class); - - private final ChartOfAccountDetailJdbcRepository chartOfAccountDetailJdbcRepository; - - static { - LOG.debug("init chartOfAccount"); - init(ChartOfAccountEntity.class); - LOG.debug("end init chartOfAccount"); - } - - public ChartOfAccountJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate, - ChartOfAccountDetailJdbcRepository chartOfAccountDetailJdbcRepository) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - this.chartOfAccountDetailJdbcRepository = chartOfAccountDetailJdbcRepository; - } - - public ChartOfAccountEntity create(ChartOfAccountEntity entity) { - super.create(entity); - return entity; - } - - public ChartOfAccountEntity update(ChartOfAccountEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(ChartOfAccountSearch domain) { - ChartOfAccountSearchEntity chartOfAccountSearchEntity = new ChartOfAccountSearchEntity(); - chartOfAccountSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (chartOfAccountSearchEntity.getSortBy() != null && !chartOfAccountSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(chartOfAccountSearchEntity.getSortBy()); - validateEntityFieldName(chartOfAccountSearchEntity.getSortBy(), ChartOfAccountEntity.class); - } - - String orderBy = "order by name"; - if (chartOfAccountSearchEntity.getSortBy() != null && !chartOfAccountSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + chartOfAccountSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", ChartOfAccountEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (chartOfAccountSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", chartOfAccountSearchEntity.getTenantId()); - } - if (chartOfAccountSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", chartOfAccountSearchEntity.getId()); - } - - if (chartOfAccountSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", - new ArrayList(Arrays.asList(chartOfAccountSearchEntity.getIds().split(",")))); - } - - if (chartOfAccountSearchEntity.getGlcode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("glcode like :glcode"); - paramValues.put("glcode", chartOfAccountSearchEntity.getGlcode()); - } - - if (chartOfAccountSearchEntity.getGlcodes() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("glcode in(:glcodes) "); - paramValues.put("glcodes", - new ArrayList(Arrays.asList(chartOfAccountSearchEntity.getGlcodes().split(",")))); - } - - if (chartOfAccountSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", chartOfAccountSearchEntity.getName()); - } - if (chartOfAccountSearchEntity.getAccountCodePurposeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("accountCodePurposeId =:accountCodePurpose"); - paramValues.put("accountCodePurpose", chartOfAccountSearchEntity.getAccountCodePurposeId()); - } - if (chartOfAccountSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", chartOfAccountSearchEntity.getDescription()); - } - if (chartOfAccountSearchEntity.getIsActiveForPosting() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("isActiveForPosting =:isActiveForPosting"); - paramValues.put("isActiveForPosting", chartOfAccountSearchEntity.getIsActiveForPosting()); - } - if (chartOfAccountSearchEntity.getParentId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("parentId =:parentId"); - paramValues.put("parentId", chartOfAccountSearchEntity.getParentId()); - } - if (chartOfAccountSearchEntity.getType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("type =:type"); - paramValues.put("type", chartOfAccountSearchEntity.getType()); - } - if (chartOfAccountSearchEntity.getClassification() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("classification =:classification"); - paramValues.put("classification", chartOfAccountSearchEntity.getClassification()); - } - if (chartOfAccountSearchEntity.getFunctionRequired() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("functionRequired =:functionRequired"); - paramValues.put("functionRequired", chartOfAccountSearchEntity.getFunctionRequired()); - } - if (chartOfAccountSearchEntity.getBudgetCheckRequired() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("budgetCheckRequired =:budgetCheckRequired"); - paramValues.put("budgetCheckRequired", chartOfAccountSearchEntity.getBudgetCheckRequired()); - } - if (chartOfAccountSearchEntity.getMajorCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("majorCode =:majorCode"); - paramValues.put("majorCode", chartOfAccountSearchEntity.getMajorCode()); - } - if (chartOfAccountSearchEntity.getIsSubLedger() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("isSubLedger =:isSubLedger"); - paramValues.put("isSubLedger", chartOfAccountSearchEntity.getIsSubLedger()); - } - - Pagination page = new Pagination<>(); - if (chartOfAccountSearchEntity.getOffset() != null) { - page.setOffset(chartOfAccountSearchEntity.getOffset()); - } - if (chartOfAccountSearchEntity.getPageSize() != null) { - page.setPageSize(chartOfAccountSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(ChartOfAccountEntity.class); - - List chartOfAccountEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(chartOfAccountEntities.size()); - - List chartofaccounts = new ArrayList<>(); - StringBuffer coaIds = new StringBuffer(); - - for (ChartOfAccountEntity chartOfAccountEntity : chartOfAccountEntities) { - - if (coaIds.length() >= 1) - coaIds.append(","); - - coaIds.append(chartOfAccountEntity.getId()); - - chartofaccounts.add(chartOfAccountEntity.toDomain()); - } - if (chartofaccounts != null && !chartofaccounts.isEmpty()) { - - populateIsSubLedger(chartofaccounts, coaIds.toString()); - } - page.setPagedData(chartofaccounts); - - return page; - } - - private void populateIsSubLedger(List chartofaccounts, String coaIds) { - Map> coaDetailsMap = new HashMap<>(); - String tenantId = null; - ChartOfAccountDetailSearch search; - search = new ChartOfAccountDetailSearch(); - - if (chartofaccounts != null && !chartofaccounts.isEmpty()) - tenantId = chartofaccounts.get(0).getTenantId(); - - search.setChartOfAccountIds(coaIds); - search.setTenantId(tenantId); - - Pagination coaDetails = chartOfAccountDetailJdbcRepository.search(search); - - if (coaDetails != null && coaDetails.getPagedData() != null && !coaDetails.getPagedData().isEmpty()) { - - for (ChartOfAccountDetail coad : coaDetails.getPagedData()) { - - if (coaDetailsMap.get(coad.getChartOfAccount().getId()) == null) { - - coaDetailsMap.put(coad.getChartOfAccount().getId(), Collections.singletonList(coad)); - - } else { - - List coadList = new ArrayList<>(coaDetailsMap.get(coad.getChartOfAccount().getId())); - - coadList.add(coad); - - coaDetailsMap.put(coad.getChartOfAccount().getId(), coadList); - - } - } - } - - for (ChartOfAccount coa : chartofaccounts) { - - if (coaDetailsMap.get(coa.getId()) != null) { - coa.setChartOfAccountDetails(coaDetailsMap.get(coa.getId())); - coa.setIsSubLedger(true); - } else { - coa.setIsSubLedger(false); - } - - } - - } - - public ChartOfAccountEntity findById(ChartOfAccountEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List chartofaccounts = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(ChartOfAccountEntity.class)); - if (chartofaccounts.isEmpty()) { - return null; - } else { - return chartofaccounts.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialConfigurationJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialConfigurationJdbcRepository.java deleted file mode 100644 index 151e6251199..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialConfigurationJdbcRepository.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.FinancialConfiguration; -import org.egov.egf.master.domain.model.FinancialConfigurationSearch; -import org.egov.egf.master.persistence.entity.FinancialConfigurationEntity; -import org.egov.egf.master.persistence.entity.FinancialConfigurationSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -import java.util.*; - -@Service -public class FinancialConfigurationJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FinancialConfigurationJdbcRepository.class); - - static { - LOG.debug("init financialConfiguration"); - init(FinancialConfigurationEntity.class); - LOG.debug("end init financialConfiguration"); - } - - public FinancialConfigurationJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FinancialConfigurationEntity create(FinancialConfigurationEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public FinancialConfigurationEntity update(FinancialConfigurationEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(FinancialConfigurationSearch domain) { - FinancialConfigurationSearchEntity financialConfigurationSearchEntity = new FinancialConfigurationSearchEntity(); - financialConfigurationSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (financialConfigurationSearchEntity.getSortBy() != null - && !financialConfigurationSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(financialConfigurationSearchEntity.getSortBy()); - validateEntityFieldName(financialConfigurationSearchEntity.getSortBy(), FinancialConfigurationEntity.class); - } - - String orderBy = "order by name"; - if (financialConfigurationSearchEntity.getSortBy() != null - && !financialConfigurationSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + financialConfigurationSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FinancialConfigurationEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (financialConfigurationSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", financialConfigurationSearchEntity.getTenantId()); - } - if (financialConfigurationSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", financialConfigurationSearchEntity.getId()); - } - if (financialConfigurationSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(financialConfigurationSearchEntity.getIds().split(",")))); - } - if (financialConfigurationSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", financialConfigurationSearchEntity.getName()); - } - if (financialConfigurationSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", financialConfigurationSearchEntity.getDescription()); - } - - if (financialConfigurationSearchEntity.getModule() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("module =:module"); - paramValues.put("module", financialConfigurationSearchEntity.getModule()); - } - - Pagination page = new Pagination<>(); - if (financialConfigurationSearchEntity.getOffset() != null) { - page.setOffset(financialConfigurationSearchEntity.getOffset()); - } - if (financialConfigurationSearchEntity.getPageSize() != null) { - page.setPageSize(financialConfigurationSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FinancialConfigurationEntity.class); - - List financialConfigurationEntities = namedParameterJdbcTemplate - .query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(financialConfigurationEntities.size()); - - List financialconfigurations = new ArrayList<>(); - for (FinancialConfigurationEntity financialConfigurationEntity : financialConfigurationEntities) { - - financialconfigurations.add(financialConfigurationEntity.toDomain()); - } - page.setPagedData(financialconfigurations); - - return page; - } - - public FinancialConfigurationEntity findById(FinancialConfigurationEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List financialconfigurations = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FinancialConfigurationEntity.class)); - if (financialconfigurations.isEmpty()) { - return null; - } else { - return financialconfigurations.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialConfigurationValueJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialConfigurationValueJdbcRepository.java deleted file mode 100644 index 7ef81ff117f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialConfigurationValueJdbcRepository.java +++ /dev/null @@ -1,173 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.FinancialConfigurationValue; -import org.egov.egf.master.domain.model.FinancialConfigurationValueSearch; -import org.egov.egf.master.persistence.entity.FinancialConfigurationValueEntity; -import org.egov.egf.master.persistence.entity.FinancialConfigurationValueSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class FinancialConfigurationValueJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FinancialConfigurationValueJdbcRepository.class); - - static { - LOG.debug("init financialConfigurationValue"); - init(FinancialConfigurationValueEntity.class); - LOG.debug("end init financialConfigurationValue"); - } - - public FinancialConfigurationValueJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FinancialConfigurationValueEntity create(FinancialConfigurationValueEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public FinancialConfigurationValueEntity update(FinancialConfigurationValueEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(FinancialConfigurationValueSearch domain) { - FinancialConfigurationValueSearchEntity financialConfigurationValueSearchEntity = new FinancialConfigurationValueSearchEntity(); - financialConfigurationValueSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (financialConfigurationValueSearchEntity.getSortBy() != null - && !financialConfigurationValueSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(financialConfigurationValueSearchEntity.getSortBy()); - validateEntityFieldName(financialConfigurationValueSearchEntity.getSortBy(), - FinancialConfigurationValueEntity.class); - } - - String orderBy = "order by id"; - if (financialConfigurationValueSearchEntity.getSortBy() != null - && !financialConfigurationValueSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + financialConfigurationValueSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FinancialConfigurationValueEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (financialConfigurationValueSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", financialConfigurationValueSearchEntity.getTenantId()); - } - if (financialConfigurationValueSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", financialConfigurationValueSearchEntity.getId()); - } - if (financialConfigurationValueSearchEntity.getFinancialConfigurationId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("financialConfigurationId =:financialConfiguration"); - paramValues.put("financialConfiguration", - financialConfigurationValueSearchEntity.getFinancialConfigurationId()); - } - if (financialConfigurationValueSearchEntity.getValue() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("value =:value"); - paramValues.put("value", financialConfigurationValueSearchEntity.getValue()); - } - if (financialConfigurationValueSearchEntity.getEffectiveFrom() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("effectiveFrom =:effectiveFrom"); - paramValues.put("effectiveFrom", financialConfigurationValueSearchEntity.getEffectiveFrom()); - } - - Pagination page = new Pagination<>(); - if (financialConfigurationValueSearchEntity.getOffset() != null) { - page.setOffset(financialConfigurationValueSearchEntity.getOffset()); - } - if (financialConfigurationValueSearchEntity.getPageSize() != null) { - page.setPageSize(financialConfigurationValueSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FinancialConfigurationValueEntity.class); - - List financialConfigurationValueEntities = namedParameterJdbcTemplate - .query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(financialConfigurationValueEntities.size()); - - List financialconfigurationvalues = new ArrayList<>(); - for (FinancialConfigurationValueEntity financialConfigurationValueEntity : financialConfigurationValueEntities) { - - financialconfigurationvalues.add(financialConfigurationValueEntity.toDomain()); - } - page.setPagedData(financialconfigurationvalues); - - return page; - - } - - public FinancialConfigurationValueEntity findById(FinancialConfigurationValueEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List financialconfigurationvalues = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FinancialConfigurationValueEntity.class)); - if (financialconfigurationvalues.isEmpty()) { - return null; - } else { - return financialconfigurationvalues.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialStatusJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialStatusJdbcRepository.java deleted file mode 100644 index 1d57e496524..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialStatusJdbcRepository.java +++ /dev/null @@ -1,179 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.FinancialStatus; -import org.egov.egf.master.domain.model.FinancialStatusSearch; -import org.egov.egf.master.persistence.entity.FinancialStatusEntity; -import org.egov.egf.master.persistence.entity.FinancialStatusSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class FinancialStatusJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FinancialStatusJdbcRepository.class); - - static { - LOG.debug("init financialStatus"); - init(FinancialStatusEntity.class); - LOG.debug("end init financialStatus"); - } - - public FinancialStatusJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FinancialStatusEntity create(FinancialStatusEntity entity) { - - entity.setId(UUID.randomUUID().toString().replace("-", "")); - super.create(entity); - return entity; - } - - public FinancialStatusEntity update(FinancialStatusEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(FinancialStatusSearch domain) { - FinancialStatusSearchEntity financialStatusSearchEntity = new FinancialStatusSearchEntity(); - financialStatusSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (financialStatusSearchEntity.getSortBy() != null && !financialStatusSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(financialStatusSearchEntity.getSortBy()); - validateEntityFieldName(financialStatusSearchEntity.getSortBy(), FinancialStatusEntity.class); - } - - String orderBy = "order by name"; - if (financialStatusSearchEntity.getSortBy() != null && !financialStatusSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + financialStatusSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FinancialStatusEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (financialStatusSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", financialStatusSearchEntity.getTenantId()); - } - if (financialStatusSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", financialStatusSearchEntity.getId()); - } - if (financialStatusSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(financialStatusSearchEntity.getIds().split(",")))); - } - if (financialStatusSearchEntity.getModuleType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("moduleType =:moduleType"); - paramValues.put("moduleType", financialStatusSearchEntity.getModuleType()); - } - if (financialStatusSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", financialStatusSearchEntity.getCode()); - } - if (financialStatusSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", financialStatusSearchEntity.getDescription()); - } - - Pagination page = new Pagination<>(); - if (financialStatusSearchEntity.getOffset() != null) { - page.setOffset(financialStatusSearchEntity.getOffset()); - } - if (financialStatusSearchEntity.getPageSize() != null) { - page.setPageSize(financialStatusSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FinancialStatusEntity.class); - - List financialStatusEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(financialStatusEntities.size()); - - List financialstatuses = new ArrayList<>(); - for (FinancialStatusEntity financialStatusEntity : financialStatusEntities) { - - financialstatuses.add(financialStatusEntity.toDomain()); - } - page.setPagedData(financialstatuses); - - return page; - } - - public FinancialStatusEntity findById(FinancialStatusEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List financialstatuses = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FinancialStatusEntity.class)); - if (financialstatuses.isEmpty()) { - return null; - } else { - return financialstatuses.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialYearJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialYearJdbcRepository.java deleted file mode 100644 index cd772904798..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FinancialYearJdbcRepository.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.domain.model.FinancialYearSearch; -import org.egov.egf.master.persistence.entity.FinancialYearEntity; -import org.egov.egf.master.persistence.entity.FinancialYearSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.stereotype.Service; - -@Service -public class FinancialYearJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FinancialYearJdbcRepository.class); - - static { - LOG.debug("init financialYear"); - init(FinancialYearEntity.class); - LOG.debug("end init financialYear"); - } - - public FinancialYearEntity create(FinancialYearEntity entity) { - super.create(entity); - return entity; - } - - public FinancialYearEntity update(FinancialYearEntity entity) { - super.update(entity); - return entity; - } - - public Pagination search(FinancialYearSearch domain) { - FinancialYearSearchEntity financialYearSearchEntity = new FinancialYearSearchEntity(); - financialYearSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - searchQuery = searchQuery.replace(":tablename", FinancialYearEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - if (financialYearSearchEntity.getSortBy() != null && !financialYearSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(financialYearSearchEntity.getSortBy()); - validateEntityFieldName(financialYearSearchEntity.getSortBy(), FinancialYearEntity.class); - } - - String orderBy = "order by finYearRange asc"; - if (financialYearSearchEntity.getSortBy() != null && !financialYearSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + financialYearSearchEntity.getSortBy(); - } - - // implement jdbc specfic search - if (financialYearSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", financialYearSearchEntity.getTenantId()); - } - if (financialYearSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", financialYearSearchEntity.getId()); - } - if (financialYearSearchEntity.getFinYearRange() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("finYearRange =:finYearRange"); - paramValues.put("finYearRange", financialYearSearchEntity.getFinYearRange()); - } - if (financialYearSearchEntity.getStartingDate() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("startingDate =:startingDate"); - paramValues.put("startingDate", financialYearSearchEntity.getStartingDate()); - } - if (financialYearSearchEntity.getEndingDate() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("endingDate =:endingDate"); - paramValues.put("endingDate", financialYearSearchEntity.getEndingDate()); - } - if (financialYearSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", financialYearSearchEntity.getActive()); - } - if (financialYearSearchEntity.getIsActiveForPosting() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("isActiveForPosting =:isActiveForPosting"); - paramValues.put("isActiveForPosting", financialYearSearchEntity.getIsActiveForPosting()); - } - if (financialYearSearchEntity.getIsClosed() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("isClosed =:isClosed"); - paramValues.put("isClosed", financialYearSearchEntity.getIsClosed()); - } - if (financialYearSearchEntity.getTransferClosingBalance() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("transferClosingBalance =:transferClosingBalance"); - paramValues.put("transferClosingBalance", financialYearSearchEntity.getTransferClosingBalance()); - } - if (financialYearSearchEntity.getAsOnDate() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("startingDate <=:asOnDate and endingDate >= :asOnDate"); - paramValues.put("asOnDate", financialYearSearchEntity.getAsOnDate()); - } - - Pagination page = new Pagination<>(); - if (financialYearSearchEntity.getOffset() != null) { - page.setOffset(financialYearSearchEntity.getOffset()); - } - if (financialYearSearchEntity.getPageSize() != null) { - page.setPageSize(financialYearSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else { - searchQuery = searchQuery.replace(":condition", ""); - } - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FinancialYearEntity.class); - - List financialYearEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(financialYearEntities.size()); - - List financialyears = new ArrayList<>(); - for (FinancialYearEntity financialYearEntity : financialYearEntities) { - - financialyears.add(financialYearEntity.toDomain()); - } - page.setPagedData(financialyears); - - return page; - } - - public FinancialYearEntity findById(FinancialYearEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List financialyears = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FinancialYearEntity.class)); - if (financialyears.isEmpty()) { - return null; - } else { - return financialyears.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FiscalPeriodJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FiscalPeriodJdbcRepository.java deleted file mode 100644 index 4b0e86b2835..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FiscalPeriodJdbcRepository.java +++ /dev/null @@ -1,204 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.FiscalPeriod; -import org.egov.egf.master.domain.model.FiscalPeriodSearch; -import org.egov.egf.master.persistence.entity.FiscalPeriodEntity; -import org.egov.egf.master.persistence.entity.FiscalPeriodSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class FiscalPeriodJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FiscalPeriodJdbcRepository.class); - - static { - LOG.debug("init fiscalPeriod"); - init(FiscalPeriodEntity.class); - LOG.debug("end init fiscalPeriod"); - } - - public FiscalPeriodJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FiscalPeriodEntity create(FiscalPeriodEntity entity) { - super.create(entity); - return entity; - } - - public FiscalPeriodEntity update(FiscalPeriodEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(FiscalPeriodSearch domain) { - FiscalPeriodSearchEntity fiscalPeriodSearchEntity = new FiscalPeriodSearchEntity(); - fiscalPeriodSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (fiscalPeriodSearchEntity.getSortBy() != null && !fiscalPeriodSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(fiscalPeriodSearchEntity.getSortBy()); - validateEntityFieldName(fiscalPeriodSearchEntity.getSortBy(), FiscalPeriodEntity.class); - } - - String orderBy = "order by name"; - if (fiscalPeriodSearchEntity.getSortBy() != null && !fiscalPeriodSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + fiscalPeriodSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FiscalPeriodEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (fiscalPeriodSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", fiscalPeriodSearchEntity.getTenantId()); - } - if (fiscalPeriodSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", fiscalPeriodSearchEntity.getId()); - } - if (fiscalPeriodSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(fiscalPeriodSearchEntity.getIds().split(",")))); - } - if (fiscalPeriodSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", fiscalPeriodSearchEntity.getName()); - } - if (fiscalPeriodSearchEntity.getFinancialYearId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("financialYearId =:financialYear"); - paramValues.put("financialYear", fiscalPeriodSearchEntity.getFinancialYearId()); - } - if (fiscalPeriodSearchEntity.getStartingDate() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("startingDate =:startingDate"); - paramValues.put("startingDate", fiscalPeriodSearchEntity.getStartingDate()); - } - if (fiscalPeriodSearchEntity.getEndingDate() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("endingDate =:endingDate"); - paramValues.put("endingDate", fiscalPeriodSearchEntity.getEndingDate()); - } - if (fiscalPeriodSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", fiscalPeriodSearchEntity.getActive()); - } - if (fiscalPeriodSearchEntity.getIsActiveForPosting() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("isActiveForPosting =:isActiveForPosting"); - paramValues.put("isActiveForPosting", fiscalPeriodSearchEntity.getIsActiveForPosting()); - } - if (fiscalPeriodSearchEntity.getIsClosed() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("isClosed =:isClosed"); - paramValues.put("isClosed", fiscalPeriodSearchEntity.getIsClosed()); - } - - Pagination page = new Pagination<>(); - if (fiscalPeriodSearchEntity.getOffset() != null) { - page.setOffset(fiscalPeriodSearchEntity.getOffset()); - } - if (fiscalPeriodSearchEntity.getPageSize() != null) { - page.setPageSize(fiscalPeriodSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FiscalPeriodEntity.class); - - List fiscalPeriodEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(fiscalPeriodEntities.size()); - - List fiscalperiods = new ArrayList<>(); - for (FiscalPeriodEntity fiscalPeriodEntity : fiscalPeriodEntities) { - - fiscalperiods.add(fiscalPeriodEntity.toDomain()); - } - page.setPagedData(fiscalperiods); - - return page; - } - - public FiscalPeriodEntity findById(FiscalPeriodEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List fiscalperiods = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FiscalPeriodEntity.class)); - if (fiscalperiods.isEmpty()) { - return null; - } else { - return fiscalperiods.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FunctionJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FunctionJdbcRepository.java deleted file mode 100644 index 50a09db3031..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FunctionJdbcRepository.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.persistence.entity.FunctionEntity; -import org.egov.egf.master.persistence.entity.FunctionSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class FunctionJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FunctionJdbcRepository.class); - - static { - LOG.debug("init function"); - init(FunctionEntity.class); - LOG.debug("end init function"); - } - - public FunctionJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FunctionEntity create(FunctionEntity entity) { - super.create(entity); - return entity; - } - - public FunctionEntity update(FunctionEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(FunctionSearch domain) { - FunctionSearchEntity functionSearchEntity = new FunctionSearchEntity(); - functionSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (functionSearchEntity.getSortBy() != null && !functionSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(functionSearchEntity.getSortBy()); - validateEntityFieldName(functionSearchEntity.getSortBy(), FunctionEntity.class); - } - - String orderBy = "order by name"; - if (functionSearchEntity.getSortBy() != null && !functionSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + functionSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FunctionEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (functionSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", functionSearchEntity.getTenantId()); - } - if (functionSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", functionSearchEntity.getId()); - } - if (functionSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(functionSearchEntity.getIds().split(",")))); - } - if (functionSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", functionSearchEntity.getName()); - } - if (functionSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", functionSearchEntity.getCode()); - } - if (functionSearchEntity.getLevel() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("level =:level"); - paramValues.put("level", functionSearchEntity.getLevel()); - } - if (functionSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", functionSearchEntity.getActive()); - } - if (functionSearchEntity.getParentId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("parentId =:parentId"); - paramValues.put("parentId", functionSearchEntity.getParentId()); - } - - Pagination page = new Pagination<>(); - if (functionSearchEntity.getOffset() != null) { - page.setOffset(functionSearchEntity.getOffset()); - } - if (functionSearchEntity.getPageSize() != null) { - page.setPageSize(functionSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FunctionEntity.class); - - List functionEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), paramValues, - row); - - page.setTotalResults(functionEntities.size()); - - List functions = new ArrayList<>(); - for (FunctionEntity functionEntity : functionEntities) { - - functions.add(functionEntity.toDomain()); - } - page.setPagedData(functions); - - return page; - } - - public FunctionEntity findById(FunctionEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List functions = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FunctionEntity.class)); - if (functions.isEmpty()) { - return null; - } else { - return functions.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FunctionaryJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FunctionaryJdbcRepository.java deleted file mode 100644 index 93cda70839c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FunctionaryJdbcRepository.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Functionary; -import org.egov.egf.master.domain.model.FunctionarySearch; -import org.egov.egf.master.persistence.entity.FunctionaryEntity; -import org.egov.egf.master.persistence.entity.FunctionarySearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class FunctionaryJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FunctionaryJdbcRepository.class); - - static { - LOG.debug("init functionary"); - init(FunctionaryEntity.class); - LOG.debug("end init functionary"); - } - - public FunctionaryJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FunctionaryEntity create(FunctionaryEntity entity) { - super.create(entity); - return entity; - } - - public FunctionaryEntity update(FunctionaryEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(FunctionarySearch domain) { - FunctionarySearchEntity functionarySearchEntity = new FunctionarySearchEntity(); - functionarySearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (functionarySearchEntity.getSortBy() != null && !functionarySearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(functionarySearchEntity.getSortBy()); - validateEntityFieldName(functionarySearchEntity.getSortBy(), FunctionaryEntity.class); - } - - String orderBy = "order by name"; - if (functionarySearchEntity.getSortBy() != null && !functionarySearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + functionarySearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FunctionaryEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (functionarySearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", functionarySearchEntity.getTenantId()); - } - if (functionarySearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", functionarySearchEntity.getId()); - } - if (functionarySearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(functionarySearchEntity.getIds().split(",")))); - } - if (functionarySearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", functionarySearchEntity.getCode()); - } - if (functionarySearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", functionarySearchEntity.getName()); - } - if (functionarySearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", functionarySearchEntity.getActive()); - } - - Pagination page = new Pagination<>(); - if (functionarySearchEntity.getOffset() != null) { - page.setOffset(functionarySearchEntity.getOffset()); - } - if (functionarySearchEntity.getPageSize() != null) { - page.setPageSize(functionarySearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FunctionaryEntity.class); - - List functionaryEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(functionaryEntities.size()); - - List functionaries = new ArrayList<>(); - for (FunctionaryEntity functionaryEntity : functionaryEntities) { - - functionaries.add(functionaryEntity.toDomain()); - } - page.setPagedData(functionaries); - - return page; - } - - public FunctionaryEntity findById(FunctionaryEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List functionaries = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FunctionaryEntity.class)); - if (functionaries.isEmpty()) { - return null; - } else { - return functionaries.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FundJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FundJdbcRepository.java deleted file mode 100644 index bc1333d168d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FundJdbcRepository.java +++ /dev/null @@ -1,184 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.persistence.entity.FundEntity; -import org.egov.egf.master.persistence.entity.FundSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class FundJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FundJdbcRepository.class); - - static { - LOG.debug("init fund"); - init(FundEntity.class); - LOG.debug("end init fund"); - } - - public FundJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FundEntity create(FundEntity entity) { - super.create(entity); - return entity; - } - - public FundEntity update(FundEntity entity) { - super.update(entity); - return entity; - - } - public boolean delete(FundEntity entity,String reason) { - super.delete(entity, reason); - return true; - - } - - public Pagination search(FundSearch domain) { - FundSearchEntity fundSearchEntity = new FundSearchEntity(); - fundSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (fundSearchEntity.getSortBy() != null && !fundSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(fundSearchEntity.getSortBy()); - validateEntityFieldName(fundSearchEntity.getSortBy(), FundEntity.class); - } - - String orderBy = "order by name"; - if (fundSearchEntity.getSortBy() != null && !fundSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + fundSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FundEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (fundSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", fundSearchEntity.getTenantId()); - } - if (fundSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", fundSearchEntity.getId()); - } - if (fundSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", fundSearchEntity.getCode()); - } - if (fundSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", fundSearchEntity.getName()); - } - if (fundSearchEntity.getIdentifier() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", fundSearchEntity.getIdentifier()); - } - if (fundSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", fundSearchEntity.getActive()); - } - if (fundSearchEntity.getLevel() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("type =:type"); - paramValues.put("type", fundSearchEntity.getLevel()); - } - - Pagination page = new Pagination<>(); - if (fundSearchEntity.getOffset() != null) { - page.setOffset(fundSearchEntity.getOffset()); - } - if (fundSearchEntity.getPageSize() != null) { - page.setPageSize(fundSearchEntity.getPageSize()); - } - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FundEntity.class); - - List fundEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(fundEntities.size()); - - List funds = new ArrayList<>(); - for (FundEntity fundEntity : fundEntities) { - - funds.add(fundEntity.toDomain()); - } - page.setPagedData(funds); - - return page; - } - - public FundEntity findById(FundEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List funds = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FundEntity.class)); - if (funds.isEmpty()) { - return null; - } else { - return funds.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FundsourceJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FundsourceJdbcRepository.java deleted file mode 100644 index aceb5788bf2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/FundsourceJdbcRepository.java +++ /dev/null @@ -1,204 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Fundsource; -import org.egov.egf.master.domain.model.FundsourceSearch; -import org.egov.egf.master.persistence.entity.FundsourceEntity; -import org.egov.egf.master.persistence.entity.FundsourceSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class FundsourceJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(FundsourceJdbcRepository.class); - - static { - LOG.debug("init fundsource"); - init(FundsourceEntity.class); - LOG.debug("end init fundsource"); - } - - public FundsourceJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public FundsourceEntity create(FundsourceEntity entity) { - super.create(entity); - return entity; - } - - public FundsourceEntity update(FundsourceEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(FundsourceSearch domain) { - FundsourceSearchEntity fundsourceSearchEntity = new FundsourceSearchEntity(); - fundsourceSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (fundsourceSearchEntity.getSortBy() != null && !fundsourceSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(fundsourceSearchEntity.getSortBy()); - validateEntityFieldName(fundsourceSearchEntity.getSortBy(), FundsourceEntity.class); - } - - String orderBy = "order by name"; - if (fundsourceSearchEntity.getSortBy() != null && !fundsourceSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + fundsourceSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", FundsourceEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (fundsourceSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", fundsourceSearchEntity.getTenantId()); - } - if (fundsourceSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", fundsourceSearchEntity.getId()); - } - if (fundsourceSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(fundsourceSearchEntity.getIds().split(",")))); - } - if (fundsourceSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", fundsourceSearchEntity.getCode()); - } - if (fundsourceSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", fundsourceSearchEntity.getName()); - } - if (fundsourceSearchEntity.getType() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("type =:type"); - paramValues.put("type", fundsourceSearchEntity.getType()); - } - if (fundsourceSearchEntity.getParentId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("parentId =:fundSource"); - paramValues.put("fundSource", fundsourceSearchEntity.getParentId()); - } - if (fundsourceSearchEntity.getLlevel() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("llevel =:llevel"); - paramValues.put("llevel", fundsourceSearchEntity.getLlevel()); - } - if (fundsourceSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", fundsourceSearchEntity.getActive()); - } - if (fundsourceSearchEntity.getIsParent() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("isParent =:isParent"); - paramValues.put("isParent", fundsourceSearchEntity.getIsParent()); - } - - Pagination page = new Pagination<>(); - if (fundsourceSearchEntity.getOffset() != null) { - page.setOffset(fundsourceSearchEntity.getOffset()); - } - if (fundsourceSearchEntity.getPageSize() != null) { - page.setPageSize(fundsourceSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(FundsourceEntity.class); - - List fundsourceEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), - paramValues, row); - - page.setTotalResults(fundsourceEntities.size()); - - List fundsources = new ArrayList<>(); - for (FundsourceEntity fundsourceEntity : fundsourceEntities) { - - fundsources.add(fundsourceEntity.toDomain()); - } - page.setPagedData(fundsources); - - return page; - } - - public FundsourceEntity findById(FundsourceEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List fundsources = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(FundsourceEntity.class)); - if (fundsources.isEmpty()) { - return null; - } else { - return fundsources.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/RecoveryJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/RecoveryJdbcRepository.java deleted file mode 100644 index fc04e1fe51b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/RecoveryJdbcRepository.java +++ /dev/null @@ -1,168 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.persistence.entity.FundEntity; -import org.egov.egf.master.persistence.entity.RecoveryEntity; -import org.egov.egf.master.persistence.entity.RecoverySearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Repository -public class RecoveryJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(RecoveryJdbcRepository.class); - - static { - LOG.debug("init recovery"); - init(RecoveryEntity.class); - LOG.debug("end init recovery"); - } - - public RecoveryJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public RecoveryEntity create(RecoveryEntity entity) { - super.create(entity); - return entity; - } - - public RecoveryEntity update(RecoveryEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(RecoverySearch domain) { - RecoverySearchEntity recoverySearchEntity = new RecoverySearchEntity(); - recoverySearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (recoverySearchEntity.getSortBy() != null && !recoverySearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(recoverySearchEntity.getSortBy()); - validateEntityFieldName(recoverySearchEntity.getSortBy(), RecoveryEntity.class); - } - - String orderBy = "order by name"; - if (recoverySearchEntity.getSortBy() != null && !recoverySearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + recoverySearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", RecoveryEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (recoverySearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", recoverySearchEntity.getTenantId()); - } - if (recoverySearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", recoverySearchEntity.getId()); - } - if (recoverySearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", recoverySearchEntity.getCode()); - } - if (recoverySearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", recoverySearchEntity.getName()); - } - if (recoverySearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", recoverySearchEntity.getActive()); - } - - Pagination page = new Pagination<>(); - if (recoverySearchEntity.getOffset() != null) { - page.setOffset(recoverySearchEntity.getOffset()); - } - if (recoverySearchEntity.getPageSize() != null) { - page.setPageSize(recoverySearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(RecoveryEntity.class); - - List recoveryEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(recoveryEntities.size()); - - List recoveries = new ArrayList<>(); - for (RecoveryEntity recoveryEntity : recoveryEntities) { - - recoveries.add(recoveryEntity.toDomain()); - } - page.setPagedData(recoveries); - - return page; - } - - public RecoveryEntity findById(RecoveryEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List recovery = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(RecoveryEntity.class)); - if (recovery.isEmpty()) { - return null; - } else { - return recovery.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SchemeJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SchemeJdbcRepository.java deleted file mode 100644 index cd4b5f44938..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SchemeJdbcRepository.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.domain.model.SchemeSearch; -import org.egov.egf.master.persistence.entity.SchemeEntity; -import org.egov.egf.master.persistence.entity.SchemeSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class SchemeJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(SchemeJdbcRepository.class); - - static { - LOG.debug("init scheme"); - init(SchemeEntity.class); - LOG.debug("end init scheme"); - } - - public SchemeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public SchemeEntity create(SchemeEntity entity) { - super.create(entity); - return entity; - } - - public SchemeEntity update(SchemeEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(SchemeSearch domain) { - SchemeSearchEntity schemeSearchEntity = new SchemeSearchEntity(); - schemeSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (schemeSearchEntity.getSortBy() != null && !schemeSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(schemeSearchEntity.getSortBy()); - validateEntityFieldName(schemeSearchEntity.getSortBy(), SchemeEntity.class); - } - - String orderBy = "order by name"; - if (schemeSearchEntity.getSortBy() != null && !schemeSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + schemeSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", SchemeEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (schemeSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", schemeSearchEntity.getTenantId()); - } - if (schemeSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", schemeSearchEntity.getId()); - } - if (schemeSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(schemeSearchEntity.getIds().split(",")))); - } - if (schemeSearchEntity.getFundId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("fundId =:fund"); - paramValues.put("fund", schemeSearchEntity.getFundId()); - } - if (schemeSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", schemeSearchEntity.getCode()); - } - if (schemeSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", schemeSearchEntity.getName()); - } - if (schemeSearchEntity.getValidFrom() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("validFrom =:validFrom"); - paramValues.put("validFrom", schemeSearchEntity.getValidFrom()); - } - if (schemeSearchEntity.getValidTo() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("validTo =:validTo"); - paramValues.put("validTo", schemeSearchEntity.getValidTo()); - } - if (schemeSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", schemeSearchEntity.getActive()); - } - if (schemeSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", schemeSearchEntity.getDescription()); - } - if (schemeSearchEntity.getBoundary() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("boundary =:boundary"); - paramValues.put("boundary", schemeSearchEntity.getBoundary()); - } - - Pagination page = new Pagination<>(); - if (schemeSearchEntity.getOffset() != null) { - page.setOffset(schemeSearchEntity.getOffset()); - } - if (schemeSearchEntity.getPageSize() != null) { - page.setPageSize(schemeSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(SchemeEntity.class); - - List schemeEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), paramValues, row); - - page.setTotalResults(schemeEntities.size()); - - List schemes = new ArrayList<>(); - for (SchemeEntity schemeEntity : schemeEntities) { - - schemes.add(schemeEntity.toDomain()); - } - page.setPagedData(schemes); - - return page; - } - - public SchemeEntity findById(SchemeEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List schemes = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(SchemeEntity.class)); - if (schemes.isEmpty()) { - return null; - } else { - return schemes.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SubSchemeJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SubSchemeJdbcRepository.java deleted file mode 100644 index a081da73889..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SubSchemeJdbcRepository.java +++ /dev/null @@ -1,204 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.SubScheme; -import org.egov.egf.master.domain.model.SubSchemeSearch; -import org.egov.egf.master.persistence.entity.SubSchemeEntity; -import org.egov.egf.master.persistence.entity.SubSchemeSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class SubSchemeJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(SubSchemeJdbcRepository.class); - - static { - LOG.debug("init subScheme"); - init(SubSchemeEntity.class); - LOG.debug("end init subScheme"); - } - - public SubSchemeJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public SubSchemeEntity create(SubSchemeEntity entity) { - super.create(entity); - return entity; - } - - public SubSchemeEntity update(SubSchemeEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(SubSchemeSearch domain) { - SubSchemeSearchEntity subSchemeSearchEntity = new SubSchemeSearchEntity(); - subSchemeSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (subSchemeSearchEntity.getSortBy() != null && !subSchemeSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(subSchemeSearchEntity.getSortBy()); - validateEntityFieldName(subSchemeSearchEntity.getSortBy(), SubSchemeEntity.class); - } - - String orderBy = "order by name"; - if (subSchemeSearchEntity.getSortBy() != null && !subSchemeSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + subSchemeSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", SubSchemeEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (subSchemeSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", subSchemeSearchEntity.getTenantId()); - } - if (subSchemeSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", subSchemeSearchEntity.getId()); - } - if (subSchemeSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(subSchemeSearchEntity.getIds().split(",")))); - } - if (subSchemeSearchEntity.getSchemeId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("schemeId =:scheme"); - paramValues.put("scheme", subSchemeSearchEntity.getSchemeId()); - } - if (subSchemeSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", subSchemeSearchEntity.getCode()); - } - if (subSchemeSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", subSchemeSearchEntity.getName()); - } - if (subSchemeSearchEntity.getValidFrom() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("validFrom =:validFrom"); - paramValues.put("validFrom", subSchemeSearchEntity.getValidFrom()); - } - if (subSchemeSearchEntity.getValidTo() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("validTo =:validTo"); - paramValues.put("validTo", subSchemeSearchEntity.getValidTo()); - } - if (subSchemeSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", subSchemeSearchEntity.getActive()); - } - if (subSchemeSearchEntity.getDepartmentId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("departmentId =:departmentId"); - paramValues.put("departmentId", subSchemeSearchEntity.getDepartmentId()); - } - - Pagination page = new Pagination<>(); - if (subSchemeSearchEntity.getOffset() != null) { - page.setOffset(subSchemeSearchEntity.getOffset()); - } - if (subSchemeSearchEntity.getPageSize() != null) { - page.setPageSize(subSchemeSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(SubSchemeEntity.class); - - List subSchemeEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), paramValues, - row); - - page.setTotalResults(subSchemeEntities.size()); - - List subschemes = new ArrayList<>(); - for (SubSchemeEntity subSchemeEntity : subSchemeEntities) { - - subschemes.add(subSchemeEntity.toDomain()); - } - page.setPagedData(subschemes); - - return page; - } - - public SubSchemeEntity findById(SubSchemeEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List subschemes = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(SubSchemeEntity.class)); - if (subschemes.isEmpty()) { - return null; - } else { - return subschemes.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SupplierJdbcRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SupplierJdbcRepository.java deleted file mode 100644 index 2daac1d2019..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/persistence/repository/SupplierJdbcRepository.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.persistence.repository.JdbcRepository; -import org.egov.egf.master.domain.model.Supplier; -import org.egov.egf.master.domain.model.SupplierSearch; -import org.egov.egf.master.persistence.entity.SupplierEntity; -import org.egov.egf.master.persistence.entity.SupplierSearchEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.BeanPropertyRowMapper; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Service; - -@Service -public class SupplierJdbcRepository extends JdbcRepository { - private static final Logger LOG = LoggerFactory.getLogger(SupplierJdbcRepository.class); - - static { - LOG.debug("init supplier"); - init(SupplierEntity.class); - LOG.debug("end init supplier"); - } - - public SupplierJdbcRepository(NamedParameterJdbcTemplate namedParameterJdbcTemplate) { - this.namedParameterJdbcTemplate = namedParameterJdbcTemplate; - } - - public SupplierEntity create(SupplierEntity entity) { - super.create(entity); - return entity; - } - - public SupplierEntity update(SupplierEntity entity) { - super.update(entity); - return entity; - - } - - public Pagination search(SupplierSearch domain) { - SupplierSearchEntity supplierSearchEntity = new SupplierSearchEntity(); - supplierSearchEntity.toEntity(domain); - - String searchQuery = "select :selectfields from :tablename :condition :orderby "; - - Map paramValues = new HashMap<>(); - StringBuffer params = new StringBuffer(); - - if (supplierSearchEntity.getSortBy() != null && !supplierSearchEntity.getSortBy().isEmpty()) { - validateSortByOrder(supplierSearchEntity.getSortBy()); - validateEntityFieldName(supplierSearchEntity.getSortBy(), SupplierEntity.class); - } - - String orderBy = "order by name"; - if (supplierSearchEntity.getSortBy() != null && !supplierSearchEntity.getSortBy().isEmpty()) { - orderBy = "order by " + supplierSearchEntity.getSortBy(); - } - - searchQuery = searchQuery.replace(":tablename", SupplierEntity.TABLE_NAME); - - searchQuery = searchQuery.replace(":selectfields", " * "); - - // implement jdbc specfic search - if (supplierSearchEntity.getTenantId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tenantId =:tenantId"); - paramValues.put("tenantId", supplierSearchEntity.getTenantId()); - } - if (supplierSearchEntity.getId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id =:id"); - paramValues.put("id", supplierSearchEntity.getId()); - } - if (supplierSearchEntity.getIds() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("id in(:ids) "); - paramValues.put("ids", new ArrayList(Arrays.asList(supplierSearchEntity.getIds().split(",")))); - } - if (supplierSearchEntity.getCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("code =:code"); - paramValues.put("code", supplierSearchEntity.getCode()); - } - if (supplierSearchEntity.getName() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("name =:name"); - paramValues.put("name", supplierSearchEntity.getName()); - } - if (supplierSearchEntity.getAddress() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("address =:address"); - paramValues.put("address", supplierSearchEntity.getAddress()); - } - if (supplierSearchEntity.getMobile() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("mobile =:mobile"); - paramValues.put("mobile", supplierSearchEntity.getMobile()); - } - if (supplierSearchEntity.getEmail() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("email =:email"); - paramValues.put("email", supplierSearchEntity.getEmail()); - } - if (supplierSearchEntity.getDescription() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("description =:description"); - paramValues.put("description", supplierSearchEntity.getDescription()); - } - if (supplierSearchEntity.getActive() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("active =:active"); - paramValues.put("active", supplierSearchEntity.getActive()); - } - if (supplierSearchEntity.getPanNo() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("panNo =:panNo"); - paramValues.put("panNo", supplierSearchEntity.getPanNo()); - } - if (supplierSearchEntity.getTinNo() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("tinNo =:tinNo"); - paramValues.put("tinNo", supplierSearchEntity.getTinNo()); - } - if (supplierSearchEntity.getRegistationNo() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("registationNo =:registationNo"); - paramValues.put("registationNo", supplierSearchEntity.getRegistationNo()); - } - if (supplierSearchEntity.getBankAccountId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("bankAccountId =:bankAccount"); - paramValues.put("bankAccount", supplierSearchEntity.getBankAccountId()); - } - if (supplierSearchEntity.getIfscCode() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("ifscCode =:ifscCode"); - paramValues.put("ifscCode", supplierSearchEntity.getIfscCode()); - } - if (supplierSearchEntity.getBankId() != null) { - if (params.length() > 0) { - params.append(" and "); - } - params.append("bankId =:bank"); - paramValues.put("bank", supplierSearchEntity.getBankId()); - } - - Pagination page = new Pagination<>(); - if (supplierSearchEntity.getOffset() != null) { - page.setOffset(supplierSearchEntity.getOffset()); - } - if (supplierSearchEntity.getPageSize() != null) { - page.setPageSize(supplierSearchEntity.getPageSize()); - } - - - if (params.length() > 0) { - - searchQuery = searchQuery.replace(":condition", " where " + - params.toString()); - - } else - - searchQuery = searchQuery.replace(":condition", ""); - - searchQuery = searchQuery.replace(":orderby", orderBy); - - page = (Pagination) getPagination(searchQuery, page, paramValues); - searchQuery = searchQuery + " :pagination"; - - searchQuery = searchQuery.replace(":pagination", - "limit " + page.getPageSize() + " offset " + page.getOffset() * page.getPageSize()); - - BeanPropertyRowMapper row = new BeanPropertyRowMapper(SupplierEntity.class); - - List supplierEntities = namedParameterJdbcTemplate.query(searchQuery.toString(), paramValues, - row); - - page.setTotalResults(supplierEntities.size()); - - List suppliers = new ArrayList<>(); - for (SupplierEntity supplierEntity : supplierEntities) { - - suppliers.add(supplierEntity.toDomain()); - } - page.setPagedData(suppliers); - - return page; - } - - public SupplierEntity findById(SupplierEntity entity) { - List list = allIdentitiferFields.get(entity.getClass().getSimpleName()); - - Map paramValues = new HashMap<>(); - - for (String s : list) { - paramValues.put(s, getValue(getField(entity, s), entity)); - } - - List suppliers = namedParameterJdbcTemplate.query( - getByIdQuery.get(entity.getClass().getSimpleName()).toString(), paramValues, - new BeanPropertyRowMapper(SupplierEntity.class)); - if (suppliers.isEmpty()) { - return null; - } else { - return suppliers.get(0); - } - - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/advice/CustomControllerAdvice.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/advice/CustomControllerAdvice.java deleted file mode 100644 index a137313a1bd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/advice/CustomControllerAdvice.java +++ /dev/null @@ -1,200 +0,0 @@ -package org.egov.egf.master.web.advice; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.response.Error; -import org.egov.common.contract.response.ErrorField; -import org.egov.common.contract.response.ErrorResponse; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.ErrorCode; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.exception.UnauthorizedAccessException; -import org.egov.common.persistence.repository.JdbcRepository; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.MissingServletRequestParameterException; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; - -@ControllerAdvice -@RestController -public class CustomControllerAdvice { - - private static final Logger LOG = LoggerFactory.getLogger(CustomControllerAdvice.class); - - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ExceptionHandler(MissingServletRequestParameterException.class) - public String handleMissingParamsError(Exception ex) { - return ex.getMessage(); - } - - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ExceptionHandler(CustomBindException.class) - public org.egov.common.web.contract.ErrorResponse handleBindingErrors(CustomBindException ex) { - org.egov.common.web.contract.ErrorResponse errRes = new org.egov.common.web.contract.ErrorResponse(); - //errRes.setErrors(new ArrayList<>()); - BindingResult errors = ex.getErrors(); - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.BAD_REQUEST.toString()); - errRes.setResponseInfo(responseInfo); - org.egov.common.web.contract.Error error = new org.egov.common.web.contract.Error(); - if (errors.getGlobalError() != null) { - if (errors.getGlobalError().getCode() != null) { - error.setCode(errors.getGlobalError().getCode()); - error.setMessage(errors.getGlobalError().getObjectName()); - error.setDescription(errors.getGlobalError().getDefaultMessage()); - } else if (ErrorCode.getError(errors.getGlobalError().getCode()) != null) { - error.setCode(ErrorCode.getError(errors.getGlobalError().getDefaultMessage()).getCode()); - String message = MessageFormat.format( - ErrorCode.getError(errors.getGlobalError().getDefaultMessage()).getMessage(), - errors.getGlobalError().getObjectName()); - error.setMessage(message); - String desc = MessageFormat.format( - ErrorCode.getError(errors.getGlobalError().getDefaultMessage()).getDescription(), - errors.getGlobalError().getObjectName()); - error.setDescription(desc); - } - errRes.getErrors().add(error); - - } - /*if (errors.getFieldErrorCount() > 0) { - error.setDescription("Validation errors"); - } - */ - - if (errors.hasFieldErrors()) { - List fieldErrors = errors.getFieldErrors(); - for (org.springframework.validation.FieldError errs : fieldErrors) { - org.egov.common.web.contract.Error err = new org.egov.common.web.contract.Error(); - if (ErrorCode.getError(errs.getCode()) != null) { - err.setCode(errs.getCode()); - String message = MessageFormat.format(ErrorCode.getError(errs.getCode()).getMessage(), - errs.getField(), errs.getRejectedValue()); - err.setMessage(message); - String desc = MessageFormat.format(ErrorCode.getError(errs.getCode()).getDescription(), - errs.getField(), errs.getRejectedValue()); - err.setDescription(desc); - err.getParams().add(errs.getField()); - err.getParams().add((String)errs.getRejectedValue()); - } else { - err.setCode(errs.getCode()); - err.setMessage(errs.getDefaultMessage()); - err.setDescription(errs.getField()); - } - errRes.getErrors().add(err); - } - - } - - return errRes; - } - - - - @ResponseStatus(HttpStatus.BAD_REQUEST) - @ExceptionHandler(InvalidDataException.class) - public org.egov.common.web.contract.ErrorResponse handleBindingErrors(InvalidDataException ex) { - org.egov.common.web.contract.ErrorResponse errRes = new org.egov.common.web.contract.ErrorResponse(); - - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.BAD_REQUEST.toString()); - errRes.setResponseInfo(responseInfo); - org.egov.common.web.contract.Error error = new org.egov.common.web.contract.Error(); - error.setCode(ex.getMessageKey()); - System.out.println(ErrorCode.getError("non.unique.value")); - if (ErrorCode.getError(ex.getMessageKey()) != null) { - String message = MessageFormat.format(ErrorCode.getError(ex.getMessageKey()).getMessage(), - ex.getFieldName(), ex.getFieldValue()); - error.setMessage(message); - String desc = MessageFormat.format(ErrorCode.getError(ex.getMessageKey()).getDescription(), - ex.getFieldName(), ex.getFieldValue()); - error.setDescription(desc); - } else { - LOG.warn("error code is not defined for " + ex.getMessageKey()); - } - List errors = new ArrayList(); - errors.add(error); - errRes.setErrors(errors); - return errRes; - } - - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ExceptionHandler(org.apache.kafka.common.errors.TimeoutException.class) - public org.egov.common.web.contract.ErrorResponse handleThrowable( - org.apache.kafka.common.errors.TimeoutException ex) { - org.egov.common.web.contract.ErrorResponse errRes = new org.egov.common.web.contract.ErrorResponse(); - ex.printStackTrace(); - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.toString()); - errRes.setResponseInfo(responseInfo); - org.egov.common.web.contract.Error error = new org.egov.common.web.contract.Error(); - - error.setCode(ErrorCode.KAFKA_TIMEOUT_ERROR.getCode()); - error.setMessage(ErrorCode.KAFKA_TIMEOUT_ERROR.getMessage()); - error.setDescription(ErrorCode.KAFKA_TIMEOUT_ERROR.getDescription()); - List errors = new ArrayList(); - errors.add(error); - errRes.setErrors(errors); - return errRes; - } - - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ExceptionHandler(Throwable.class) - public ErrorResponse handleThrowable(Exception ex) { - ErrorResponse errRes = new ErrorResponse(); - ex.printStackTrace(); - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - - error.setCode(500); - error.setMessage("Internal Server Error"); - error.setDescription(ex.getMessage()); - return errRes; - } - - @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) - @ExceptionHandler(Exception.class) - public ErrorResponse handleServerError(Exception ex) { - ex.printStackTrace(); - ErrorResponse errRes = new ErrorResponse(); - - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - - error.setCode(500); - error.setMessage("Internal Server Error"); - error.setDescription(ex.getMessage()); - errRes.setError(error); - return errRes; - } - - @ResponseStatus(HttpStatus.UNAUTHORIZED) - @ExceptionHandler(UnauthorizedAccessException.class) - public ErrorResponse handleAuthenticationError(UnauthorizedAccessException ex) { - ex.printStackTrace(); - ErrorResponse errRes = new ErrorResponse(); - - ResponseInfo responseInfo = new ResponseInfo(); - responseInfo.setStatus(HttpStatus.UNAUTHORIZED.toString()); - errRes.setResponseInfo(responseInfo); - Error error = new Error(); - - error.setCode(404); - error.setMessage("Un Authorized Access"); - error.setDescription(ex.getMessage()); - errRes.setError(error); - return errRes; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountCodePurposeContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountCodePurposeContract.java deleted file mode 100644 index 7c5f4441780..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountCodePurposeContract.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id","name"}) -public class AccountCodePurposeContract extends AuditableContract { - - private String id; - - @NotNull - @Length(max = 256, min = 3) - private String name; - - public AccountCodePurposeContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountCodePurposeSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountCodePurposeSearchContract.java deleted file mode 100644 index 7acf81c1bca..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountCodePurposeSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountCodePurposeSearchContract extends AccountCodePurposeContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailKeyContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailKeyContract.java deleted file mode 100644 index 14df97b49ef..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailKeyContract.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "key", "accountDetailType" }) -public class AccountDetailKeyContract extends AuditableContract { - - private String id; - - @NotNull - private String key; - - @NotNull - private AccountDetailTypeContract accountDetailType; - - public AccountDetailKeyContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailKeySearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailKeySearchContract.java deleted file mode 100644 index 71ebad05991..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailKeySearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountDetailKeySearchContract extends AccountDetailKeyContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailTypeContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailTypeContract.java deleted file mode 100644 index ecf6de00abc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailTypeContract.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "description", "tableName", "active", "fullyQualifiedName" }) -public class AccountDetailTypeContract extends AuditableContract { - - private String id; - - @NotNull - @Length(max = 50, min = 1) - private String name; - - @NotNull - @Length(max = 50, min = 1) - private String description; - - @Length(max = 25) - private String tableName; - - @NotNull - private Boolean active; - - @Length(max = 250, min = 1) - private String fullyQualifiedName; - - public AccountDetailTypeContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailTypeSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailTypeSearchContract.java deleted file mode 100644 index 0debf5ac3db..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountDetailTypeSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountDetailTypeSearchContract extends AccountDetailTypeContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountEntityContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountEntityContract.java deleted file mode 100644 index 08b6d6db779..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountEntityContract.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "accountDetailType", "code", "name", "active", "description" }) -public class AccountEntityContract extends AuditableContract { - - private String id; - - @NotNull - private AccountDetailTypeContract accountDetailType; - - @NotNull - @Length(max = 25, min = 1) - private String code; - - @NotNull - @Length(max = 350, min = 1) - private String name; - - @NotNull - private Boolean active; - - @Length(max = 256) - private String description; - - public AccountEntityContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountEntitySearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountEntitySearchContract.java deleted file mode 100644 index 43503f53cf2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/AccountEntitySearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class AccountEntitySearchContract extends AccountEntityContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankAccountContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankAccountContract.java deleted file mode 100644 index ac00f38c5a5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankAccountContract.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.egov.egf.master.web.contract.enums.BankAccountTypeContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "bankBranch", "chartOfAccount", "fund", "accountNumber", "accountType", "description", - "active", "payTo", "type" }) -public class BankAccountContract extends AuditableContract { - - private String id; - - @NotNull - private BankBranchContract bankBranch; - - @NotNull - private ChartOfAccountContract chartOfAccount; - - @NotNull - private FundContract fund; - - @NotNull - @Length(max = 25) - private String accountNumber; - - // is this required ? - private String accountType; - - @Length(max = 256) - private String description; - - @NotNull - private Boolean active; - - @Length(max = 100) - private String payTo; - - @NotNull - private BankAccountTypeContract type; - - public BankAccountContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankAccountSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankAccountSearchContract.java deleted file mode 100644 index 633aab12dcd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankAccountSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankAccountSearchContract extends BankAccountContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankBranchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankBranchContract.java deleted file mode 100644 index b82b87efeb4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankBranchContract.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "bank", "code", "name", "address", "address2", "city", "state", "pincode", "phone", "fax", - "contactPerson", "active", "description", "micr" }) -public class BankBranchContract extends AuditableContract { - - private String id; - - @NotNull - private BankContract bank; - - @NotNull - @Length(max = 50, min = 1) - private String code; - - @NotNull - @Length(max = 50, min = 1) - @Pattern(regexp = "^[a-zA-Z0-9_]*$") - private String name; - - @NotNull - @Length(max = 50, min = 1) - private String address; - - @Length(max = 50) - private String address2; - - @Length(max = 50) - private String city; - - @Length(max = 50) - private String state; - - @Length(max = 50) - private String pincode; - - @Length(max = 15) - private String phone; - - @Length(max = 15) - private String fax; - - @Length(max = 50) - private String contactPerson; - - @NotNull - private Boolean active; - - @Length(max = 256) - private String description; - - @Length(max = 50) - private String micr; - - public BankBranchContract(final String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankBranchSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankBranchSearchContract.java deleted file mode 100644 index 94a5f9a2724..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankBranchSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankBranchSearchContract extends BankBranchContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankContract.java deleted file mode 100644 index 77caa88a8af..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankContract.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "code", "name", "description", "active", "type", "fund" }) -public class BankContract extends AuditableContract { - - private String id; - - @NotNull - @Size(max = 50, min = 1) - private String code; - - @NotNull - @Size(max = 100, min = 2) - private String name; - - @Size(max = 250) - private String description; - - @NotNull - private Boolean active; - - @NotNull - @Size(max = 50) - private String type; - - public BankContract(final String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankSearchContract.java deleted file mode 100644 index eec9e6eed2f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BankSearchContract.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BankSearchContract extends BankContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BudgetGroupContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BudgetGroupContract.java deleted file mode 100644 index 9e37bf4a5a1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BudgetGroupContract.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import org.egov.common.web.contract.AuditableContract; -import org.egov.egf.master.web.contract.enums.BudgetAccountTypeContract; -import org.egov.egf.master.web.contract.enums.BudgetingTypeContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "description", "majorCode", "maxCode", "minCode", "accountType", "budgetingType", - "active" }) -public class BudgetGroupContract extends AuditableContract { - - private String id; - - @Length(max = 250, min = 1) - private String name; - - @Length(max = 250, message = "Max 250 characters are allowed for description") - private String description; - - private ChartOfAccountContract majorCode; - - private ChartOfAccountContract maxCode; - - private ChartOfAccountContract minCode; - - private BudgetAccountTypeContract accountType; - - private BudgetingTypeContract budgetingType; - - private Boolean active; - - public BudgetGroupContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BudgetGroupSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BudgetGroupSearchContract.java deleted file mode 100644 index 7cb2042e54e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/BudgetGroupSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class BudgetGroupSearchContract extends BudgetGroupContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountContract.java deleted file mode 100644 index 5b2e2fc7ea7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountContract.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "glcode", "name", "accountCodePurpose", "description", "isActiveForPosting", "parentId", - "type", "classification", "functionRequired", "budgetCheckRequired", "majorCode", "isSubLedger" }) -public class ChartOfAccountContract extends AuditableContract { - - private String id; - - @NotNull - @Length(max = 16, min = 1) - private String glcode; - - @NotNull - @Length(max = 128, min = 5) - private String name; - - private AccountCodePurposeContract accountCodePurpose; - - @Length(max = 256) - private String description; - - @NotNull - private Boolean isActiveForPosting; - - private ChartOfAccountContract parentId; - - @NotNull - private Character type; - - @NotNull - private Long classification; - - @NotNull - private Boolean functionRequired; - - @NotNull - private Boolean budgetCheckRequired; - - @Length(max = 16) - private String majorCode; - - private Boolean isSubLedger; - - public ChartOfAccountContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountDetailContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountDetailContract.java deleted file mode 100644 index a32e576c046..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountDetailContract.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "chartOfAccount", "accountDetailType" }) -public class ChartOfAccountDetailContract extends AuditableContract { - - private String id; - - @NotNull - private ChartOfAccountContract chartOfAccount; - - @NotNull - private AccountDetailTypeContract accountDetailType; - - public ChartOfAccountDetailContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountDetailSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountDetailSearchContract.java deleted file mode 100644 index d5b297590dd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountDetailSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class ChartOfAccountDetailSearchContract extends ChartOfAccountDetailContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountSearchContract.java deleted file mode 100644 index f193077cbac..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/ChartOfAccountSearchContract.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.master.web.contract; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class ChartOfAccountSearchContract extends ChartOfAccountContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String glcodes; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/EgfStatusContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/EgfStatusContract.java deleted file mode 100644 index 063cf605883..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/EgfStatusContract.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "moduleType", "code", "description" }) -public class EgfStatusContract extends AuditableContract { - - @NotNull - private String id; - - @NotNull - @Size(min = 3, max = 50) - private String moduleType; - - @NotNull - @Size(min = 3, max = 20) - private String code; - - @NotNull - @Size(min = 3, max = 250) - private String description; - - public EgfStatusContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/EgfStatusSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/EgfStatusSearchContract.java deleted file mode 100644 index a5898b33ded..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/EgfStatusSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class EgfStatusSearchContract extends EgfStatusContract { - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationContract.java deleted file mode 100644 index 83ccc43ff07..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationContract.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import java.util.List; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "description", "values" }) -public class FinancialConfigurationContract extends AuditableContract { - - @NotNull - private String id; - - @Size(min = 3, max = 50) - private String name; - - @NotNull - @Size(min = 3, max = 250) - private String description; - - @NotNull - @Size(min = 3, max = 250) - private String module; - - @NotNull - private List values; - - public FinancialConfigurationContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationSearchContract.java deleted file mode 100644 index 49497ec0a5f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialConfigurationSearchContract extends FinancialConfigurationContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationValueContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationValueContract.java deleted file mode 100644 index 7b763527960..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialConfigurationValueContract.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import java.util.Date; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "financialConfiguration", "value", "effectiveFrom" }) -public class FinancialConfigurationValueContract extends AuditableContract { - - @NotNull - private String id; - - @NotNull - private FinancialConfigurationContract financialConfiguration; - - @NotNull - @Size(min = 1, max = 1000) - private String value; - - @NotNull - private Date effectiveFrom; - - public FinancialConfigurationValueContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialStatusContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialStatusContract.java deleted file mode 100644 index 4316a716a6a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialStatusContract.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.common.web.contract.AuditableContract; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "moduleType", "code", "description" }) -public class FinancialStatusContract extends AuditableContract { - - @NotNull - private String id; - - @NotNull - - @Size(min = 3, max = 50) - private String moduleType; - - @NotNull - - @Size(min = 3, max = 20) - private String code; - - @NotNull - - @Size(min = 3, max = 20) - private String name; - - @NotNull - - @Size(min = 3, max = 250) - private String description; - - public FinancialStatusContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialStatusSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialStatusSearchContract.java deleted file mode 100644 index 4c27438c557..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialStatusSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialStatusSearchContract extends FinancialStatusContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialYearContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialYearContract.java deleted file mode 100644 index a03c34982fb..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialYearContract.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "finYearRange", "startingDate", "endingDate", "active", "isActiveForPosting", "isClosed", - "transferClosingBalance" }) -public class FinancialYearContract extends AuditableContract { - - private String id; - - @Length(min = 1, max = 25) - - private String finYearRange; - - @NotNull - private Date startingDate; - - @NotNull - private Date endingDate; - - @NotNull - private Boolean active; - - @NotNull - private Boolean isActiveForPosting; - - private Boolean isClosed; - - private Boolean transferClosingBalance; - - public FinancialYearContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialYearSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialYearSearchContract.java deleted file mode 100644 index abf408c570e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FinancialYearSearchContract.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.egov.egf.master.web.contract; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FinancialYearSearchContract extends FinancialYearContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private Date asOnDate; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FiscalPeriodContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FiscalPeriodContract.java deleted file mode 100644 index 108f8a4ef3e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FiscalPeriodContract.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "financialYear", "startingDate", "endingDate", "active", "isActiveForPosting", - "isClosed" }) -public class FiscalPeriodContract extends AuditableContract { - - private String id; - - @Length(min = 1, max = 25) - @NotNull - private String name = ""; - - @NotNull - private FinancialYearContract financialYear; - - @NotNull - private Date startingDate; - - @NotNull - private Date endingDate; - - @NotNull - private Boolean active; - - @NotNull - private Boolean isActiveForPosting; - - private Boolean isClosed; - - public FiscalPeriodContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FiscalPeriodSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FiscalPeriodSearchContract.java deleted file mode 100644 index 260c2ac60f2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FiscalPeriodSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FiscalPeriodSearchContract extends FiscalPeriodContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionContract.java deleted file mode 100644 index 066ca8972a1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionContract.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "code", "level", "active", "parentId" }) -public class FunctionContract extends AuditableContract { - - private String id; - - @Length(max = 128, min = 2) - @NotNull - private String name; - - @Length(max = 16, min = 2) - @NotNull - private String code; - - @NotNull - private Integer level; - - @NotNull - private Boolean active; - - private FunctionContract parentId; - - public FunctionContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionSearchContract.java deleted file mode 100644 index 383251cd011..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FunctionSearchContract extends FunctionContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionaryContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionaryContract.java deleted file mode 100644 index 600446941d7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionaryContract.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "code", "name", "active" }) -public class FunctionaryContract extends AuditableContract { - - private String id; - - @NotNull - @Length(max = 16, min = 1) - private String code; - - @NotNull - @Length(max = 256, min = 1) - private String name; - - @NotNull - private Boolean active; - - public FunctionaryContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionarySearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionarySearchContract.java deleted file mode 100644 index d59c0fe8b52..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FunctionarySearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FunctionarySearchContract extends FunctionaryContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundContract.java deleted file mode 100644 index 54f60215611..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundContract.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@EqualsAndHashCode(exclude = { "parent" }, callSuper = false) -@Builder -public class FundContract extends AuditableContract { - - private static final long serialVersionUID = 7977534010758407945L; - - protected String id; - - @Length(max = 50, min = 2) - @NotNull - protected String name; - - @Length(max = 50, min = 2) - @NotNull - protected String code; - @NotNull - protected Character identifier; - - @NotNull - protected Long level; - - protected FundContract parent; - - @NotNull - protected Boolean active; - - public FundContract(String id) { - this.id = id; - } - - /* - * public Fund toDomain() { - * - * Fund parent=null; if(this.getParent()!=null && this.parent.getId()!=null) - * parent= Fund.builder().id(this.getParent().getId()).build(); Fund fund= - * Fund.builder() .id(this.id) .name(name) .code(code) .active(active) - * .identifier(identifier) .parent(parent) .build(); super.toDomain(fund); - * return fund; - * - * } - */ - - /* - * public FundEntity toEntity() { return FundEntity.builder() .id(id) - * .name(name) .code(code) .active(active) .identifier(identifier) - * .parentId(parent.getId()) .isParent(isParent) .build(); - * - * } - */ - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundSearchContract.java deleted file mode 100644 index 20935cc244b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundSearchContract.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.egov.egf.master.web.contract; - -import java.util.ArrayList; -import java.util.List; - -import lombok.Data; - -@Data - -public class FundSearchContract extends FundContract { - - private String sortBy; - - private Integer pageSize; - - private Integer offset; - - private List ids = new ArrayList(); - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundsourceContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundsourceContract.java deleted file mode 100644 index 11b8cbdffdb..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundsourceContract.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import java.math.BigDecimal; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "code", "name", "type", "fundSource", "llevel", "active", "isParent" }) -public class FundsourceContract extends AuditableContract { - - private String id; - - @Length(min = 1, max = 25) - @NotNull - private String code; - - @Length(min = 1, max = 25) - @NotNull - private String name; - - @Length(min = 1, max = 25) - private String type; - - private FundsourceContract parent; - - private BigDecimal llevel; - - @NotNull - private Boolean active; - - // is this required - private Boolean isParent; - - public FundsourceContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundsourceSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundsourceSearchContract.java deleted file mode 100644 index 63395c53902..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/FundsourceSearchContract.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class FundsourceSearchContract extends FundsourceContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RecoveryContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RecoveryContract.java deleted file mode 100644 index 10811ab4dc9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RecoveryContract.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.egf.master.web.contract; - -import lombok.*; -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import javax.validation.constraints.NotNull; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class RecoveryContract extends AuditableContract { - - private static final long serialVersionUID = 7977534010758407945L; - - protected String id; - - @Length(max = 50, min = 2) - @NotNull - protected String name; - - @Length(max = 50, min = 2) - @NotNull - protected String code; - - @NotNull - protected ChartOfAccountContract chartOfAccount; - - protected String type; - - protected Double flat; - - protected Double percentage; - - @NotNull - protected Boolean active; - - @Length(max = 100) - protected String remitted; - - @Length(max = 16) - protected String ifscCode; - - protected Character mode; - - protected Character remittanceMode; - - @Length(max = 32) - protected String accountNumber; - - public RecoveryContract(String id) { - this.id = id; - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RecoverySearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RecoverySearchContract.java deleted file mode 100644 index 61a26b43128..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RecoverySearchContract.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.egov.egf.master.web.contract; - -import lombok.Data; - -import java.util.ArrayList; -import java.util.List; - -@Data - -public class RecoverySearchContract extends RecoveryContract { - - private String sortBy; - - private Integer pageSize; - - private Integer offset; - - private List ids = new ArrayList(); - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RequestInfoWrapper.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RequestInfoWrapper.java deleted file mode 100644 index e57fbeeb24f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/RequestInfoWrapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.egov.egf.master.web.contract; - - -import lombok.Getter; -import lombok.Setter; -import org.egov.common.contract.request.RequestInfo; - -@Getter -@Setter -public class RequestInfoWrapper { - private RequestInfo requestInfo; - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SchemeContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SchemeContract.java deleted file mode 100644 index 71fbcb8bd06..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SchemeContract.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "fund", "code", "name", "validFrom", "validTo", "active", "description", "boundary" }) -public class SchemeContract extends AuditableContract { - - private String id; - - private FundContract fund; - - @Length(max = 25, min = 1) - private String code; - - @Length(max = 25, min = 1) - private String name; - - @NotNull - private Date validFrom; - - @NotNull - private Date validTo; - - @NotNull - private Boolean active; - - @Length(max = 256) - private String description; - - private String boundary; - - public SchemeContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SchemeSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SchemeSearchContract.java deleted file mode 100644 index a41873fac61..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SchemeSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SchemeSearchContract extends SchemeContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SubSchemeContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SubSchemeContract.java deleted file mode 100644 index a99994f4d06..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SubSchemeContract.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import java.util.Date; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "scheme", "code", "name", "validFrom", "validTo", "active", "departmentId" }) -public class SubSchemeContract extends AuditableContract { - - private String id; - - @NotNull - private SchemeContract scheme; - - @NotNull - @Length(max = 50, min = 1) - private String code; - - @NotNull - @Length(max = 50, min = 1) - private String name; - - @NotNull - private Date validFrom; - - @NotNull - private Date validTo; - - @NotNull - private Boolean active; - - private String departmentId; - - public SubSchemeContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SubSchemeSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SubSchemeSearchContract.java deleted file mode 100644 index e022d0ac9ed..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SubSchemeSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SubSchemeSearchContract extends SubSchemeContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SupplierContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SupplierContract.java deleted file mode 100644 index 6d106fe5966..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SupplierContract.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract; - -import javax.validation.constraints.NotNull; - -import org.egov.common.web.contract.AuditableContract; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "code", "name", "address", "mobile", "email", "description", "active", "panNo", "tinNo", - "registationNo", "bankAccount", "ifscCode", "bank" }) -public class SupplierContract extends AuditableContract { - - private String id; - - @NotNull - @Length(max = 50, min = 1) - private String code; - - @NotNull - @Length(max = 50, min = 1) - private String name; - - @Length(max = 300) - private String address; - - @Length(max = 10) - private String mobile; - - @Length(max = 25) - private String email; - - @Length(max = 250) - private String description; - @NotNull - private Boolean active; - - @Length(max = 10) - private String panNo; - - @Length(max = 20) - private String tinNo; - - @Length(max = 25) - private String registationNo; - - private BankAccountContract bankAccount; - - @Length(max = 12) - private String ifscCode; - - private BankContract bank; - - public SupplierContract(String id) { - this.id = id; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SupplierSearchContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SupplierSearchContract.java deleted file mode 100644 index d6f4bc64df1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/SupplierSearchContract.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.egov.egf.master.web.contract ; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class SupplierSearchContract extends SupplierContract { private String ids; -private String sortBy; -private Integer pageSize; -private Integer offset; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BankAccountTypeContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BankAccountTypeContract.java deleted file mode 100644 index eb4492bbdb6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BankAccountTypeContract.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract.enums; - -public enum BankAccountTypeContract { - RECEIPTS, PAYMENTS, RECEIPTS_PAYMENTS -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BudgetAccountTypeContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BudgetAccountTypeContract.java deleted file mode 100644 index 310a99997e5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BudgetAccountTypeContract.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.egf.master.web.contract.enums; - -public enum BudgetAccountTypeContract { - REVENUE_RECEIPTS, REVENUE_EXPENDITURE, CAPITAL_RECEIPTS, CAPITAL_EXPENDITURE -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BudgetingTypeContract.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BudgetingTypeContract.java deleted file mode 100644 index f3d9f5a4af2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/contract/enums/BudgetingTypeContract.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.egov.egf.master.web.contract.enums; - -public enum BudgetingTypeContract { - ALL, DEBIT, CREDIT -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountCodePurposeController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountCodePurposeController.java deleted file mode 100644 index 83b9f6a056f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountCodePurposeController.java +++ /dev/null @@ -1,152 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.domain.service.AccountCodePurposeService; -import org.egov.egf.master.web.contract.AccountCodePurposeContract; -import org.egov.egf.master.web.contract.AccountCodePurposeSearchContract; -import org.egov.egf.master.web.requests.AccountCodePurposeRequest; -import org.egov.egf.master.web.requests.AccountCodePurposeResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/accountcodepurposes") -public class AccountCodePurposeController { - - @Autowired - private AccountCodePurposeService accountCodePurposeService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public AccountCodePurposeResponse create(@RequestBody AccountCodePurposeRequest accountCodePurposeRequest, - BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - AccountCodePurposeResponse accountCodePurposeResponse = new AccountCodePurposeResponse(); - accountCodePurposeResponse.setResponseInfo(getResponseInfo(accountCodePurposeRequest.getRequestInfo())); - List accountcodepurposes = new ArrayList<>(); - AccountCodePurpose accountCodePurpose; - List accountCodePurposeContracts = new ArrayList<>(); - AccountCodePurposeContract contract; - - accountCodePurposeRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (AccountCodePurposeContract accountCodePurposeContract : accountCodePurposeRequest - .getAccountCodePurposes()) { - accountCodePurpose = new AccountCodePurpose(); - model.map(accountCodePurposeContract, accountCodePurpose); - accountCodePurpose.setCreatedDate(new Date()); - accountCodePurpose.setCreatedBy(accountCodePurposeRequest.getRequestInfo().getUserInfo()); - accountCodePurpose.setLastModifiedBy(accountCodePurposeRequest.getRequestInfo().getUserInfo()); - accountcodepurposes.add(accountCodePurpose); - } - - accountcodepurposes = accountCodePurposeService.create(accountcodepurposes, errors, - accountCodePurposeRequest.getRequestInfo()); - - for (AccountCodePurpose f : accountcodepurposes) { - contract = new AccountCodePurposeContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - accountCodePurposeContracts.add(contract); - } - - accountCodePurposeResponse.setAccountCodePurposes(accountCodePurposeContracts); - - return accountCodePurposeResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public AccountCodePurposeResponse update(@RequestBody AccountCodePurposeRequest accountCodePurposeRequest, - BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - accountCodePurposeRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - AccountCodePurposeResponse accountCodePurposeResponse = new AccountCodePurposeResponse(); - List accountcodepurposes = new ArrayList<>(); - accountCodePurposeResponse.setResponseInfo(getResponseInfo(accountCodePurposeRequest.getRequestInfo())); - AccountCodePurpose accountCodePurpose; - AccountCodePurposeContract contract; - List accountCodePurposeContracts = new ArrayList<>(); - - for (AccountCodePurposeContract accountCodePurposeContract : accountCodePurposeRequest - .getAccountCodePurposes()) { - accountCodePurpose = new AccountCodePurpose(); - model.map(accountCodePurposeContract, accountCodePurpose); - accountCodePurpose.setLastModifiedBy(accountCodePurposeRequest.getRequestInfo().getUserInfo()); - accountCodePurpose.setLastModifiedDate(new Date()); - accountcodepurposes.add(accountCodePurpose); - } - - accountcodepurposes = accountCodePurposeService.update(accountcodepurposes, errors, - accountCodePurposeRequest.getRequestInfo()); - - for (AccountCodePurpose accountCodePurposeObj : accountcodepurposes) { - contract = new AccountCodePurposeContract(); - model.map(accountCodePurposeObj, contract); - accountCodePurposeObj.setLastModifiedDate(new Date()); - accountCodePurposeContracts.add(contract); - } - - accountCodePurposeResponse.setAccountCodePurposes(accountCodePurposeContracts); - - return accountCodePurposeResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public AccountCodePurposeResponse search( - @ModelAttribute AccountCodePurposeSearchContract accountCodePurposeSearchContract, @RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - AccountCodePurposeSearch domain = new AccountCodePurposeSearch(); - mapper.map(accountCodePurposeSearchContract, domain); - AccountCodePurposeContract contract; - ModelMapper model = new ModelMapper(); - List accountCodePurposeContracts = new ArrayList<>(); - Pagination accountcodepurposes = accountCodePurposeService.search(domain, errors); - - for (AccountCodePurpose accountCodePurpose : accountcodepurposes.getPagedData()) { - contract = new AccountCodePurposeContract(); - model.map(accountCodePurpose, contract); - accountCodePurposeContracts.add(contract); - } - - AccountCodePurposeResponse response = new AccountCodePurposeResponse(); - response.setAccountCodePurposes(accountCodePurposeContracts); - response.setPage(new PaginationContract(accountcodepurposes)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountDetailKeyController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountDetailKeyController.java deleted file mode 100644 index 3e26e536197..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountDetailKeyController.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.domain.service.AccountDetailKeyService; -import org.egov.egf.master.web.contract.AccountDetailKeyContract; -import org.egov.egf.master.web.contract.AccountDetailKeySearchContract; -import org.egov.egf.master.web.requests.AccountDetailKeyRequest; -import org.egov.egf.master.web.requests.AccountDetailKeyResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/accountdetailkeys") -public class AccountDetailKeyController { - - @Autowired - private AccountDetailKeyService accountDetailKeyService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public AccountDetailKeyResponse create(@RequestBody AccountDetailKeyRequest accountDetailKeyRequest, - BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - AccountDetailKeyResponse accountDetailKeyResponse = new AccountDetailKeyResponse(); - accountDetailKeyResponse.setResponseInfo(getResponseInfo(accountDetailKeyRequest.getRequestInfo())); - List accountdetailkeys = new ArrayList<>(); - AccountDetailKey accountDetailKey; - List accountDetailKeyContracts = new ArrayList<>(); - AccountDetailKeyContract contract; - - accountDetailKeyRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (AccountDetailKeyContract accountDetailKeyContract : accountDetailKeyRequest.getAccountDetailKeys()) { - accountDetailKey = new AccountDetailKey(); - model.map(accountDetailKeyContract, accountDetailKey); - accountDetailKey.setCreatedDate(new Date()); - accountDetailKey.setCreatedBy(accountDetailKeyRequest.getRequestInfo().getUserInfo()); - accountDetailKey.setLastModifiedBy(accountDetailKeyRequest.getRequestInfo().getUserInfo()); - accountdetailkeys.add(accountDetailKey); - } - - accountdetailkeys = accountDetailKeyService.create(accountdetailkeys, errors, - accountDetailKeyRequest.getRequestInfo()); - - for (AccountDetailKey f : accountdetailkeys) { - contract = new AccountDetailKeyContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - accountDetailKeyContracts.add(contract); - } - - accountDetailKeyResponse.setAccountDetailKeys(accountDetailKeyContracts); - - return accountDetailKeyResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public AccountDetailKeyResponse update(@RequestBody AccountDetailKeyRequest accountDetailKeyRequest, - BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - accountDetailKeyRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - AccountDetailKeyResponse accountDetailKeyResponse = new AccountDetailKeyResponse(); - List accountdetailkeys = new ArrayList<>(); - accountDetailKeyResponse.setResponseInfo(getResponseInfo(accountDetailKeyRequest.getRequestInfo())); - AccountDetailKey accountDetailKey; - AccountDetailKeyContract contract; - List accountDetailKeyContracts = new ArrayList<>(); - - for (AccountDetailKeyContract accountDetailKeyContract : accountDetailKeyRequest.getAccountDetailKeys()) { - accountDetailKey = new AccountDetailKey(); - model.map(accountDetailKeyContract, accountDetailKey); - accountDetailKey.setLastModifiedBy(accountDetailKeyRequest.getRequestInfo().getUserInfo()); - accountDetailKey.setLastModifiedDate(new Date()); - accountdetailkeys.add(accountDetailKey); - } - - accountdetailkeys = accountDetailKeyService.update(accountdetailkeys, errors, - accountDetailKeyRequest.getRequestInfo()); - - for (AccountDetailKey accountDetailKeyObj : accountdetailkeys) { - contract = new AccountDetailKeyContract(); - model.map(accountDetailKeyObj, contract); - accountDetailKeyObj.setLastModifiedDate(new Date()); - accountDetailKeyContracts.add(contract); - } - - accountDetailKeyResponse.setAccountDetailKeys(accountDetailKeyContracts); - - return accountDetailKeyResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public AccountDetailKeyResponse search( - @ModelAttribute AccountDetailKeySearchContract accountDetailKeySearchContract, @RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - AccountDetailKeySearch domain = new AccountDetailKeySearch(); - mapper.map(accountDetailKeySearchContract, domain); - AccountDetailKeyContract contract; - ModelMapper model = new ModelMapper(); - List accountDetailKeyContracts = new ArrayList<>(); - Pagination accountdetailkeys = accountDetailKeyService.search(domain, errors); - - for (AccountDetailKey accountDetailKey : accountdetailkeys.getPagedData()) { - contract = new AccountDetailKeyContract(); - model.map(accountDetailKey, contract); - accountDetailKeyContracts.add(contract); - } - - AccountDetailKeyResponse response = new AccountDetailKeyResponse(); - response.setAccountDetailKeys(accountDetailKeyContracts); - response.setPage(new PaginationContract(accountdetailkeys)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountDetailTypeController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountDetailTypeController.java deleted file mode 100644 index dd45fc03e62..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountDetailTypeController.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.domain.service.AccountDetailTypeService; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.contract.AccountDetailTypeSearchContract; -import org.egov.egf.master.web.requests.AccountDetailTypeRequest; -import org.egov.egf.master.web.requests.AccountDetailTypeResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/accountdetailtypes") -public class AccountDetailTypeController { - - @Autowired - private AccountDetailTypeService accountDetailTypeService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public AccountDetailTypeResponse create(@RequestBody AccountDetailTypeRequest accountDetailTypeRequest, - BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - AccountDetailTypeResponse accountDetailTypeResponse = new AccountDetailTypeResponse(); - accountDetailTypeResponse.setResponseInfo(getResponseInfo(accountDetailTypeRequest.getRequestInfo())); - List accountdetailtypes = new ArrayList<>(); - AccountDetailType accountDetailType; - List accountDetailTypeContracts = new ArrayList<>(); - AccountDetailTypeContract contract; - - accountDetailTypeRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (AccountDetailTypeContract accountDetailTypeContract : accountDetailTypeRequest.getAccountDetailTypes()) { - accountDetailType = new AccountDetailType(); - model.map(accountDetailTypeContract, accountDetailType); - accountDetailType.setCreatedDate(new Date()); - accountDetailType.setCreatedBy(accountDetailTypeRequest.getRequestInfo().getUserInfo()); - accountDetailType.setLastModifiedBy(accountDetailTypeRequest.getRequestInfo().getUserInfo()); - accountdetailtypes.add(accountDetailType); - } - - accountdetailtypes = accountDetailTypeService.create(accountdetailtypes, errors, - accountDetailTypeRequest.getRequestInfo()); - - for (AccountDetailType f : accountdetailtypes) { - contract = new AccountDetailTypeContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - accountDetailTypeContracts.add(contract); - } - - accountDetailTypeResponse.setAccountDetailTypes(accountDetailTypeContracts); - - return accountDetailTypeResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public AccountDetailTypeResponse update(@RequestBody AccountDetailTypeRequest accountDetailTypeRequest, - BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - accountDetailTypeRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - AccountDetailTypeResponse accountDetailTypeResponse = new AccountDetailTypeResponse(); - List accountdetailtypes = new ArrayList<>(); - accountDetailTypeResponse.setResponseInfo(getResponseInfo(accountDetailTypeRequest.getRequestInfo())); - AccountDetailType accountDetailType; - AccountDetailTypeContract contract; - List accountDetailTypeContracts = new ArrayList<>(); - - for (AccountDetailTypeContract accountDetailTypeContract : accountDetailTypeRequest.getAccountDetailTypes()) { - accountDetailType = new AccountDetailType(); - model.map(accountDetailTypeContract, accountDetailType); - accountDetailType.setLastModifiedBy(accountDetailTypeRequest.getRequestInfo().getUserInfo()); - accountDetailType.setLastModifiedDate(new Date()); - accountdetailtypes.add(accountDetailType); - } - - accountdetailtypes = accountDetailTypeService.update(accountdetailtypes, errors, - accountDetailTypeRequest.getRequestInfo()); - - for (AccountDetailType accountDetailTypeObj : accountdetailtypes) { - contract = new AccountDetailTypeContract(); - model.map(accountDetailTypeObj, contract); - accountDetailTypeObj.setLastModifiedDate(new Date()); - accountDetailTypeContracts.add(contract); - } - - accountDetailTypeResponse.setAccountDetailTypes(accountDetailTypeContracts); - - return accountDetailTypeResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public AccountDetailTypeResponse search( - @ModelAttribute AccountDetailTypeSearchContract accountDetailTypeSearchContract,@RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - AccountDetailTypeSearch domain = new AccountDetailTypeSearch(); - mapper.map(accountDetailTypeSearchContract, domain); - AccountDetailTypeContract contract; - ModelMapper model = new ModelMapper(); - List accountDetailTypeContracts = new ArrayList<>(); - Pagination accountdetailtypes = accountDetailTypeService.search(domain, errors); - - for (AccountDetailType accountDetailType : accountdetailtypes.getPagedData()) { - contract = new AccountDetailTypeContract(); - model.map(accountDetailType, contract); - accountDetailTypeContracts.add(contract); - } - - AccountDetailTypeResponse response = new AccountDetailTypeResponse(); - response.setAccountDetailTypes(accountDetailTypeContracts); - response.setPage(new PaginationContract(accountdetailtypes)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountEntityController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountEntityController.java deleted file mode 100644 index 3159484e910..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/AccountEntityController.java +++ /dev/null @@ -1,145 +0,0 @@ -package org.egov.egf.master.web.controller; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.domain.service.AccountEntityService; -import org.egov.egf.master.web.contract.AccountEntityContract; -import org.egov.egf.master.web.contract.AccountEntitySearchContract; -import org.egov.egf.master.web.requests.AccountEntityRequest; -import org.egov.egf.master.web.requests.AccountEntityResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@RestController -@RequestMapping("/accountentities") -public class AccountEntityController { - - @Autowired - private AccountEntityService accountEntityService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public AccountEntityResponse create(@RequestBody AccountEntityRequest accountEntityRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - AccountEntityResponse accountEntityResponse = new AccountEntityResponse(); - accountEntityResponse.setResponseInfo(getResponseInfo(accountEntityRequest.getRequestInfo())); - List accountentities = new ArrayList<>(); - AccountEntity accountEntity; - List accountEntityContracts = new ArrayList<>(); - AccountEntityContract contract; - - accountEntityRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (AccountEntityContract accountEntityContract : accountEntityRequest.getAccountEntities()) { - accountEntity = new AccountEntity(); - model.map(accountEntityContract, accountEntity); - accountEntity.setCreatedDate(new Date()); - accountEntity.setCreatedBy(accountEntityRequest.getRequestInfo().getUserInfo()); - accountEntity.setLastModifiedBy(accountEntityRequest.getRequestInfo().getUserInfo()); - accountentities.add(accountEntity); - } - - accountentities = accountEntityService.create(accountentities, errors, accountEntityRequest.getRequestInfo()); - - for (AccountEntity f : accountentities) { - contract = new AccountEntityContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - accountEntityContracts.add(contract); - } - - accountEntityResponse.setAccountEntities(accountEntityContracts); - - return accountEntityResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public AccountEntityResponse update(@RequestBody AccountEntityRequest accountEntityRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - accountEntityRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - AccountEntityResponse accountEntityResponse = new AccountEntityResponse(); - List accountentities = new ArrayList<>(); - accountEntityResponse.setResponseInfo(getResponseInfo(accountEntityRequest.getRequestInfo())); - AccountEntity accountEntity; - AccountEntityContract contract; - List accountEntityContracts = new ArrayList<>(); - - for (AccountEntityContract accountEntityContract : accountEntityRequest.getAccountEntities()) { - accountEntity = new AccountEntity(); - model.map(accountEntityContract, accountEntity); - accountEntity.setLastModifiedBy(accountEntityRequest.getRequestInfo().getUserInfo()); - accountEntity.setLastModifiedDate(new Date()); - accountentities.add(accountEntity); - } - - accountentities = accountEntityService.update(accountentities, errors, accountEntityRequest.getRequestInfo()); - - for (AccountEntity accountEntityObj : accountentities) { - contract = new AccountEntityContract(); - model.map(accountEntityObj, contract); - accountEntityObj.setLastModifiedDate(new Date()); - accountEntityContracts.add(contract); - } - - accountEntityResponse.setAccountEntities(accountEntityContracts); - - return accountEntityResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public AccountEntityResponse search(@ModelAttribute AccountEntitySearchContract accountEntitySearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - AccountEntitySearch domain = new AccountEntitySearch(); - mapper.map(accountEntitySearchContract, domain); - AccountEntityContract contract; - ModelMapper model = new ModelMapper(); - List accountEntityContracts = new ArrayList<>(); - Pagination accountentities = accountEntityService.search(domain, errors); - - for (AccountEntity accountEntity : accountentities.getPagedData()) { - contract = new AccountEntityContract(); - model.map(accountEntity, contract); - accountEntityContracts.add(contract); - } - - AccountEntityResponse response = new AccountEntityResponse(); - response.setAccountEntities(accountEntityContracts); - response.setPage(new PaginationContract(accountentities)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankAccountController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankAccountController.java deleted file mode 100644 index 4af83452ea2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankAccountController.java +++ /dev/null @@ -1,145 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.domain.service.BankAccountService; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankAccountSearchContract; -import org.egov.egf.master.web.requests.BankAccountRequest; -import org.egov.egf.master.web.requests.BankAccountResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/bankaccounts") -public class BankAccountController { - - @Autowired - private BankAccountService bankAccountService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public BankAccountResponse create(@RequestBody BankAccountRequest bankAccountRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - BankAccountResponse bankAccountResponse = new BankAccountResponse(); - bankAccountResponse.setResponseInfo(getResponseInfo(bankAccountRequest.getRequestInfo())); - List bankaccounts = new ArrayList<>(); - BankAccount bankAccount; - List bankAccountContracts = new ArrayList<>(); - BankAccountContract contract; - - bankAccountRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (BankAccountContract bankAccountContract : bankAccountRequest.getBankAccounts()) { - bankAccount = new BankAccount(); - model.map(bankAccountContract, bankAccount); - bankAccount.setCreatedDate(new Date()); - bankAccount.setCreatedBy(bankAccountRequest.getRequestInfo().getUserInfo()); - bankAccount.setLastModifiedBy(bankAccountRequest.getRequestInfo().getUserInfo()); - bankaccounts.add(bankAccount); - } - - bankaccounts = bankAccountService.create(bankaccounts, errors, bankAccountRequest.getRequestInfo()); - - for (BankAccount f : bankaccounts) { - contract = new BankAccountContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - bankAccountContracts.add(contract); - } - - bankAccountResponse.setBankAccounts(bankAccountContracts); - - return bankAccountResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public BankAccountResponse update(@RequestBody BankAccountRequest bankAccountRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - bankAccountRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - BankAccountResponse bankAccountResponse = new BankAccountResponse(); - List bankaccounts = new ArrayList<>(); - bankAccountResponse.setResponseInfo(getResponseInfo(bankAccountRequest.getRequestInfo())); - BankAccount bankAccount; - BankAccountContract contract; - List bankAccountContracts = new ArrayList<>(); - - for (BankAccountContract bankAccountContract : bankAccountRequest.getBankAccounts()) { - bankAccount = new BankAccount(); - model.map(bankAccountContract, bankAccount); - bankAccount.setLastModifiedBy(bankAccountRequest.getRequestInfo().getUserInfo()); - bankAccount.setLastModifiedDate(new Date()); - bankaccounts.add(bankAccount); - } - - bankaccounts = bankAccountService.update(bankaccounts, errors, bankAccountRequest.getRequestInfo()); - - for (BankAccount bankAccountObj : bankaccounts) { - contract = new BankAccountContract(); - model.map(bankAccountObj, contract); - bankAccountObj.setLastModifiedDate(new Date()); - bankAccountContracts.add(contract); - } - - bankAccountResponse.setBankAccounts(bankAccountContracts); - - return bankAccountResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public BankAccountResponse search(@ModelAttribute BankAccountSearchContract bankAccountSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - BankAccountSearch domain = new BankAccountSearch(); - mapper.map(bankAccountSearchContract, domain); - BankAccountContract contract; - ModelMapper model = new ModelMapper(); - List bankAccountContracts = new ArrayList<>(); - Pagination bankaccounts = bankAccountService.search(domain, errors); - - for (BankAccount bankAccount : bankaccounts.getPagedData()) { - contract = new BankAccountContract(); - model.map(bankAccount, contract); - bankAccountContracts.add(contract); - } - - BankAccountResponse response = new BankAccountResponse(); - response.setBankAccounts(bankAccountContracts); - response.setPage(new PaginationContract(bankaccounts)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankBranchController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankBranchController.java deleted file mode 100644 index ac79bc2907f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankBranchController.java +++ /dev/null @@ -1,145 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.domain.service.BankBranchService; -import org.egov.egf.master.web.contract.BankBranchContract; -import org.egov.egf.master.web.contract.BankBranchSearchContract; -import org.egov.egf.master.web.requests.BankBranchRequest; -import org.egov.egf.master.web.requests.BankBranchResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/bankbranches") -public class BankBranchController { - - @Autowired - private BankBranchService bankBranchService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public BankBranchResponse create(@RequestBody BankBranchRequest bankBranchRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - BankBranchResponse bankBranchResponse = new BankBranchResponse(); - bankBranchResponse.setResponseInfo(getResponseInfo(bankBranchRequest.getRequestInfo())); - List bankbranches = new ArrayList<>(); - BankBranch bankBranch; - List bankBranchContracts = new ArrayList<>(); - BankBranchContract contract; - - bankBranchRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (BankBranchContract bankBranchContract : bankBranchRequest.getBankBranches()) { - bankBranch = new BankBranch(); - model.map(bankBranchContract, bankBranch); - bankBranch.setCreatedDate(new Date()); - bankBranch.setCreatedBy(bankBranchRequest.getRequestInfo().getUserInfo()); - bankBranch.setLastModifiedBy(bankBranchRequest.getRequestInfo().getUserInfo()); - bankbranches.add(bankBranch); - } - - bankbranches = bankBranchService.create(bankbranches, errors, bankBranchRequest.getRequestInfo()); - - for (BankBranch f : bankbranches) { - contract = new BankBranchContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - bankBranchContracts.add(contract); - } - - bankBranchResponse.setBankBranches(bankBranchContracts); - - return bankBranchResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public BankBranchResponse update(@RequestBody BankBranchRequest bankBranchRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - bankBranchRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - BankBranchResponse bankBranchResponse = new BankBranchResponse(); - List bankbranches = new ArrayList<>(); - bankBranchResponse.setResponseInfo(getResponseInfo(bankBranchRequest.getRequestInfo())); - BankBranch bankBranch; - BankBranchContract contract; - List bankBranchContracts = new ArrayList<>(); - - for (BankBranchContract bankBranchContract : bankBranchRequest.getBankBranches()) { - bankBranch = new BankBranch(); - model.map(bankBranchContract, bankBranch); - bankBranch.setLastModifiedBy(bankBranchRequest.getRequestInfo().getUserInfo()); - bankBranch.setLastModifiedDate(new Date()); - bankbranches.add(bankBranch); - } - - bankbranches = bankBranchService.update(bankbranches, errors, bankBranchRequest.getRequestInfo()); - - for (BankBranch bankBranchObj : bankbranches) { - contract = new BankBranchContract(); - model.map(bankBranchObj, contract); - bankBranchObj.setLastModifiedDate(new Date()); - bankBranchContracts.add(contract); - } - - bankBranchResponse.setBankBranches(bankBranchContracts); - - return bankBranchResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public BankBranchResponse search(@ModelAttribute BankBranchSearchContract bankBranchSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - BankBranchSearch domain = new BankBranchSearch(); - mapper.map(bankBranchSearchContract, domain); - BankBranchContract contract; - ModelMapper model = new ModelMapper(); - List bankBranchContracts = new ArrayList<>(); - Pagination bankbranches = bankBranchService.search(domain, errors); - - for (BankBranch bankBranch : bankbranches.getPagedData()) { - contract = new BankBranchContract(); - model.map(bankBranch, contract); - bankBranchContracts.add(contract); - } - - BankBranchResponse response = new BankBranchResponse(); - response.setBankBranches(bankBranchContracts); - response.setPage(new PaginationContract(bankbranches)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankController.java deleted file mode 100644 index 29c641c6b9f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BankController.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.domain.service.BankService; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.BankSearchContract; -import org.egov.egf.master.web.requests.BankRequest; -import org.egov.egf.master.web.requests.BankResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/banks") -public class BankController { - - @Autowired - private BankService bankService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public BankResponse create(@RequestBody BankRequest bankRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - BankResponse bankResponse = new BankResponse(); - bankResponse.setResponseInfo(getResponseInfo(bankRequest.getRequestInfo())); - List banks = new ArrayList<>(); - Bank bank; - List bankContracts = new ArrayList<>(); - BankContract contract; - - bankRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (BankContract bankContract : bankRequest.getBanks()) { - bank = new Bank(); - model.map(bankContract, bank); - bank.setCreatedDate(new Date()); - bank.setCreatedBy(bankRequest.getRequestInfo().getUserInfo()); - bank.setLastModifiedBy(bankRequest.getRequestInfo().getUserInfo()); - banks.add(bank); - } - - banks = bankService.create(banks, errors, bankRequest.getRequestInfo()); - - for (Bank f : banks) { - contract = new BankContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - bankContracts.add(contract); - } - - bankResponse.setBanks(bankContracts); - - return bankResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public BankResponse update(@RequestBody BankRequest bankRequest, BindingResult errors,@RequestParam String tenantId) { - - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - bankRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - BankResponse bankResponse = new BankResponse(); - List banks = new ArrayList<>(); - bankResponse.setResponseInfo(getResponseInfo(bankRequest.getRequestInfo())); - Bank bank; - BankContract contract; - List bankContracts = new ArrayList<>(); - - for (BankContract bankContract : bankRequest.getBanks()) { - bank = new Bank(); - model.map(bankContract, bank); - bank.setLastModifiedBy(bankRequest.getRequestInfo().getUserInfo()); - bank.setLastModifiedDate(new Date()); - banks.add(bank); - } - - banks = bankService.update(banks, errors, bankRequest.getRequestInfo()); - - for (Bank bankObj : banks) { - contract = new BankContract(); - model.map(bankObj, contract); - bankObj.setLastModifiedDate(new Date()); - bankContracts.add(contract); - } - - bankResponse.setBanks(bankContracts); - - return bankResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public BankResponse search(@ModelAttribute BankSearchContract bankSearchContract, @RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - BankSearch domain = new BankSearch(); - mapper.map(bankSearchContract, domain); - BankContract contract; - ModelMapper model = new ModelMapper(); - List bankContracts = new ArrayList<>(); - Pagination banks = bankService.search(domain, errors); - - for (Bank bank : banks.getPagedData()) { - contract = new BankContract(); - model.map(bank, contract); - bankContracts.add(contract); - } - - BankResponse response = new BankResponse(); - response.setBanks(bankContracts); - response.setPage(new PaginationContract(banks)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BudgetGroupController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BudgetGroupController.java deleted file mode 100644 index 1cf22a2cc28..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/BudgetGroupController.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.BudgetGroup; -import org.egov.egf.master.domain.model.BudgetGroupSearch; -import org.egov.egf.master.domain.service.BudgetGroupService; -import org.egov.egf.master.web.contract.BudgetGroupContract; -import org.egov.egf.master.web.contract.BudgetGroupSearchContract; -import org.egov.egf.master.web.requests.BudgetGroupRequest; -import org.egov.egf.master.web.requests.BudgetGroupResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/budgetgroups") -public class BudgetGroupController { - - @Autowired - private BudgetGroupService budgetGroupService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public BudgetGroupResponse create(@RequestBody BudgetGroupRequest budgetGroupRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - BudgetGroupResponse budgetGroupResponse = new BudgetGroupResponse(); - budgetGroupResponse.setResponseInfo(getResponseInfo(budgetGroupRequest.getRequestInfo())); - List budgetgroups = new ArrayList<>(); - BudgetGroup budgetGroup; - List budgetGroupContracts = new ArrayList<>(); - BudgetGroupContract contract; - - budgetGroupRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (BudgetGroupContract budgetGroupContract : budgetGroupRequest.getBudgetGroups()) { - budgetGroup = new BudgetGroup(); - model.map(budgetGroupContract, budgetGroup); - budgetGroup.setCreatedDate(new Date()); - budgetGroup.setCreatedBy(budgetGroupRequest.getRequestInfo().getUserInfo()); - budgetGroup.setLastModifiedBy(budgetGroupRequest.getRequestInfo().getUserInfo()); - budgetgroups.add(budgetGroup); - } - - budgetgroups = budgetGroupService.add(budgetgroups, errors); - - for (BudgetGroup f : budgetgroups) { - contract = new BudgetGroupContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - budgetGroupContracts.add(contract); - } - - budgetGroupRequest.setBudgetGroups(budgetGroupContracts); - budgetGroupService.addToQue(budgetGroupRequest); - budgetGroupResponse.setBudgetGroups(budgetGroupContracts); - - return budgetGroupResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public BudgetGroupResponse update(@RequestBody BudgetGroupRequest budgetGroupRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - budgetGroupRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - BudgetGroupResponse budgetGroupResponse = new BudgetGroupResponse(); - List budgetgroups = new ArrayList<>(); - budgetGroupResponse.setResponseInfo(getResponseInfo(budgetGroupRequest.getRequestInfo())); - BudgetGroup budgetGroup; - BudgetGroupContract contract; - List budgetGroupContracts = new ArrayList<>(); - - for (BudgetGroupContract budgetGroupContract : budgetGroupRequest.getBudgetGroups()) { - budgetGroup = new BudgetGroup(); - model.map(budgetGroupContract, budgetGroup); - budgetGroup.setLastModifiedBy(budgetGroupRequest.getRequestInfo().getUserInfo()); - budgetGroup.setLastModifiedDate(new Date()); - budgetgroups.add(budgetGroup); - } - - budgetgroups = budgetGroupService.update(budgetgroups, errors); - - for (BudgetGroup budgetGroupObj : budgetgroups) { - contract = new BudgetGroupContract(); - model.map(budgetGroupObj, contract); - budgetGroupObj.setLastModifiedDate(new Date()); - budgetGroupContracts.add(contract); - } - - budgetGroupRequest.setBudgetGroups(budgetGroupContracts); - budgetGroupService.addToQue(budgetGroupRequest); - budgetGroupResponse.setBudgetGroups(budgetGroupContracts); - - return budgetGroupResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public BudgetGroupResponse search(@ModelAttribute BudgetGroupSearchContract budgetGroupSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - BudgetGroupSearch domain = new BudgetGroupSearch(); - mapper.map(budgetGroupSearchContract, domain); - BudgetGroupContract contract; - ModelMapper model = new ModelMapper(); - List budgetGroupContracts = new ArrayList<>(); - Pagination budgetgroups = budgetGroupService.search(domain, errors); - - for (BudgetGroup budgetGroup : budgetgroups.getPagedData()) { - contract = new BudgetGroupContract(); - model.map(budgetGroup, contract); - budgetGroupContracts.add(contract); - } - - BudgetGroupResponse response = new BudgetGroupResponse(); - response.setBudgetGroups(budgetGroupContracts); - response.setPage(new PaginationContract(budgetgroups)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/ChartOfAccountController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/ChartOfAccountController.java deleted file mode 100644 index 0fb9b34890d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/ChartOfAccountController.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.service.ChartOfAccountService; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.contract.ChartOfAccountSearchContract; -import org.egov.egf.master.web.requests.ChartOfAccountRequest; -import org.egov.egf.master.web.requests.ChartOfAccountResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/chartofaccounts") -public class ChartOfAccountController { - - @Autowired - private ChartOfAccountService chartOfAccountService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public ChartOfAccountResponse create(@RequestBody ChartOfAccountRequest chartOfAccountRequest, - BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - ChartOfAccountResponse chartOfAccountResponse = new ChartOfAccountResponse(); - chartOfAccountResponse.setResponseInfo(getResponseInfo(chartOfAccountRequest.getRequestInfo())); - List chartofaccounts = new ArrayList<>(); - ChartOfAccount chartOfAccount; - List chartOfAccountContracts = new ArrayList<>(); - ChartOfAccountContract contract; - - chartOfAccountRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (ChartOfAccountContract chartOfAccountContract : chartOfAccountRequest.getChartOfAccounts()) { - chartOfAccount = new ChartOfAccount(); - model.map(chartOfAccountContract, chartOfAccount); - chartOfAccount.setCreatedDate(new Date()); - chartOfAccount.setCreatedBy(chartOfAccountRequest.getRequestInfo().getUserInfo()); - chartOfAccount.setLastModifiedBy(chartOfAccountRequest.getRequestInfo().getUserInfo()); - chartofaccounts.add(chartOfAccount); - } - - chartofaccounts = chartOfAccountService.add(chartofaccounts, errors); - - for (ChartOfAccount f : chartofaccounts) { - contract = new ChartOfAccountContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - chartOfAccountContracts.add(contract); - } - - chartOfAccountRequest.setChartOfAccounts(chartOfAccountContracts); - chartOfAccountService.addToQue(chartOfAccountRequest); - chartOfAccountResponse.setChartOfAccounts(chartOfAccountContracts); - - return chartOfAccountResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public ChartOfAccountResponse update(@RequestBody ChartOfAccountRequest chartOfAccountRequest, - BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - chartOfAccountRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - ChartOfAccountResponse chartOfAccountResponse = new ChartOfAccountResponse(); - List chartofaccounts = new ArrayList<>(); - chartOfAccountResponse.setResponseInfo(getResponseInfo(chartOfAccountRequest.getRequestInfo())); - ChartOfAccount chartOfAccount; - ChartOfAccountContract contract; - List chartOfAccountContracts = new ArrayList<>(); - - for (ChartOfAccountContract chartOfAccountContract : chartOfAccountRequest.getChartOfAccounts()) { - chartOfAccount = new ChartOfAccount(); - model.map(chartOfAccountContract, chartOfAccount); - chartOfAccount.setLastModifiedBy(chartOfAccountRequest.getRequestInfo().getUserInfo()); - chartOfAccount.setLastModifiedDate(new Date()); - chartofaccounts.add(chartOfAccount); - } - - chartofaccounts = chartOfAccountService.update(chartofaccounts, errors); - - for (ChartOfAccount chartOfAccountObj : chartofaccounts) { - contract = new ChartOfAccountContract(); - model.map(chartOfAccountObj, contract); - chartOfAccountObj.setLastModifiedDate(new Date()); - chartOfAccountContracts.add(contract); - } - - chartOfAccountRequest.setChartOfAccounts(chartOfAccountContracts); - chartOfAccountService.addToQue(chartOfAccountRequest); - chartOfAccountResponse.setChartOfAccounts(chartOfAccountContracts); - - return chartOfAccountResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public ChartOfAccountResponse search(@ModelAttribute ChartOfAccountSearchContract chartOfAccountSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - ChartOfAccountSearch domain = new ChartOfAccountSearch(); - mapper.map(chartOfAccountSearchContract, domain); - ChartOfAccountContract contract; - ModelMapper model = new ModelMapper(); - List chartOfAccountContracts = new ArrayList<>(); - Pagination chartofaccounts = chartOfAccountService.search(domain, errors); - - for (ChartOfAccount chartOfAccount : chartofaccounts.getPagedData()) { - contract = new ChartOfAccountContract(); - model.map(chartOfAccount, contract); - chartOfAccountContracts.add(contract); - } - - ChartOfAccountResponse response = new ChartOfAccountResponse(); - response.setChartOfAccounts(chartOfAccountContracts); - response.setPage(new PaginationContract(chartofaccounts)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/ChartOfAccountDetailController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/ChartOfAccountDetailController.java deleted file mode 100644 index af8a8c767e4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/ChartOfAccountDetailController.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.domain.service.ChartOfAccountDetailService; -import org.egov.egf.master.web.contract.ChartOfAccountDetailContract; -import org.egov.egf.master.web.contract.ChartOfAccountDetailSearchContract; -import org.egov.egf.master.web.requests.ChartOfAccountDetailRequest; -import org.egov.egf.master.web.requests.ChartOfAccountDetailResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/chartofaccountdetails") -public class ChartOfAccountDetailController { - - @Autowired - private ChartOfAccountDetailService chartOfAccountDetailService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public ChartOfAccountDetailResponse create(@RequestBody ChartOfAccountDetailRequest chartOfAccountDetailRequest, - BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - ChartOfAccountDetailResponse chartOfAccountDetailResponse = new ChartOfAccountDetailResponse(); - chartOfAccountDetailResponse.setResponseInfo(getResponseInfo(chartOfAccountDetailRequest.getRequestInfo())); - List chartofaccountdetails = new ArrayList<>(); - ChartOfAccountDetail chartOfAccountDetail; - List chartOfAccountDetailContracts = new ArrayList<>(); - ChartOfAccountDetailContract contract; - - chartOfAccountDetailRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (ChartOfAccountDetailContract chartOfAccountDetailContract : chartOfAccountDetailRequest - .getChartOfAccountDetails()) { - chartOfAccountDetail = new ChartOfAccountDetail(); - model.map(chartOfAccountDetailContract, chartOfAccountDetail); - chartOfAccountDetail.setCreatedDate(new Date()); - chartOfAccountDetail.setCreatedBy(chartOfAccountDetailRequest.getRequestInfo().getUserInfo()); - chartOfAccountDetail.setLastModifiedBy(chartOfAccountDetailRequest.getRequestInfo().getUserInfo()); - chartofaccountdetails.add(chartOfAccountDetail); - } - - chartofaccountdetails = chartOfAccountDetailService.add(chartofaccountdetails, errors); - - for (ChartOfAccountDetail f : chartofaccountdetails) { - contract = new ChartOfAccountDetailContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - chartOfAccountDetailContracts.add(contract); - } - - chartOfAccountDetailRequest.setChartOfAccountDetails(chartOfAccountDetailContracts); - chartOfAccountDetailService.addToQue(chartOfAccountDetailRequest); - chartOfAccountDetailResponse.setChartOfAccountDetails(chartOfAccountDetailContracts); - - return chartOfAccountDetailResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public ChartOfAccountDetailResponse update(@RequestBody ChartOfAccountDetailRequest chartOfAccountDetailRequest, - BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - chartOfAccountDetailRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - ChartOfAccountDetailResponse chartOfAccountDetailResponse = new ChartOfAccountDetailResponse(); - List chartofaccountdetails = new ArrayList<>(); - chartOfAccountDetailResponse.setResponseInfo(getResponseInfo(chartOfAccountDetailRequest.getRequestInfo())); - ChartOfAccountDetail chartOfAccountDetail; - ChartOfAccountDetailContract contract; - List chartOfAccountDetailContracts = new ArrayList<>(); - - for (ChartOfAccountDetailContract chartOfAccountDetailContract : chartOfAccountDetailRequest - .getChartOfAccountDetails()) { - chartOfAccountDetail = new ChartOfAccountDetail(); - model.map(chartOfAccountDetailContract, chartOfAccountDetail); - chartOfAccountDetail.setLastModifiedBy(chartOfAccountDetailRequest.getRequestInfo().getUserInfo()); - chartOfAccountDetail.setLastModifiedDate(new Date()); - chartofaccountdetails.add(chartOfAccountDetail); - } - - chartofaccountdetails = chartOfAccountDetailService.update(chartofaccountdetails, errors); - - for (ChartOfAccountDetail chartOfAccountDetailObj : chartofaccountdetails) { - contract = new ChartOfAccountDetailContract(); - model.map(chartOfAccountDetailObj, contract); - chartOfAccountDetailObj.setLastModifiedDate(new Date()); - chartOfAccountDetailContracts.add(contract); - } - - chartOfAccountDetailRequest.setChartOfAccountDetails(chartOfAccountDetailContracts); - chartOfAccountDetailService.addToQue(chartOfAccountDetailRequest); - chartOfAccountDetailResponse.setChartOfAccountDetails(chartOfAccountDetailContracts); - - return chartOfAccountDetailResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public ChartOfAccountDetailResponse search( - @ModelAttribute ChartOfAccountDetailSearchContract chartOfAccountDetailSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - ChartOfAccountDetailSearch domain = new ChartOfAccountDetailSearch(); - mapper.map(chartOfAccountDetailSearchContract, domain); - ChartOfAccountDetailContract contract; - ModelMapper model = new ModelMapper(); - List chartOfAccountDetailContracts = new ArrayList<>(); - Pagination chartofaccountdetails = chartOfAccountDetailService.search(domain, errors); - - for (ChartOfAccountDetail chartOfAccountDetail : chartofaccountdetails.getPagedData()) { - contract = new ChartOfAccountDetailContract(); - model.map(chartOfAccountDetail, contract); - chartOfAccountDetailContracts.add(contract); - } - - ChartOfAccountDetailResponse response = new ChartOfAccountDetailResponse(); - response.setChartOfAccountDetails(chartOfAccountDetailContracts); - response.setPage(new PaginationContract(chartofaccountdetails)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialConfigurationController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialConfigurationController.java deleted file mode 100644 index a52de514d96..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialConfigurationController.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.FinancialConfiguration; -import org.egov.egf.master.domain.model.FinancialConfigurationSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.web.contract.FinancialConfigurationContract; -import org.egov.egf.master.web.contract.FinancialConfigurationSearchContract; -import org.egov.egf.master.web.requests.FinancialConfigurationRequest; -import org.egov.egf.master.web.requests.FinancialConfigurationResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/financialconfigurations") -public class FinancialConfigurationController { - - @Autowired - private FinancialConfigurationService financialConfigurationService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FinancialConfigurationResponse create( - @RequestBody FinancialConfigurationRequest financialConfigurationRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FinancialConfigurationResponse financialConfigurationResponse = new FinancialConfigurationResponse(); - financialConfigurationResponse.setResponseInfo(getResponseInfo(financialConfigurationRequest.getRequestInfo())); - List financialconfigurations = new ArrayList<>(); - FinancialConfiguration financialConfiguration; - List financialConfigurationContracts = new ArrayList<>(); - FinancialConfigurationContract contract; - - financialConfigurationRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FinancialConfigurationContract financialConfigurationContract : financialConfigurationRequest - .getFinancialConfigurations()) { - financialConfiguration = new FinancialConfiguration(); - model.map(financialConfigurationContract, financialConfiguration); - financialConfiguration.setCreatedDate(new Date()); - financialConfiguration.setCreatedBy(financialConfigurationRequest.getRequestInfo().getUserInfo()); - financialConfiguration.setLastModifiedBy(financialConfigurationRequest.getRequestInfo().getUserInfo()); - financialconfigurations.add(financialConfiguration); - } - - financialconfigurations = financialConfigurationService.add(financialconfigurations, errors); - - for (FinancialConfiguration f : financialconfigurations) { - contract = new FinancialConfigurationContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - financialConfigurationContracts.add(contract); - } - - financialConfigurationRequest.setFinancialConfigurations(financialConfigurationContracts); - financialConfigurationService.addToQue(financialConfigurationRequest); - financialConfigurationResponse.setFinancialConfigurations(financialConfigurationContracts); - - return financialConfigurationResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FinancialConfigurationResponse update( - @RequestBody FinancialConfigurationRequest financialConfigurationRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - financialConfigurationRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FinancialConfigurationResponse financialConfigurationResponse = new FinancialConfigurationResponse(); - List financialconfigurations = new ArrayList<>(); - financialConfigurationResponse.setResponseInfo(getResponseInfo(financialConfigurationRequest.getRequestInfo())); - FinancialConfiguration financialConfiguration; - FinancialConfigurationContract contract; - List financialConfigurationContracts = new ArrayList<>(); - - for (FinancialConfigurationContract financialConfigurationContract : financialConfigurationRequest - .getFinancialConfigurations()) { - financialConfiguration = new FinancialConfiguration(); - model.map(financialConfigurationContract, financialConfiguration); - financialConfiguration.setLastModifiedBy(financialConfigurationRequest.getRequestInfo().getUserInfo()); - financialConfiguration.setLastModifiedDate(new Date()); - financialconfigurations.add(financialConfiguration); - } - - financialconfigurations = financialConfigurationService.update(financialconfigurations, errors); - - for (FinancialConfiguration financialConfigurationObj : financialconfigurations) { - contract = new FinancialConfigurationContract(); - model.map(financialConfigurationObj, contract); - financialConfigurationObj.setLastModifiedDate(new Date()); - financialConfigurationContracts.add(contract); - } - - financialConfigurationRequest.setFinancialConfigurations(financialConfigurationContracts); - financialConfigurationService.addToQue(financialConfigurationRequest); - financialConfigurationResponse.setFinancialConfigurations(financialConfigurationContracts); - - return financialConfigurationResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FinancialConfigurationResponse search( - @ModelAttribute FinancialConfigurationSearchContract financialConfigurationSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - FinancialConfigurationSearch domain = new FinancialConfigurationSearch(); - mapper.map(financialConfigurationSearchContract, domain); - FinancialConfigurationContract contract; - ModelMapper model = new ModelMapper(); - List financialConfigurationContracts = new ArrayList<>(); - Pagination financialconfigurations = financialConfigurationService.search(domain, errors); - - for (FinancialConfiguration financialConfiguration : financialconfigurations.getPagedData()) { - contract = new FinancialConfigurationContract(); - model.map(financialConfiguration, contract); - financialConfigurationContracts.add(contract); - } - - FinancialConfigurationResponse response = new FinancialConfigurationResponse(); - response.setFinancialConfigurations(financialConfigurationContracts); - response.setPage(new PaginationContract(financialconfigurations)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialStatusController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialStatusController.java deleted file mode 100644 index f3ffdab7ce3..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialStatusController.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.FinancialStatus; -import org.egov.egf.master.domain.model.FinancialStatusSearch; -import org.egov.egf.master.domain.service.FinancialStatusService; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.egov.egf.master.web.contract.FinancialStatusSearchContract; -import org.egov.egf.master.web.requests.FinancialStatusRequest; -import org.egov.egf.master.web.requests.FinancialStatusResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/financialstatuses") -public class FinancialStatusController { - - @Autowired - private FinancialStatusService financialStatusService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FinancialStatusResponse create(@RequestBody FinancialStatusRequest financialStatusRequest, - BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FinancialStatusResponse financialStatusResponse = new FinancialStatusResponse(); - financialStatusResponse.setResponseInfo(getResponseInfo(financialStatusRequest.getRequestInfo())); - List financialstatuses = new ArrayList<>(); - FinancialStatus financialStatus; - List financialStatusContracts = new ArrayList<>(); - FinancialStatusContract contract; - - financialStatusRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FinancialStatusContract financialStatusContract : financialStatusRequest.getFinancialStatuses()) { - financialStatus = new FinancialStatus(); - model.map(financialStatusContract, financialStatus); - financialStatus.setCreatedDate(new Date()); - financialStatus.setCreatedBy(financialStatusRequest.getRequestInfo().getUserInfo()); - financialStatus.setLastModifiedBy(financialStatusRequest.getRequestInfo().getUserInfo()); - financialstatuses.add(financialStatus); - } - - financialstatuses = financialStatusService.add(financialstatuses, errors); - - for (FinancialStatus f : financialstatuses) { - contract = new FinancialStatusContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - financialStatusContracts.add(contract); - } - - financialStatusRequest.setFinancialStatuses(financialStatusContracts); - financialStatusService.addToQue(financialStatusRequest); - financialStatusResponse.setFinancialStatuses(financialStatusContracts); - - return financialStatusResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FinancialStatusResponse update(@RequestBody FinancialStatusRequest financialStatusRequest, - BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - financialStatusRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FinancialStatusResponse financialStatusResponse = new FinancialStatusResponse(); - List financialstatuses = new ArrayList<>(); - financialStatusResponse.setResponseInfo(getResponseInfo(financialStatusRequest.getRequestInfo())); - FinancialStatus financialStatus; - FinancialStatusContract contract; - List financialStatusContracts = new ArrayList<>(); - - for (FinancialStatusContract financialStatusContract : financialStatusRequest.getFinancialStatuses()) { - financialStatus = new FinancialStatus(); - model.map(financialStatusContract, financialStatus); - financialStatus.setLastModifiedBy(financialStatusRequest.getRequestInfo().getUserInfo()); - financialStatus.setLastModifiedDate(new Date()); - financialstatuses.add(financialStatus); - } - - financialstatuses = financialStatusService.update(financialstatuses, errors); - - for (FinancialStatus financialStatusObj : financialstatuses) { - contract = new FinancialStatusContract(); - model.map(financialStatusObj, contract); - financialStatusObj.setLastModifiedDate(new Date()); - financialStatusContracts.add(contract); - } - - financialStatusRequest.setFinancialStatuses(financialStatusContracts); - financialStatusService.addToQue(financialStatusRequest); - financialStatusResponse.setFinancialStatuses(financialStatusContracts); - - return financialStatusResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FinancialStatusResponse search(@ModelAttribute FinancialStatusSearchContract financialStatusSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - FinancialStatusSearch domain = new FinancialStatusSearch(); - mapper.map(financialStatusSearchContract, domain); - FinancialStatusContract contract; - ModelMapper model = new ModelMapper(); - List financialStatusContracts = new ArrayList<>(); - Pagination financialstatuses = financialStatusService.search(domain, errors); - - for (FinancialStatus financialStatus : financialstatuses.getPagedData()) { - contract = new FinancialStatusContract(); - model.map(financialStatus, contract); - financialStatusContracts.add(contract); - } - - FinancialStatusResponse response = new FinancialStatusResponse(); - response.setFinancialStatuses(financialStatusContracts); - response.setPage(new PaginationContract(financialstatuses)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialYearController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialYearController.java deleted file mode 100644 index 13c00f1cb3c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FinancialYearController.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.FinancialYear; -import org.egov.egf.master.domain.model.FinancialYearSearch; -import org.egov.egf.master.domain.service.FinancialYearService; -import org.egov.egf.master.web.contract.FinancialYearContract; -import org.egov.egf.master.web.contract.FinancialYearSearchContract; -import org.egov.egf.master.web.requests.FinancialYearRequest; -import org.egov.egf.master.web.requests.FinancialYearResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/financialyears") -public class FinancialYearController { - - @Autowired - private FinancialYearService financialYearService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FinancialYearResponse create( - @RequestBody FinancialYearRequest financialYearContractRequest, - BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FinancialYearResponse financialYearResponse = new FinancialYearResponse(); - List financialyears = new ArrayList<>(); - FinancialYear financialYear; - List financialYearContracts = new ArrayList<>(); - FinancialYearContract contract; - - financialYearContractRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FinancialYearContract financialYearContract : financialYearContractRequest.getFinancialYears()) { - financialYear = new FinancialYear(); - model.map(financialYearContract, financialYear); - financialYear.setCreatedDate(new Date()); - financialYear.setCreatedBy(financialYearContractRequest.getRequestInfo().getUserInfo()); - financialYear.setLastModifiedBy(financialYearContractRequest.getRequestInfo().getUserInfo()); - financialyears.add(financialYear); - } - - financialyears = financialYearService.add(financialyears, errors); - - for (FinancialYear f : financialyears) { - contract = new FinancialYearContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - financialYearContracts.add(contract); - } - - financialYearContractRequest.setFinancialYears(financialYearContracts); - financialYearService.addToQue(financialYearContractRequest); - financialYearResponse.setFinancialYears(financialYearContracts); - - return financialYearResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FinancialYearResponse update( - @RequestBody FinancialYearRequest financialYearContractRequest, - BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - financialYearContractRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FinancialYearResponse financialYearResponse = new FinancialYearResponse(); - List financialyears = new ArrayList<>(); - FinancialYear financialYear; - FinancialYearContract contract; - List financialYearContracts = new ArrayList<>(); - - for (FinancialYearContract financialYearContract : financialYearContractRequest.getFinancialYears()) { - financialYear = new FinancialYear(); - model.map(financialYearContract, financialYear); - financialYear.setLastModifiedDate(new Date()); - financialYear.setLastModifiedBy(financialYearContractRequest.getRequestInfo().getUserInfo()); - financialyears.add(financialYear); - } - - financialyears = financialYearService.update(financialyears, errors); - - for (FinancialYear financialYearObj : financialyears) { - contract = new FinancialYearContract(); - model.map(financialYearObj, contract); - contract.setLastModifiedDate(new Date()); - financialYearContracts.add(contract); - } - - financialYearContractRequest.setFinancialYears(financialYearContracts); - financialYearService.addToQue(financialYearContractRequest); - financialYearResponse.setFinancialYears(financialYearContracts); - - return financialYearResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FinancialYearResponse search( - @ModelAttribute FinancialYearSearchContract financialYearSearchContract, @RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - FinancialYearSearch domain = new FinancialYearSearch(); - mapper.map(financialYearSearchContract, domain); - FinancialYearContract contract; - ModelMapper model = new ModelMapper(); - List financialYearContracts = new ArrayList<>(); - - Pagination financialyears = financialYearService.search(domain, errors); - - for (FinancialYear financialYear : financialyears.getPagedData()) { - contract = new FinancialYearContract(); - model.map(financialYear, contract); - financialYearContracts.add(contract); - } - - FinancialYearResponse response = new FinancialYearResponse(); - response.setFinancialYears(financialYearContracts); - response.setPage(new PaginationContract(financialyears)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FiscalPeriodController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FiscalPeriodController.java deleted file mode 100644 index 048036a00ed..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FiscalPeriodController.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.FiscalPeriod; -import org.egov.egf.master.domain.model.FiscalPeriodSearch; -import org.egov.egf.master.domain.service.FiscalPeriodService; -import org.egov.egf.master.web.contract.FiscalPeriodContract; -import org.egov.egf.master.web.contract.FiscalPeriodSearchContract; -import org.egov.egf.master.web.requests.FiscalPeriodRequest; -import org.egov.egf.master.web.requests.FiscalPeriodResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/fiscalperiods") -public class FiscalPeriodController { - - @Autowired - private FiscalPeriodService fiscalPeriodService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FiscalPeriodResponse create(@RequestBody FiscalPeriodRequest fiscalPeriodRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FiscalPeriodResponse fiscalPeriodResponse = new FiscalPeriodResponse(); - fiscalPeriodResponse.setResponseInfo(getResponseInfo(fiscalPeriodRequest.getRequestInfo())); - List fiscalperiods = new ArrayList<>(); - FiscalPeriod fiscalPeriod; - List fiscalPeriodContracts = new ArrayList<>(); - FiscalPeriodContract contract; - - fiscalPeriodRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FiscalPeriodContract fiscalPeriodContract : fiscalPeriodRequest.getFiscalPeriods()) { - fiscalPeriod = new FiscalPeriod(); - model.map(fiscalPeriodContract, fiscalPeriod); - fiscalPeriod.setCreatedDate(new Date()); - fiscalPeriod.setCreatedBy(fiscalPeriodRequest.getRequestInfo().getUserInfo()); - fiscalPeriod.setLastModifiedBy(fiscalPeriodRequest.getRequestInfo().getUserInfo()); - fiscalperiods.add(fiscalPeriod); - } - - fiscalperiods = fiscalPeriodService.add(fiscalperiods, errors); - - for (FiscalPeriod f : fiscalperiods) { - contract = new FiscalPeriodContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - fiscalPeriodContracts.add(contract); - } - - fiscalPeriodRequest.setFiscalPeriods(fiscalPeriodContracts); - fiscalPeriodService.addToQue(fiscalPeriodRequest); - fiscalPeriodResponse.setFiscalPeriods(fiscalPeriodContracts); - - return fiscalPeriodResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FiscalPeriodResponse update(@RequestBody FiscalPeriodRequest fiscalPeriodRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - fiscalPeriodRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FiscalPeriodResponse fiscalPeriodResponse = new FiscalPeriodResponse(); - List fiscalperiods = new ArrayList<>(); - fiscalPeriodResponse.setResponseInfo(getResponseInfo(fiscalPeriodRequest.getRequestInfo())); - FiscalPeriod fiscalPeriod; - FiscalPeriodContract contract; - List fiscalPeriodContracts = new ArrayList<>(); - - for (FiscalPeriodContract fiscalPeriodContract : fiscalPeriodRequest.getFiscalPeriods()) { - fiscalPeriod = new FiscalPeriod(); - model.map(fiscalPeriodContract, fiscalPeriod); - fiscalPeriod.setLastModifiedBy(fiscalPeriodRequest.getRequestInfo().getUserInfo()); - fiscalPeriod.setLastModifiedDate(new Date()); - fiscalperiods.add(fiscalPeriod); - } - - fiscalperiods = fiscalPeriodService.update(fiscalperiods, errors); - - for (FiscalPeriod fiscalPeriodObj : fiscalperiods) { - contract = new FiscalPeriodContract(); - model.map(fiscalPeriodObj, contract); - fiscalPeriodObj.setLastModifiedDate(new Date()); - fiscalPeriodContracts.add(contract); - } - - fiscalPeriodRequest.setFiscalPeriods(fiscalPeriodContracts); - fiscalPeriodService.addToQue(fiscalPeriodRequest); - fiscalPeriodResponse.setFiscalPeriods(fiscalPeriodContracts); - - return fiscalPeriodResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FiscalPeriodResponse search(@ModelAttribute FiscalPeriodSearchContract fiscalPeriodSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - FiscalPeriodSearch domain = new FiscalPeriodSearch(); - mapper.map(fiscalPeriodSearchContract, domain); - FiscalPeriodContract contract; - ModelMapper model = new ModelMapper(); - List fiscalPeriodContracts = new ArrayList<>(); - Pagination fiscalperiods = fiscalPeriodService.search(domain, errors); - - for (FiscalPeriod fiscalPeriod : fiscalperiods.getPagedData()) { - contract = new FiscalPeriodContract(); - model.map(fiscalPeriod, contract); - fiscalPeriodContracts.add(contract); - } - - FiscalPeriodResponse response = new FiscalPeriodResponse(); - response.setFiscalPeriods(fiscalPeriodContracts); - response.setPage(new PaginationContract(fiscalperiods)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FunctionController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FunctionController.java deleted file mode 100644 index c3705d5995b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FunctionController.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.domain.service.FunctionService; -import org.egov.egf.master.web.contract.FunctionContract; -import org.egov.egf.master.web.contract.FunctionSearchContract; -import org.egov.egf.master.web.requests.FunctionRequest; -import org.egov.egf.master.web.requests.FunctionResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/functions") -public class FunctionController { - - @Autowired - private FunctionService functionService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FunctionResponse create(@RequestBody FunctionRequest functionRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FunctionResponse functionResponse = new FunctionResponse(); - functionResponse.setResponseInfo(getResponseInfo(functionRequest.getRequestInfo())); - List functions = new ArrayList<>(); - Function function; - List functionContracts = new ArrayList<>(); - FunctionContract contract; - - functionRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FunctionContract functionContract : functionRequest.getFunctions()) { - function = new Function(); - model.map(functionContract, function); - function.setCreatedDate(new Date()); - function.setCreatedBy(functionRequest.getRequestInfo().getUserInfo()); - function.setLastModifiedBy(functionRequest.getRequestInfo().getUserInfo()); - functions.add(function); - } - - functions = functionService.create(functions, errors, functionRequest.getRequestInfo()); - - for (Function f : functions) { - contract = new FunctionContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - functionContracts.add(contract); - } - - functionResponse.setFunctions(functionContracts); - - return functionResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FunctionResponse update(@RequestBody FunctionRequest functionRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - functionRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FunctionResponse functionResponse = new FunctionResponse(); - List functions = new ArrayList<>(); - functionResponse.setResponseInfo(getResponseInfo(functionRequest.getRequestInfo())); - Function function; - FunctionContract contract; - List functionContracts = new ArrayList<>(); - for (FunctionContract functionContract : functionRequest.getFunctions()) { - function = new Function(); - model.map(functionContract, function); - function.setLastModifiedBy(functionRequest.getRequestInfo().getUserInfo()); - function.setLastModifiedDate(new Date()); - functions.add(function); - } - - functions = functionService.update(functions, errors, functionRequest.getRequestInfo()); - - for (Function functionObj : functions) { - contract = new FunctionContract(); - model.map(functionObj, contract); - functionObj.setLastModifiedDate(new Date()); - functionContracts.add(contract); - } - - functionResponse.setFunctions(functionContracts); - - return functionResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FunctionResponse search(@ModelAttribute FunctionSearchContract functionSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - FunctionSearch domain = new FunctionSearch(); - mapper.map(functionSearchContract, domain); - FunctionContract contract; - ModelMapper model = new ModelMapper(); - List functionContracts = new ArrayList<>(); - Pagination functions = functionService.search(domain, errors); - - for (Function function : functions.getPagedData()) { - contract = new FunctionContract(); - model.map(function, contract); - functionContracts.add(contract); - } - - FunctionResponse response = new FunctionResponse(); - response.setFunctions(functionContracts); - response.setPage(new PaginationContract(functions)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FunctionaryController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FunctionaryController.java deleted file mode 100644 index 9d4b3f9e8cd..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FunctionaryController.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.Functionary; -import org.egov.egf.master.domain.model.FunctionarySearch; -import org.egov.egf.master.domain.service.FunctionaryService; -import org.egov.egf.master.web.contract.FunctionaryContract; -import org.egov.egf.master.web.contract.FunctionarySearchContract; -import org.egov.egf.master.web.requests.FunctionaryRequest; -import org.egov.egf.master.web.requests.FunctionaryResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/functionaries") -public class FunctionaryController { - - @Autowired - private FunctionaryService functionaryService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FunctionaryResponse create(@RequestBody FunctionaryRequest functionaryRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FunctionaryResponse functionaryResponse = new FunctionaryResponse(); - functionaryResponse.setResponseInfo(getResponseInfo(functionaryRequest.getRequestInfo())); - List functionaries = new ArrayList<>(); - Functionary functionary; - List functionaryContracts = new ArrayList<>(); - FunctionaryContract contract; - - functionaryRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FunctionaryContract functionaryContract : functionaryRequest.getFunctionaries()) { - functionary = new Functionary(); - model.map(functionaryContract, functionary); - functionary.setCreatedDate(new Date()); - functionary.setCreatedBy(functionaryRequest.getRequestInfo().getUserInfo()); - functionary.setLastModifiedBy(functionaryRequest.getRequestInfo().getUserInfo()); - functionaries.add(functionary); - } - - functionaries = functionaryService.add(functionaries, errors); - - for (Functionary f : functionaries) { - contract = new FunctionaryContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - functionaryContracts.add(contract); - } - - functionaryRequest.setFunctionaries(functionaryContracts); - functionaryService.addToQue(functionaryRequest); - functionaryResponse.setFunctionaries(functionaryContracts); - - return functionaryResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FunctionaryResponse update(@RequestBody FunctionaryRequest functionaryRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - functionaryRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FunctionaryResponse functionaryResponse = new FunctionaryResponse(); - List functionaries = new ArrayList<>(); - functionaryResponse.setResponseInfo(getResponseInfo(functionaryRequest.getRequestInfo())); - Functionary functionary; - FunctionaryContract contract; - List functionaryContracts = new ArrayList<>(); - - for (FunctionaryContract functionaryContract : functionaryRequest.getFunctionaries()) { - functionary = new Functionary(); - model.map(functionaryContract, functionary); - functionary.setLastModifiedBy(functionaryRequest.getRequestInfo().getUserInfo()); - functionary.setLastModifiedDate(new Date()); - functionaries.add(functionary); - } - - functionaries = functionaryService.update(functionaries, errors); - - for (Functionary functionaryObj : functionaries) { - contract = new FunctionaryContract(); - model.map(functionaryObj, contract); - functionaryObj.setLastModifiedDate(new Date()); - functionaryContracts.add(contract); - } - - functionaryRequest.setFunctionaries(functionaryContracts); - functionaryService.addToQue(functionaryRequest); - functionaryResponse.setFunctionaries(functionaryContracts); - - return functionaryResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FunctionaryResponse search(@ModelAttribute FunctionarySearchContract functionarySearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - FunctionarySearch domain = new FunctionarySearch(); - mapper.map(functionarySearchContract, domain); - FunctionaryContract contract; - ModelMapper model = new ModelMapper(); - List functionaryContracts = new ArrayList<>(); - Pagination functionaries = functionaryService.search(domain, errors); - - for (Functionary functionary : functionaries.getPagedData()) { - contract = new FunctionaryContract(); - model.map(functionary, contract); - functionaryContracts.add(contract); - } - - FunctionaryResponse response = new FunctionaryResponse(); - response.setFunctionaries(functionaryContracts); - response.setPage(new PaginationContract(functionaries)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FundController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FundController.java deleted file mode 100644 index 4e2189f0220..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FundController.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.domain.service.FundService; -import org.egov.egf.master.web.contract.FundContract; -import org.egov.egf.master.web.contract.FundSearchContract; -import org.egov.egf.master.web.requests.FundRequest; -import org.egov.egf.master.web.requests.FundResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/funds") -public class FundController { - - @Autowired - private FundService fundService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FundResponse create(@RequestBody FundRequest fundRequest, BindingResult errors,@RequestParam String tenantId) { - - ApplicationThreadLocals.setRequestInfo(fundRequest.getRequestInfo()); -// ApplicationThreadLocals.setTenantId(); - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FundResponse fundResponse = new FundResponse(); - fundResponse.setResponseInfo(getResponseInfo(fundRequest.getRequestInfo())); - List funds = new ArrayList<>(); - Fund fund; - List fundContracts = new ArrayList<>(); - FundContract contract; - - fundRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FundContract fundContract : fundRequest.getFunds()) { - fund = new Fund(); - model.map(fundContract, fund); - fund.setCreatedDate(new Date()); - fund.setCreatedBy(fundRequest.getRequestInfo().getUserInfo()); - fund.setLastModifiedBy(fundRequest.getRequestInfo().getUserInfo()); - funds.add(fund); - } - - funds = fundService.create(funds, errors, fundRequest.getRequestInfo()); - - for (Fund f : funds) { - contract = new FundContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - fundContracts.add(contract); - } - - fundResponse.setFunds(fundContracts); - - return fundResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FundResponse update(@RequestBody FundRequest fundRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - fundRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FundResponse fundResponse = new FundResponse(); - List funds = new ArrayList<>(); - fundResponse.setResponseInfo(getResponseInfo(fundRequest.getRequestInfo())); - Fund fund; - FundContract contract; - List fundContracts = new ArrayList<>(); - - for (FundContract fundContract : fundRequest.getFunds()) { - fund = new Fund(); - model.map(fundContract, fund); - fund.setLastModifiedBy(fundRequest.getRequestInfo().getUserInfo()); - fund.setLastModifiedDate(new Date()); - funds.add(fund); - } - - funds = fundService.update(funds, errors, fundRequest.getRequestInfo()); - - for (Fund fundObj : funds) { - contract = new FundContract(); - model.map(fundObj, contract); - fundObj.setLastModifiedDate(new Date()); - fundContracts.add(contract); - } - - fundResponse.setFunds(fundContracts); - - return fundResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FundResponse search(@ModelAttribute FundSearchContract fundSearchContract, @RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - System.out.println("requestInfo in FundController Search "+requestInfo.toString()); - System.out.println("requestInfo in FundController Search "+requestInfo.getAuthToken()); - ModelMapper mapper = new ModelMapper(); - FundSearch domain = new FundSearch(); - mapper.map(fundSearchContract, domain); - FundContract contract; - ModelMapper model = new ModelMapper(); - List fundContracts = new ArrayList<>(); - Pagination funds = fundService.search(domain, errors); - - if (funds.getPagedData() != null) { - for (Fund fund : funds.getPagedData()) { - contract = new FundContract(); - model.map(fund, contract); - fundContracts.add(contract); - } - } - - FundResponse response = new FundResponse(); - response.setFunds(fundContracts); - response.setPage(new PaginationContract(funds)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FundsourceController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FundsourceController.java deleted file mode 100644 index d04d3b584f6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/FundsourceController.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.Fundsource; -import org.egov.egf.master.domain.model.FundsourceSearch; -import org.egov.egf.master.domain.service.FundsourceService; -import org.egov.egf.master.web.contract.FundsourceContract; -import org.egov.egf.master.web.contract.FundsourceSearchContract; -import org.egov.egf.master.web.requests.FundsourceRequest; -import org.egov.egf.master.web.requests.FundsourceResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/fundsources") -public class FundsourceController { - - @Autowired - private FundsourceService fundsourceService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public FundsourceResponse create(@RequestBody FundsourceRequest fundsourceRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - FundsourceResponse fundsourceResponse = new FundsourceResponse(); - fundsourceResponse.setResponseInfo(getResponseInfo(fundsourceRequest.getRequestInfo())); - List fundsources = new ArrayList<>(); - Fundsource fundsource; - List fundsourceContracts = new ArrayList<>(); - FundsourceContract contract; - - fundsourceRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (FundsourceContract fundsourceContract : fundsourceRequest.getFundsources()) { - fundsource = new Fundsource(); - model.map(fundsourceContract, fundsource); - fundsource.setCreatedDate(new Date()); - fundsource.setCreatedBy(fundsourceRequest.getRequestInfo().getUserInfo()); - fundsource.setLastModifiedBy(fundsourceRequest.getRequestInfo().getUserInfo()); - fundsources.add(fundsource); - } - - fundsources = fundsourceService.add(fundsources, errors); - - for (Fundsource f : fundsources) { - contract = new FundsourceContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - fundsourceContracts.add(contract); - } - - fundsourceRequest.setFundsources(fundsourceContracts); - fundsourceService.addToQue(fundsourceRequest); - fundsourceResponse.setFundsources(fundsourceContracts); - - return fundsourceResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public FundsourceResponse update(@RequestBody FundsourceRequest fundsourceRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - fundsourceRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - FundsourceResponse fundsourceResponse = new FundsourceResponse(); - List fundsources = new ArrayList<>(); - fundsourceResponse.setResponseInfo(getResponseInfo(fundsourceRequest.getRequestInfo())); - Fundsource fundsource; - FundsourceContract contract; - List fundsourceContracts = new ArrayList<>(); - - for (FundsourceContract fundsourceContract : fundsourceRequest.getFundsources()) { - fundsource = new Fundsource(); - model.map(fundsourceContract, fundsource); - fundsource.setLastModifiedBy(fundsourceRequest.getRequestInfo().getUserInfo()); - fundsource.setLastModifiedDate(new Date()); - fundsources.add(fundsource); - } - - fundsources = fundsourceService.update(fundsources, errors); - - for (Fundsource fundsourceObj : fundsources) { - contract = new FundsourceContract(); - model.map(fundsourceObj, contract); - fundsourceObj.setLastModifiedDate(new Date()); - fundsourceContracts.add(contract); - } - - fundsourceRequest.setFundsources(fundsourceContracts); - fundsourceService.addToQue(fundsourceRequest); - fundsourceResponse.setFundsources(fundsourceContracts); - - return fundsourceResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public FundsourceResponse search(@ModelAttribute FundsourceSearchContract fundsourceSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - FundsourceSearch domain = new FundsourceSearch(); - mapper.map(fundsourceSearchContract, domain); - FundsourceContract contract; - ModelMapper model = new ModelMapper(); - List fundsourceContracts = new ArrayList<>(); - Pagination fundsources = fundsourceService.search(domain, errors); - - for (Fundsource fundsource : fundsources.getPagedData()) { - contract = new FundsourceContract(); - model.map(fundsource, contract); - fundsourceContracts.add(contract); - } - - FundsourceResponse response = new FundsourceResponse(); - response.setFundsources(fundsourceContracts); - response.setPage(new PaginationContract(fundsources)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/RecoveryController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/RecoveryController.java deleted file mode 100644 index 805b11c42b8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/RecoveryController.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.egov.egf.master.web.controller; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.domain.service.RecoveryService; -import org.egov.egf.master.web.contract.RecoveryContract; -import org.egov.egf.master.web.contract.RecoverySearchContract; -import org.egov.egf.master.web.requests.RecoveryRequest; -import org.egov.egf.master.web.requests.RecoveryResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@RestController -@RequestMapping("/recoverys") -public class RecoveryController { - - @Autowired - private RecoveryService recoveryService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public RecoveryResponse create(@RequestBody RecoveryRequest recoveryRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - RecoveryResponse recoveryResponse = new RecoveryResponse(); - recoveryResponse.setResponseInfo(getResponseInfo(recoveryRequest.getRequestInfo())); - - List recoverys = new ArrayList<>(); - Recovery recovery; - List recoveryContracts = new ArrayList<>(); - RecoveryContract contract; - - recoveryRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (RecoveryContract recoveryContract : recoveryRequest.getRecoverys()) { - recovery = new Recovery(); - model.map(recoveryContract, recovery); - recovery.setCreatedDate(new Date()); - recovery.setCreatedBy(recoveryRequest.getRequestInfo().getUserInfo()); - recovery.setLastModifiedBy(recoveryRequest.getRequestInfo().getUserInfo()); - recoverys.add(recovery); - } - - recoverys = recoveryService.create(recoverys, errors, recoveryRequest.getRequestInfo()); - - for (Recovery f : recoverys) { - contract = new RecoveryContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - recoveryContracts.add(contract); - } - - recoveryResponse.setRecoverys(recoveryContracts); - - return recoveryResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public RecoveryResponse update(@RequestBody RecoveryRequest recoveryRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - recoveryRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - - ModelMapper model = new ModelMapper(); - RecoveryResponse recoveryResponse = new RecoveryResponse(); - recoveryResponse.setResponseInfo(getResponseInfo(recoveryRequest.getRequestInfo())); - - List recoverys = new ArrayList<>(); - Recovery recovery; - List recoveryContracts = new ArrayList<>(); - RecoveryContract contract; - - - for (RecoveryContract recoveryContract : recoveryRequest.getRecoverys()) { - recovery = new Recovery(); - model.map(recoveryContract, recovery); - recoveryContract.setLastModifiedBy(recoveryRequest.getRequestInfo().getUserInfo()); - recoveryContract.setLastModifiedDate(new Date()); - recoverys.add(recovery); - } - - recoverys = recoveryService.update(recoverys, errors, recoveryRequest.getRequestInfo()); - - for (Recovery recoveryObj : recoverys) { - contract = new RecoveryContract(); - model.map(recoveryObj, contract); - recoveryObj.setLastModifiedDate(new Date()); - recoveryContracts.add(contract); - } - - recoveryResponse.setRecoverys(recoveryContracts); - - return recoveryResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public RecoveryResponse search(@ModelAttribute RecoverySearchContract recoverySearchContract, @RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - RecoverySearch domain = new RecoverySearch(); - mapper.map(recoverySearchContract, domain); - RecoveryContract contract; - ModelMapper model = new ModelMapper(); - List recoveryContracts = new ArrayList<>(); - Pagination recoverys = recoveryService.search(domain, errors); - - if (recoverys.getPagedData() != null) { - for (Recovery recovery : recoverys.getPagedData()) { - contract = new RecoveryContract(); - model.map(recovery, contract); - recoveryContracts.add(contract); - } - } - - RecoveryResponse response = new RecoveryResponse(); - response.setRecoverys(recoveryContracts); - response.setPage(new PaginationContract(recoverys)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SchemeController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SchemeController.java deleted file mode 100644 index 381c9e725c2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SchemeController.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.Scheme; -import org.egov.egf.master.domain.model.SchemeSearch; -import org.egov.egf.master.domain.service.SchemeService; -import org.egov.egf.master.web.contract.SchemeContract; -import org.egov.egf.master.web.contract.SchemeSearchContract; -import org.egov.egf.master.web.requests.SchemeRequest; -import org.egov.egf.master.web.requests.SchemeResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/schemes") -public class SchemeController { - - @Autowired - private SchemeService schemeService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public SchemeResponse create(@RequestBody SchemeRequest schemeRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - SchemeResponse schemeResponse = new SchemeResponse(); - schemeResponse.setResponseInfo(getResponseInfo(schemeRequest.getRequestInfo())); - List schemes = new ArrayList<>(); - Scheme scheme; - List schemeContracts = new ArrayList<>(); - SchemeContract contract; - - schemeRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (SchemeContract schemeContract : schemeRequest.getSchemes()) { - scheme = new Scheme(); - model.map(schemeContract, scheme); - scheme.setCreatedDate(new Date()); - scheme.setCreatedBy(schemeRequest.getRequestInfo().getUserInfo()); - scheme.setLastModifiedBy(schemeRequest.getRequestInfo().getUserInfo()); - schemes.add(scheme); - } - - schemes = schemeService.add(schemes, errors); - - for (Scheme f : schemes) { - contract = new SchemeContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - schemeContracts.add(contract); - } - - schemeRequest.setSchemes(schemeContracts); - schemeService.addToQue(schemeRequest); - schemeResponse.setSchemes(schemeContracts); - - return schemeResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public SchemeResponse update(@RequestBody SchemeRequest schemeRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - schemeRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - SchemeResponse schemeResponse = new SchemeResponse(); - List schemes = new ArrayList<>(); - schemeResponse.setResponseInfo(getResponseInfo(schemeRequest.getRequestInfo())); - Scheme scheme; - SchemeContract contract; - List schemeContracts = new ArrayList<>(); - - for (SchemeContract schemeContract : schemeRequest.getSchemes()) { - scheme = new Scheme(); - model.map(schemeContract, scheme); - scheme.setLastModifiedBy(schemeRequest.getRequestInfo().getUserInfo()); - scheme.setLastModifiedDate(new Date()); - schemes.add(scheme); - } - - schemes = schemeService.update(schemes, errors); - - for (Scheme schemeObj : schemes) { - contract = new SchemeContract(); - model.map(schemeObj, contract); - schemeObj.setLastModifiedDate(new Date()); - schemeContracts.add(contract); - } - - schemeRequest.setSchemes(schemeContracts); - schemeService.addToQue(schemeRequest); - schemeResponse.setSchemes(schemeContracts); - - return schemeResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public SchemeResponse search(@ModelAttribute SchemeSearchContract schemeSearchContract, @RequestBody RequestInfo requestInfo, - BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - SchemeSearch domain = new SchemeSearch(); - mapper.map(schemeSearchContract, domain); - SchemeContract contract; - ModelMapper model = new ModelMapper(); - List schemeContracts = new ArrayList<>(); - Pagination schemes = schemeService.search(domain, errors); - - for (Scheme scheme : schemes.getPagedData()) { - contract = new SchemeContract(); - model.map(scheme, contract); - schemeContracts.add(contract); - } - - SchemeResponse response = new SchemeResponse(); - response.setSchemes(schemeContracts); - response.setPage(new PaginationContract(schemes)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SubSchemeController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SubSchemeController.java deleted file mode 100644 index 00ec02dd623..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SubSchemeController.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.SubScheme; -import org.egov.egf.master.domain.model.SubSchemeSearch; -import org.egov.egf.master.domain.service.SubSchemeService; -import org.egov.egf.master.web.contract.SubSchemeContract; -import org.egov.egf.master.web.contract.SubSchemeSearchContract; -import org.egov.egf.master.web.requests.SubSchemeRequest; -import org.egov.egf.master.web.requests.SubSchemeResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/subschemes") -public class SubSchemeController { - - @Autowired - private SubSchemeService subSchemeService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public SubSchemeResponse create(@RequestBody SubSchemeRequest subSchemeRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - SubSchemeResponse subSchemeResponse = new SubSchemeResponse(); - subSchemeResponse.setResponseInfo(getResponseInfo(subSchemeRequest.getRequestInfo())); - List subschemes = new ArrayList<>(); - SubScheme subScheme; - List subSchemeContracts = new ArrayList<>(); - SubSchemeContract contract; - - subSchemeRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (SubSchemeContract subSchemeContract : subSchemeRequest.getSubSchemes()) { - subScheme = new SubScheme(); - model.map(subSchemeContract, subScheme); - subScheme.setCreatedDate(new Date()); - subScheme.setCreatedBy(subSchemeRequest.getRequestInfo().getUserInfo()); - subScheme.setLastModifiedBy(subSchemeRequest.getRequestInfo().getUserInfo()); - subschemes.add(subScheme); - } - - subschemes = subSchemeService.add(subschemes, errors); - - for (SubScheme f : subschemes) { - contract = new SubSchemeContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - subSchemeContracts.add(contract); - } - - subSchemeRequest.setSubSchemes(subSchemeContracts); - subSchemeService.addToQue(subSchemeRequest); - subSchemeResponse.setSubSchemes(subSchemeContracts); - - return subSchemeResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public SubSchemeResponse update(@RequestBody SubSchemeRequest subSchemeRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - subSchemeRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - SubSchemeResponse subSchemeResponse = new SubSchemeResponse(); - List subschemes = new ArrayList<>(); - subSchemeResponse.setResponseInfo(getResponseInfo(subSchemeRequest.getRequestInfo())); - SubScheme subScheme; - SubSchemeContract contract; - List subSchemeContracts = new ArrayList<>(); - - for (SubSchemeContract subSchemeContract : subSchemeRequest.getSubSchemes()) { - subScheme = new SubScheme(); - model.map(subSchemeContract, subScheme); - subScheme.setLastModifiedBy(subSchemeRequest.getRequestInfo().getUserInfo()); - subScheme.setLastModifiedDate(new Date()); - subschemes.add(subScheme); - } - - subschemes = subSchemeService.update(subschemes, errors); - - for (SubScheme subSchemeObj : subschemes) { - contract = new SubSchemeContract(); - model.map(subSchemeObj, contract); - subSchemeObj.setLastModifiedDate(new Date()); - subSchemeContracts.add(contract); - } - - subSchemeRequest.setSubSchemes(subSchemeContracts); - subSchemeService.addToQue(subSchemeRequest); - subSchemeResponse.setSubSchemes(subSchemeContracts); - - return subSchemeResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public SubSchemeResponse search(@ModelAttribute SubSchemeSearchContract subSchemeSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - SubSchemeSearch domain = new SubSchemeSearch(); - mapper.map(subSchemeSearchContract, domain); - SubSchemeContract contract; - ModelMapper model = new ModelMapper(); - List subSchemeContracts = new ArrayList<>(); - Pagination subschemes = subSchemeService.search(domain, errors); - - for (SubScheme subScheme : subschemes.getPagedData()) { - contract = new SubSchemeContract(); - model.map(subScheme, contract); - subSchemeContracts.add(contract); - } - - SubSchemeResponse response = new SubSchemeResponse(); - response.setSubSchemes(subSchemeContracts); - response.setPage(new PaginationContract(subschemes)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SupplierController.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SupplierController.java deleted file mode 100644 index 96f3a08103c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/controller/SupplierController.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.egov.egf.master.web.controller; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.domain.model.Supplier; -import org.egov.egf.master.domain.model.SupplierSearch; -import org.egov.egf.master.domain.service.SupplierService; -import org.egov.egf.master.web.contract.SupplierContract; -import org.egov.egf.master.web.contract.SupplierSearchContract; -import org.egov.egf.master.web.requests.SupplierRequest; -import org.egov.egf.master.web.requests.SupplierResponse; -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.*; - -@RestController -@RequestMapping("/suppliers") -public class SupplierController { - - @Autowired - private SupplierService supplierService; - - @PostMapping("/_create") - @ResponseStatus(HttpStatus.CREATED) - public SupplierResponse create(@RequestBody SupplierRequest supplierRequest, BindingResult errors,@RequestParam String tenantId) { - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - - ModelMapper model = new ModelMapper(); - SupplierResponse supplierResponse = new SupplierResponse(); - supplierResponse.setResponseInfo(getResponseInfo(supplierRequest.getRequestInfo())); - List suppliers = new ArrayList<>(); - Supplier supplier; - List supplierContracts = new ArrayList<>(); - SupplierContract contract; - - supplierRequest.getRequestInfo().setAction(Constants.ACTION_CREATE); - - for (SupplierContract supplierContract : supplierRequest.getSuppliers()) { - supplier = new Supplier(); - model.map(supplierContract, supplier); - supplier.setCreatedDate(new Date()); - supplier.setCreatedBy(supplierRequest.getRequestInfo().getUserInfo()); - supplier.setLastModifiedBy(supplierRequest.getRequestInfo().getUserInfo()); - suppliers.add(supplier); - } - - suppliers = supplierService.add(suppliers, errors); - - for (Supplier f : suppliers) { - contract = new SupplierContract(); - contract.setCreatedDate(new Date()); - model.map(f, contract); - supplierContracts.add(contract); - } - - supplierRequest.setSuppliers(supplierContracts); - supplierService.addToQue(supplierRequest); - supplierResponse.setSuppliers(supplierContracts); - - return supplierResponse; - } - - @PostMapping("/_update") - @ResponseStatus(HttpStatus.CREATED) - public SupplierResponse update(@RequestBody SupplierRequest supplierRequest, BindingResult errors,@RequestParam String tenantId) { - - if (errors.hasErrors()) { - throw new CustomBindException(errors); - } - supplierRequest.getRequestInfo().setAction(Constants.ACTION_UPDATE); - ModelMapper model = new ModelMapper(); - SupplierResponse supplierResponse = new SupplierResponse(); - List suppliers = new ArrayList<>(); - supplierResponse.setResponseInfo(getResponseInfo(supplierRequest.getRequestInfo())); - Supplier supplier; - SupplierContract contract; - List supplierContracts = new ArrayList<>(); - - for (SupplierContract supplierContract : supplierRequest.getSuppliers()) { - supplier = new Supplier(); - model.map(supplierContract, supplier); - supplier.setLastModifiedBy(supplierRequest.getRequestInfo().getUserInfo()); - supplier.setLastModifiedDate(new Date()); - suppliers.add(supplier); - } - - suppliers = supplierService.update(suppliers, errors); - - for (Supplier supplierObj : suppliers) { - contract = new SupplierContract(); - model.map(supplierObj, contract); - supplierObj.setLastModifiedDate(new Date()); - supplierContracts.add(contract); - } - - supplierRequest.setSuppliers(supplierContracts); - supplierService.addToQue(supplierRequest); - supplierResponse.setSuppliers(supplierContracts); - - return supplierResponse; - } - - @PostMapping("/_search") - @ResponseBody - @ResponseStatus(HttpStatus.OK) - public SupplierResponse search(@ModelAttribute SupplierSearchContract supplierSearchContract, - @RequestBody RequestInfo requestInfo, BindingResult errors,@RequestParam String tenantId) { - - ModelMapper mapper = new ModelMapper(); - SupplierSearch domain = new SupplierSearch(); - mapper.map(supplierSearchContract, domain); - SupplierContract contract; - ModelMapper model = new ModelMapper(); - List supplierContracts = new ArrayList<>(); - Pagination suppliers = supplierService.search(domain, errors); - - for (Supplier supplier : suppliers.getPagedData()) { - contract = new SupplierContract(); - model.map(supplier, contract); - supplierContracts.add(contract); - } - - SupplierResponse response = new SupplierResponse(); - response.setSuppliers(supplierContracts); - response.setPage(new PaginationContract(suppliers)); - response.setResponseInfo(getResponseInfo(requestInfo)); - - return response; - - } - - private ResponseInfo getResponseInfo(RequestInfo requestInfo) { - return ResponseInfo.builder().apiId(requestInfo.getApiId()).ver(requestInfo.getVer()) - .resMsgId(requestInfo.getMsgId()).resMsgId("placeholder").status("placeholder").build(); - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountCodePurposeContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountCodePurposeContractRepository.java deleted file mode 100644 index 8b8bb89f48a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountCodePurposeContractRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountCodePurposeContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.AccountCodePurposeResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class AccountCodePurposeContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/accountcodepurposes/_search?"; - - public AccountCodePurposeContractRepository(@Value("${egf.master.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public AccountCodePurposeContract findById(AccountCodePurposeContract accountCodePurposeContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (accountCodePurposeContract.getId() != null) { - content.append("id=" + accountCodePurposeContract.getId()); - } - - if (accountCodePurposeContract.getTenantId() != null) { - content.append("&tenantId=" + accountCodePurposeContract.getTenantId()); - } - url = url + content.toString(); - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - AccountCodePurposeResponse result; - - result = restTemplate.postForObject(url, requestInfoWrapper, AccountCodePurposeResponse.class); - - if (result.getAccountCodePurposes() != null && result.getAccountCodePurposes().size() == 1) { - return result.getAccountCodePurposes().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountDetailKeyContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountDetailKeyContractRepository.java deleted file mode 100644 index f1982046f85..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountDetailKeyContractRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountDetailKeyContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.AccountDetailKeyResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class AccountDetailKeyContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/accountdetailkeys/_search?"; - - public AccountDetailKeyContractRepository(@Value("${egf.master.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public AccountDetailKeyContract findById(AccountDetailKeyContract accountDetailKeyContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (accountDetailKeyContract.getId() != null) { - content.append("id=" + accountDetailKeyContract.getId()); - } - - if (accountDetailKeyContract.getTenantId() != null) { - content.append("&tenantId=" + accountDetailKeyContract.getTenantId()); - } - url = url + content.toString(); - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - AccountDetailKeyResponse result; - - result = restTemplate.postForObject(url, requestInfoWrapper, AccountDetailKeyResponse.class); - - if (result.getAccountDetailKeys() != null && result.getAccountDetailKeys().size() == 1) { - return result.getAccountDetailKeys().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountDetailTypeContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountDetailTypeContractRepository.java deleted file mode 100644 index e6ec0c1ad8d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountDetailTypeContractRepository.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.AccountDetailTypeResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class AccountDetailTypeContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/accountdetailtypes/_search?"; - - public AccountDetailTypeContractRepository(@Value("${egf.master.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public AccountDetailTypeContract findById(AccountDetailTypeContract accountDetailTypeContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (accountDetailTypeContract.getId() != null) { - content.append("id=" + accountDetailTypeContract.getId()); - } - - if (accountDetailTypeContract.getTenantId() != null) { - content.append("&tenantId=" + accountDetailTypeContract.getTenantId()); - } - url = url + content.toString(); - AccountDetailTypeResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, AccountDetailTypeResponse.class); - - - if (result.getAccountDetailTypes() != null && result.getAccountDetailTypes().size() == 1) { - return result.getAccountDetailTypes().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountEntityContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountEntityContractRepository.java deleted file mode 100644 index 145405625bf..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/AccountEntityContractRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountEntityContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.AccountEntityResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class AccountEntityContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/accountentities/_search?"; - - public AccountEntityContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public AccountEntityContract findById(AccountEntityContract accountEntityContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (accountEntityContract.getId() != null) { - content.append("id=" + accountEntityContract.getId()); - } - - if (accountEntityContract.getTenantId() != null) { - content.append("&tenantId=" + accountEntityContract.getTenantId()); - } - url = url + content.toString(); - AccountEntityResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, AccountEntityResponse.class); - - - if (result.getAccountEntities() != null && result.getAccountEntities().size() == 1) { - return result.getAccountEntities().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankAccountContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankAccountContractRepository.java deleted file mode 100644 index 63da0d3c42f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankAccountContractRepository.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.BankAccountResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class BankAccountContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/bankaccounts/_search?"; - - public BankAccountContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public BankAccountContract findById(BankAccountContract bankAccountContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (bankAccountContract.getId() != null) { - content.append("id=" + bankAccountContract.getId()); - } - - if (bankAccountContract.getTenantId() != null) { - content.append("&tenantId=" + bankAccountContract.getTenantId()); - } - url = url + content.toString(); - BankAccountResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, BankAccountResponse.class); - - - if (result.getBankAccounts() != null && result.getBankAccounts().size() == 1) { - return result.getBankAccounts().get(0); - } else { - return null; - } - - } - - public BankAccountContract findByAccountNumber(BankAccountContract bankAccountContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (bankAccountContract.getId() != null) { - content.append("accountNumber=" + bankAccountContract.getAccountNumber()); - } - - if (bankAccountContract.getTenantId() != null) { - content.append("&tenantId=" + bankAccountContract.getTenantId()); - } - url = url + content.toString(); - - BankAccountResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, BankAccountResponse.class); - - if (result.getBankAccounts() != null && result.getBankAccounts().size() == 1) { - return result.getBankAccounts().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankBranchContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankBranchContractRepository.java deleted file mode 100644 index 1164622a59a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankBranchContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BankBranchContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.BankBranchResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class BankBranchContractRepository { - - public static final String SEARCH_URL = "/egf-master/bankbranches/_search?"; - private RestTemplate restTemplate; - private String hostUrl; - - public BankBranchContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public BankBranchContract findById(BankBranchContract bankBranchContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (bankBranchContract.getId() != null) { - content.append("id=" + bankBranchContract.getId()); - } - - if (bankBranchContract.getTenantId() != null) { - content.append("&tenantId=" + bankBranchContract.getTenantId()); - } - url = url + content.toString(); - BankBranchResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, BankBranchResponse.class); - - if (result.getBankBranches() != null && result.getBankBranches().size() == 1) { - return result.getBankBranches().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankContractRepository.java deleted file mode 100644 index 55f993607d2..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BankContractRepository.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.BankResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class BankContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/banks/_search?"; - - public BankContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public BankContract findById(BankContract bankContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (bankContract.getId() != null) { - content.append("id=" + bankContract.getId()); - } - - if (bankContract.getTenantId() != null) { - content.append("&tenantId=" + bankContract.getTenantId()); - } - url = url + content.toString(); - - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - BankResponse result = restTemplate.postForObject(url, requestInfoWrapper, BankResponse.class); - - if (result.getBanks() != null && result.getBanks().size() == 1) { - return result.getBanks().get(0); - } else { - return null; - } - - } - - public BankContract findByCode(BankContract bankContract) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (bankContract.getCode() != null) { - content.append("code=" + bankContract.getCode()); - } - - if (bankContract.getTenantId() != null) { - content.append("&tenantId=" + bankContract.getTenantId()); - } - url = url + content.toString(); - BankResponse result = restTemplate.postForObject(url, null, BankResponse.class); - - if (result.getBanks() != null && result.getBanks().size() == 1) { - return result.getBanks().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BudgetGroupContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BudgetGroupContractRepository.java deleted file mode 100644 index 404907d1dc1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/BudgetGroupContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BudgetGroupContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.BudgetGroupResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class BudgetGroupContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/budgetgroups/_search?"; - - public BudgetGroupContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public BudgetGroupContract findById(BudgetGroupContract budgetGroupContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (budgetGroupContract.getId() != null) { - content.append("id=" + budgetGroupContract.getId()); - } - - if (budgetGroupContract.getTenantId() != null) { - content.append("&tenantId=" + budgetGroupContract.getTenantId()); - } - url = url + content.toString(); - BudgetGroupResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, BudgetGroupResponse.class); - - if (result.getBudgetGroups() != null && result.getBudgetGroups().size() == 1) { - return result.getBudgetGroups().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/ChartOfAccountContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/ChartOfAccountContractRepository.java deleted file mode 100644 index 0e660e13815..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/ChartOfAccountContractRepository.java +++ /dev/null @@ -1,74 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.ChartOfAccountResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class ChartOfAccountContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/chartofaccounts/_search?"; - - public ChartOfAccountContractRepository(@Value("${egf.master.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public ChartOfAccountContract findById(ChartOfAccountContract chartOfAccountContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (chartOfAccountContract.getId() != null) { - content.append("id=" + chartOfAccountContract.getId()); - } - - if (chartOfAccountContract.getTenantId() != null) { - content.append("&tenantId=" + chartOfAccountContract.getTenantId()); - } - url = url + content.toString(); - ChartOfAccountResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, ChartOfAccountResponse.class); - - if (result.getChartOfAccounts() != null && result.getChartOfAccounts().size() == 1) { - return result.getChartOfAccounts().get(0); - } else { - return null; - } - - } - - public ChartOfAccountContract findByGlcode(ChartOfAccountContract chartOfAccountContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (chartOfAccountContract.getGlcode() != null) { - content.append("glcode=" + chartOfAccountContract.getGlcode()); - } - - if (chartOfAccountContract.getTenantId() != null) { - content.append("&tenantId=" + chartOfAccountContract.getTenantId()); - } - url = url + content.toString(); - ChartOfAccountResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - result = restTemplate.postForObject(url, requestInfoWrapper, ChartOfAccountResponse.class); - - if (result.getChartOfAccounts() != null && result.getChartOfAccounts().size() == 1) { - return result.getChartOfAccounts().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/ChartOfAccountDetailContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/ChartOfAccountDetailContractRepository.java deleted file mode 100644 index ff264e02786..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/ChartOfAccountDetailContractRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.ChartOfAccountDetailContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.ChartOfAccountDetailResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class ChartOfAccountDetailContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/chartofaccountdetails/_search?"; - - public ChartOfAccountDetailContractRepository(@Value("${egf.master.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public ChartOfAccountDetailContract findById(ChartOfAccountDetailContract chartOfAccountDetailContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (chartOfAccountDetailContract.getId() != null) { - content.append("id=" + chartOfAccountDetailContract.getId()); - } - - if (chartOfAccountDetailContract.getTenantId() != null) { - content.append("&tenantId=" + chartOfAccountDetailContract.getTenantId()); - } - url = url + content.toString(); - ChartOfAccountDetailResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, ChartOfAccountDetailResponse.class); - - if (result.getChartOfAccountDetails() != null && result.getChartOfAccountDetails().size() == 1) { - return result.getChartOfAccountDetails().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialConfigurationContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialConfigurationContractRepository.java deleted file mode 100644 index 41d9a6ee026..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialConfigurationContractRepository.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FinancialConfigurationContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FinancialConfigurationResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Repository; -import org.springframework.web.client.RestTemplate; - -@Repository -public class FinancialConfigurationContractRepository { - - public static final String SEARCH_URL = "/egf-master/financialconfigurations/_search?"; - private RestTemplate restTemplate; - private String hostUrl; - private String fetchDataFrom; - - public FinancialConfigurationContractRepository(@Value("${egf.master.host.url}") String hostUrl, - @Value("${fetch_data_from}") String fetchDataFrom, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - this.fetchDataFrom = fetchDataFrom; - } - - public FinancialConfigurationContract findById(FinancialConfigurationContract financialConfigurationContract, - RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (financialConfigurationContract.getId() != null) { - content.append("id=" + financialConfigurationContract.getId()); - } - - if (financialConfigurationContract.getTenantId() != null) { - content.append("&tenantId=" + financialConfigurationContract.getTenantId()); - } - url = url + content.toString(); - FinancialConfigurationResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FinancialConfigurationResponse.class); - - if (result.getFinancialConfigurations() != null && result.getFinancialConfigurations().size() == 1) { - return result.getFinancialConfigurations().get(0); - } else { - return null; - } - - } - - public FinancialConfigurationContract findByModuleAndName( - FinancialConfigurationContract financialConfigurationContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (financialConfigurationContract.getName() != null) { - content.append("name=" + financialConfigurationContract.getName()); - } - - if (financialConfigurationContract.getModule() != null) { - content.append("&module=" + financialConfigurationContract.getModule()); - } - - if (financialConfigurationContract.getTenantId() != null) { - content.append("&tenantId=" + financialConfigurationContract.getTenantId()); - } - url = url + content.toString(); - FinancialConfigurationResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - result = restTemplate.postForObject(url, requestInfoWrapper, FinancialConfigurationResponse.class); - - if (result.getFinancialConfigurations() != null && result.getFinancialConfigurations().size() == 1) { - return result.getFinancialConfigurations().get(0); - } else { - return null; - } - - } - - public String fetchDataFrom() { - return fetchDataFrom; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialStatusContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialStatusContractRepository.java deleted file mode 100644 index d5434f573bc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialStatusContractRepository.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FinancialStatusContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FinancialStatusResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class FinancialStatusContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/financialstatuses/_search?"; - - public FinancialStatusContractRepository(@Value("${egf.master.host.url}") String hostUrl, - RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public FinancialStatusContract findById(FinancialStatusContract financialStatusContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (financialStatusContract.getId() != null) { - content.append("id=" + financialStatusContract.getId()); - } - - if (financialStatusContract.getTenantId() != null) { - content.append("&tenantId=" + financialStatusContract.getTenantId()); - } - url = url + content.toString(); - FinancialStatusResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FinancialStatusResponse.class); - - if (result.getFinancialStatuses() != null && result.getFinancialStatuses().size() == 1) { - return result.getFinancialStatuses().get(0); - } else { - return null; - } - - } - - public FinancialStatusContract findByModuleCode(FinancialStatusContract financialStatusContract) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (financialStatusContract.getCode() != null) { - content.append("code=" + financialStatusContract.getCode()); - } - - if (financialStatusContract.getModuleType() != null) { - content.append("&moduleType=" + financialStatusContract.getModuleType()); - } - url = url + content.toString(); - FinancialStatusResponse result = restTemplate.postForObject(url, null, FinancialStatusResponse.class); - - if (result.getFinancialStatuses() != null && result.getFinancialStatuses().size() == 1) { - return result.getFinancialStatuses().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialYearContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialYearContractRepository.java deleted file mode 100644 index 691f3083984..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FinancialYearContractRepository.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.egov.egf.master.web.repository; - -import java.text.SimpleDateFormat; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FinancialYearContract; -import org.egov.egf.master.web.contract.FinancialYearSearchContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FinancialYearResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Repository; -import org.springframework.web.client.RestTemplate; - -@Repository -public class FinancialYearContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/financialyears/_search?"; - - public FinancialYearContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public FinancialYearContract findById(FinancialYearContract financialYearContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (financialYearContract.getId() != null) { - content.append("id=" + financialYearContract.getId()); - } - - if (financialYearContract.getTenantId() != null) { - content.append("&tenantId=" + financialYearContract.getTenantId()); - } - url = url + content.toString(); - FinancialYearResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FinancialYearResponse.class); - - if (result.getFinancialYears() != null && result.getFinancialYears().size() == 1) { - return result.getFinancialYears().get(0); - } else { - return null; - } - - } - - public FinancialYearContract findByAsOnDate(FinancialYearSearchContract financialYearSearchContract, - RequestInfo requestInfo) { - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (financialYearSearchContract.getAsOnDate() != null) { - content.append("asOnDate=" + sdf.format(financialYearSearchContract.getAsOnDate())); - } - - if (financialYearSearchContract.getTenantId() != null) { - content.append("&tenantId=" + financialYearSearchContract.getTenantId()); - } - url = url + content.toString(); - FinancialYearResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - result = restTemplate.postForObject(url, requestInfoWrapper, FinancialYearResponse.class); - - if (result.getFinancialYears() != null && result.getFinancialYears().size() == 1) { - return result.getFinancialYears().get(0); - } else { - return null; - } - - } -} diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FiscalPeriodContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FiscalPeriodContractRepository.java deleted file mode 100644 index 524b5af0d6d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FiscalPeriodContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FiscalPeriodContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FiscalPeriodResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class FiscalPeriodContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/fiscalperiods/_search?"; - - public FiscalPeriodContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public FiscalPeriodContract findById(FiscalPeriodContract fiscalPeriodContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (fiscalPeriodContract.getId() != null) { - content.append("id=" + fiscalPeriodContract.getId()); - } - - if (fiscalPeriodContract.getTenantId() != null) { - content.append("&tenantId=" + fiscalPeriodContract.getTenantId()); - } - url = url + content.toString(); - FiscalPeriodResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FiscalPeriodResponse.class); - - if (result.getFiscalPeriods() != null && result.getFiscalPeriods().size() == 1) { - return result.getFiscalPeriods().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FunctionContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FunctionContractRepository.java deleted file mode 100644 index 418d4c3cd0d..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FunctionContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FunctionContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FunctionResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class FunctionContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/functions/_search?"; - - public FunctionContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public FunctionContract findById(FunctionContract functionContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (functionContract.getId() != null) { - content.append("id=" + functionContract.getId()); - } - - if (functionContract.getTenantId() != null) { - content.append("&tenantId=" + functionContract.getTenantId()); - } - url = url + content.toString(); - FunctionResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FunctionResponse.class); - - if (result.getFunctions() != null && result.getFunctions().size() == 1) { - return result.getFunctions().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FunctionaryContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FunctionaryContractRepository.java deleted file mode 100644 index 38d464d38d8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FunctionaryContractRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FunctionaryContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FunctionaryResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class FunctionaryContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/functionaries/_search?"; - - public FunctionaryContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public FunctionaryContract findById(FunctionaryContract functionaryContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (functionaryContract.getId() != null) { - content.append("id=" + functionaryContract.getId()); - } - - if (functionaryContract.getTenantId() != null) { - content.append("&tenantId=" + functionaryContract.getTenantId()); - } - url = url + content.toString(); - FunctionaryResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FunctionaryResponse.class); - - - if (result.getFunctionaries() != null && result.getFunctionaries().size() == 1) { - return result.getFunctionaries().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FundContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FundContractRepository.java deleted file mode 100644 index 7576d1a01dc..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FundContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FundContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FundResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class FundContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/funds/_search?"; - - public FundContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public FundContract findById(FundContract fundContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (fundContract.getId() != null) { - content.append("id=" + fundContract.getId()); - } - - if (fundContract.getTenantId() != null) { - content.append("&tenantId=" + fundContract.getTenantId()); - } - url = url + content.toString(); - FundResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FundResponse.class); - - if (result.getFunds() != null && result.getFunds().size() == 1) { - return result.getFunds().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FundsourceContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FundsourceContractRepository.java deleted file mode 100644 index 7ed1b485c79..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/FundsourceContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FundsourceContract; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.requests.FundsourceResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class FundsourceContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/fundsources/_search?"; - - public FundsourceContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public FundsourceContract findById(FundsourceContract fundsourceContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (fundsourceContract.getId() != null) { - content.append("id=" + fundsourceContract.getId()); - } - - if (fundsourceContract.getTenantId() != null) { - content.append("&tenantId=" + fundsourceContract.getTenantId()); - } - url = url + content.toString(); - FundsourceResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, FundsourceResponse.class); - - if (result.getFundsources() != null && result.getFundsources().size() == 1) { - return result.getFundsources().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SchemeContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SchemeContractRepository.java deleted file mode 100644 index 3b95769ae75..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SchemeContractRepository.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.contract.SchemeContract; -import org.egov.egf.master.web.requests.SchemeResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class SchemeContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/schemes/_search?"; - - public SchemeContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public SchemeContract findById(SchemeContract schemeContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (schemeContract.getId() != null) { - content.append("id=" + schemeContract.getId()); - } - - if (schemeContract.getTenantId() != null) { - content.append("&tenantId=" + schemeContract.getTenantId()); - } - url = url + content.toString(); - SchemeResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, SchemeResponse.class); - - - if (result.getSchemes() != null && result.getSchemes().size() == 1) { - return result.getSchemes().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SubSchemeContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SubSchemeContractRepository.java deleted file mode 100644 index 44d330d1966..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SubSchemeContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.contract.SubSchemeContract; -import org.egov.egf.master.web.requests.SubSchemeResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class SubSchemeContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/subschemes/_search?"; - - public SubSchemeContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public SubSchemeContract findById(SubSchemeContract subSchemeContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (subSchemeContract.getId() != null) { - content.append("id=" + subSchemeContract.getId()); - } - - if (subSchemeContract.getTenantId() != null) { - content.append("&tenantId=" + subSchemeContract.getTenantId()); - } - url = url + content.toString(); - SubSchemeResponse result; - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - - result = restTemplate.postForObject(url, requestInfoWrapper, SubSchemeResponse.class); - - if (result.getSubSchemes() != null && result.getSubSchemes().size() == 1) { - return result.getSubSchemes().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SupplierContractRepository.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SupplierContractRepository.java deleted file mode 100644 index e9ac7948e0a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/repository/SupplierContractRepository.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.egov.egf.master.web.repository; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.RequestInfoWrapper; -import org.egov.egf.master.web.contract.SupplierContract; -import org.egov.egf.master.web.requests.SupplierResponse; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -@Service -public class SupplierContractRepository { - - private RestTemplate restTemplate; - private String hostUrl; - public static final String SEARCH_URL = "/egf-master/suppliers/_search?"; - - public SupplierContractRepository(@Value("${egf.master.host.url}") String hostUrl, RestTemplate restTemplate) { - this.restTemplate = restTemplate; - this.hostUrl = hostUrl; - } - - public SupplierContract findById(SupplierContract supplierContract, RequestInfo requestInfo) { - - String url = String.format("%s%s", hostUrl, SEARCH_URL); - StringBuffer content = new StringBuffer(); - if (supplierContract.getId() != null) { - content.append("id=" + supplierContract.getId()); - } - - if (supplierContract.getTenantId() != null) { - content.append("&tenantId=" + supplierContract.getTenantId()); - } - url = url + content.toString(); - RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); - requestInfoWrapper.setRequestInfo(requestInfo); - SupplierResponse result; - - result = restTemplate.postForObject(url, requestInfoWrapper, SupplierResponse.class); - - if (result.getSuppliers() != null && result.getSuppliers().size() == 1) { - return result.getSuppliers().get(0); - } else { - return null; - } - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountCodePurposeRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountCodePurposeRequest.java deleted file mode 100644 index b6d2f95038c..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountCodePurposeRequest.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.egf.master.web.requests; - -import java.util.ArrayList; -import java.util.List; - -import javax.validation.constraints.NotNull; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountCodePurposeContract; - -import lombok.Data; - -public @Data class AccountCodePurposeRequest { - private RequestInfo requestInfo = new RequestInfo(); - @NotNull - private List accountCodePurposes = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountCodePurposeResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountCodePurposeResponse.java deleted file mode 100644 index feb4c38cf19..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountCodePurposeResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.master.web.requests; - -import java.util.List; - -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.web.contract.AccountCodePurposeContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class AccountCodePurposeResponse { - private ResponseInfo responseInfo; - private List accountCodePurposes; - private PaginationContract page; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailKeyRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailKeyRequest.java deleted file mode 100644 index 1ae33a46559..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailKeyRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountDetailKeyContract; - -import lombok.Data; -public @Data class AccountDetailKeyRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List accountDetailKeys =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailKeyResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailKeyResponse.java deleted file mode 100644 index 51f76bdff7b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailKeyResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.AccountDetailKeyContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class AccountDetailKeyResponse { -private ResponseInfo responseInfo ; -private List accountDetailKeys; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailTypeRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailTypeRequest.java deleted file mode 100644 index 4a40fdbba51..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailTypeRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; - -import lombok.Data; -public @Data class AccountDetailTypeRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List accountDetailTypes =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailTypeResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailTypeResponse.java deleted file mode 100644 index 968179acef7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountDetailTypeResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class AccountDetailTypeResponse { -private ResponseInfo responseInfo ; -private List accountDetailTypes; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountEntityRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountEntityRequest.java deleted file mode 100644 index 0009877f28a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountEntityRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.AccountEntityContract; - -import lombok.Data; -public @Data class AccountEntityRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List accountEntities =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountEntityResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountEntityResponse.java deleted file mode 100644 index cf772ffa3e1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/AccountEntityResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.AccountEntityContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class AccountEntityResponse { -private ResponseInfo responseInfo ; -private List accountEntities; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankAccountRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankAccountRequest.java deleted file mode 100644 index ddda4576c8a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankAccountRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BankAccountContract; - -import lombok.Data; -public @Data class BankAccountRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List bankAccounts =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankAccountResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankAccountResponse.java deleted file mode 100644 index ac6bdce290b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankAccountResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.BankAccountContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class BankAccountResponse { -private ResponseInfo responseInfo ; -private List bankAccounts; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankBranchRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankBranchRequest.java deleted file mode 100644 index 0c2dd564108..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankBranchRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BankBranchContract; - -import lombok.Data; -public @Data class BankBranchRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List bankBranches =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankBranchResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankBranchResponse.java deleted file mode 100644 index e1436f996c7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankBranchResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.BankBranchContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class BankBranchResponse { -private ResponseInfo responseInfo ; -private List bankBranches; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankRequest.java deleted file mode 100644 index 6106ecfadb8..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BankContract; - -import lombok.Data; -public @Data class BankRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List banks =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankResponse.java deleted file mode 100644 index 937bf8f7af0..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BankResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.BankContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class BankResponse { -private ResponseInfo responseInfo ; -private List banks; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BudgetGroupRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BudgetGroupRequest.java deleted file mode 100644 index 8dfecce93e1..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BudgetGroupRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.BudgetGroupContract; - -import lombok.Data; -public @Data class BudgetGroupRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List budgetGroups =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BudgetGroupResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BudgetGroupResponse.java deleted file mode 100644 index 459306a6c67..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/BudgetGroupResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.BudgetGroupContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class BudgetGroupResponse { -private ResponseInfo responseInfo ; -private List budgetGroups; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountDetailRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountDetailRequest.java deleted file mode 100644 index 7c1b5d7e1e9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountDetailRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.ChartOfAccountDetailContract; - -import lombok.Data; -public @Data class ChartOfAccountDetailRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List chartOfAccountDetails =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountDetailResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountDetailResponse.java deleted file mode 100644 index 1923fcfa62f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountDetailResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.ChartOfAccountDetailContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class ChartOfAccountDetailResponse { -private ResponseInfo responseInfo ; -private List chartOfAccountDetails; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountRequest.java deleted file mode 100644 index 0bc5c33f8d4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.ChartOfAccountContract; - -import lombok.Data; -public @Data class ChartOfAccountRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List chartOfAccounts =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountResponse.java deleted file mode 100644 index dae042117c5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/ChartOfAccountResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.ChartOfAccountContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class ChartOfAccountResponse { -private ResponseInfo responseInfo ; -private List chartOfAccounts; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialConfigurationRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialConfigurationRequest.java deleted file mode 100644 index a3c00cd176a..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialConfigurationRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FinancialConfigurationContract; - -import lombok.Data; -public @Data class FinancialConfigurationRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List financialConfigurations =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialConfigurationResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialConfigurationResponse.java deleted file mode 100644 index 49595b3a1e6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialConfigurationResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FinancialConfigurationContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class FinancialConfigurationResponse { -private ResponseInfo responseInfo ; -private List financialConfigurations; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialStatusRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialStatusRequest.java deleted file mode 100644 index 56dde20f1a3..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialStatusRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FinancialStatusContract; - -import lombok.Data; -public @Data class FinancialStatusRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List financialStatuses =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialStatusResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialStatusResponse.java deleted file mode 100644 index 4b3f762bbe9..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialStatusResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FinancialStatusContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class FinancialStatusResponse { -private ResponseInfo responseInfo ; -private List financialStatuses; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialYearRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialYearRequest.java deleted file mode 100644 index 8998b6ab360..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialYearRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FinancialYearContract; - -import lombok.Data; -public @Data class FinancialYearRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List financialYears =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialYearResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialYearResponse.java deleted file mode 100644 index c0206d12d69..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FinancialYearResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FinancialYearContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class FinancialYearResponse { -private ResponseInfo responseInfo ; -private List financialYears; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FiscalPeriodRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FiscalPeriodRequest.java deleted file mode 100644 index cb469715091..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FiscalPeriodRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FiscalPeriodContract; - -import lombok.Data; -public @Data class FiscalPeriodRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List fiscalPeriods =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FiscalPeriodResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FiscalPeriodResponse.java deleted file mode 100644 index 1f2f273d0f4..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FiscalPeriodResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FiscalPeriodContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class FiscalPeriodResponse { -private ResponseInfo responseInfo ; -private List fiscalPeriods; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionRequest.java deleted file mode 100644 index 97d15a0c8b5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FunctionContract; - -import lombok.Data; -public @Data class FunctionRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List functions =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionResponse.java deleted file mode 100644 index c2410ece6f6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FunctionContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class FunctionResponse { -private ResponseInfo responseInfo ; -private List functions; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionaryRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionaryRequest.java deleted file mode 100644 index 82659530af5..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionaryRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FunctionaryContract; - -import lombok.Data; -public @Data class FunctionaryRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List functionaries =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionaryResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionaryResponse.java deleted file mode 100644 index 72a5ece1403..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FunctionaryResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FunctionaryContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class FunctionaryResponse { -private ResponseInfo responseInfo ; -private List functionaries; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundRequest.java deleted file mode 100644 index c0133a196fe..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundRequest.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.egov.egf.master.web.requests; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FundContract; - -import lombok.Data; - -public @Data class FundRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List funds = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundResponse.java deleted file mode 100644 index 1e6289f6d49..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.egov.egf.master.web.requests; - -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FundContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class FundResponse { - private ResponseInfo responseInfo; - private List funds; - private PaginationContract page; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundsourceRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundsourceRequest.java deleted file mode 100644 index 47b55ff0a7b..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundsourceRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.FundsourceContract; - -import lombok.Data; -public @Data class FundsourceRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List fundsources =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundsourceResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundsourceResponse.java deleted file mode 100644 index e9e4eb88382..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/FundsourceResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.FundsourceContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class FundsourceResponse { -private ResponseInfo responseInfo ; -private List fundsources; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/RecoveryRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/RecoveryRequest.java deleted file mode 100644 index 7ba9d448cc7..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/RecoveryRequest.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.egov.egf.master.web.requests; - -import lombok.Data; -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.RecoveryContract; - -import java.util.ArrayList; -import java.util.List; - -public @Data class RecoveryRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List recoverys = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/RecoveryResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/RecoveryResponse.java deleted file mode 100644 index bed2cf4bbc6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/RecoveryResponse.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.egov.egf.master.web.requests; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import lombok.Data; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.common.web.contract.PaginationContract; -import org.egov.egf.master.web.contract.RecoveryContract; - -import java.util.List; - -@JsonInclude(value = Include.NON_NULL) -public @Data class RecoveryResponse { - private ResponseInfo responseInfo; - private List recoverys; - private PaginationContract page; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SchemeRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SchemeRequest.java deleted file mode 100644 index f42a6a916e6..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SchemeRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.SchemeContract; - -import lombok.Data; -public @Data class SchemeRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List schemes =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SchemeResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SchemeResponse.java deleted file mode 100644 index fe89c1cbd0e..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SchemeResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.SchemeContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class SchemeResponse { -private ResponseInfo responseInfo ; -private List schemes; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SubSchemeRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SubSchemeRequest.java deleted file mode 100644 index 7b735b198ce..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SubSchemeRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.SubSchemeContract; - -import lombok.Data; -public @Data class SubSchemeRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List subSchemes =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SubSchemeResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SubSchemeResponse.java deleted file mode 100644 index 65192959837..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SubSchemeResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.SubSchemeContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class SubSchemeResponse { -private ResponseInfo responseInfo ; -private List subSchemes; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SupplierRequest.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SupplierRequest.java deleted file mode 100644 index fcb2649748f..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SupplierRequest.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.egf.master.web.contract.SupplierContract; - -import lombok.Data; -public @Data class SupplierRequest { -private RequestInfo requestInfo = new RequestInfo(); -private List suppliers =new ArrayList() ; -} \ No newline at end of file diff --git a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SupplierResponse.java b/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SupplierResponse.java deleted file mode 100644 index 03404536100..00000000000 --- a/business-services/egf-master/src/main/java/org/egov/egf/master/web/requests/SupplierResponse.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.egov.egf.master.web.requests; -import java.util.List; - -import org.egov.common.web.contract.PaginationContract; -import org.egov.common.contract.response.ResponseInfo; -import org.egov.egf.master.web.contract.SupplierContract; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; -@JsonInclude(value=Include.NON_NULL)public @Data class SupplierResponse { -private ResponseInfo responseInfo ; -private List suppliers; -private PaginationContract page;} \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/application.properties b/business-services/egf-master/src/main/resources/application.properties deleted file mode 100644 index 6deba3d9b31..00000000000 --- a/business-services/egf-master/src/main/resources/application.properties +++ /dev/null @@ -1,99 +0,0 @@ -server.port=8280 -server.context-path=/egf-master -server.servlet.context-path=/egf-master - -persist.through.kafka=yes - -fetch_data_from=db - -app.timezone=UTC - -spring.datasource.driver-class-name=org.postgresql.Driver - -spring.datasource.url=jdbc:postgresql://localhost:5432/egf-master - -spring.datasource.username=postgres -spring.datasource.password=postgres - -kafka.topics.egf.masters.validated.key=egov.egf.masters.bank.validated.key - -spring.kafka.listener.missing-topics-fatal=false - -#Kafka Topic config -kafka.topics.egf.masters.validated.topic=egov.egf.masters.validated.topic -kafka.topics.egf.masters.validated.group=egov.egf.masters.validated.group -kafka.topics.egf.masters.validated.id=egov.egf.masters.bank.validated.id - -kafka.topics.egf.masters.completed.topic=egov.egf.masters.completed -kafka.topics.egf.masters.completed.group=egov.egf.masters.completed.group - -kafka.topics.egf.masters.bank.validated.key=egov.egf.masters.bank.validated.key -kafka.topics.egf.masters.bankbranch.validated.key=egov.egf.masters.bankbranch.validated.key -kafka.topics.egf.masters.bankaccount.validated.key=egov.egf.masters.bankaccount.validated.key -kafka.topics.egf.masters.accountcodepurpose.validated.key=egov.egf.masters.accountcodepurpose.validated.key -kafka.topics.egf.masters.accountdetailkey.validated.key=egov.egf.masters.accountdetailkey.validated.key -kafka.topics.egf.masters.accountdetailtype.validated.key=egov.egf.masters.accountdetailtype.validated.key -kafka.topics.egf.masters.accountentity.validated.key=egov.egf.masters.accountentity.validated.key -kafka.topics.egf.masters.budgetgroup.validated.key=egov.egf.masters.budgetgroup.validated.key -kafka.topics.egf.masters.chartofaccount.validated.key=egov.egf.masters.chartofaccount.validated.key -kafka.topics.egf.masters.chartofaccountdetail.validated.key=egov.egf.masters.chartofaccountdetail.validated.key -kafka.topics.egf.masters.financialyear.validated.key=egov.egf.masters.financialyear.validated.key -kafka.topics.egf.masters.fiscalperiod.validated.key=egov.egf.masters.fiscalperiod.validated.key -kafka.topics.egf.masters.functionary.validated.key=egov.egf.masters.functionary.validated.key -kafka.topics.egf.masters.function.validated.key=egov.egf.masters.function.validated.key -kafka.topics.egf.masters.fund.validated.key=egov.egf.masters.fund.validated.key -kafka.topics.egf.masters.fundsource.validated.key=egov.egf.masters.fundsource.validated.key -kafka.topics.egf.masters.scheme.validated.key=egov.egf.masters.scheme.validated.key -kafka.topics.egf.masters.subscheme.validated.key=egov.egf.masters.subscheme.validated.key -kafka.topics.egf.masters.supplier.validated.key=egov.egf.masters.supplierfund.validated.key -kafka.topics.egf.masters.financialstatus.validated.key=egov.egf.masters.financialstatus.validated.key -kafka.topics.egf.masters.financialconfiguration.validated.key=egov.egf.masters.financialconfiguration.validated.key -kafka.topics.egf.masters.recovery.validated.key=egov.egf.masters.recovery.validated.key - - -kafka.topics.egf.masters.bank.completed.key=egov.egf.masters.bank.completed.key -kafka.topics.egf.masters.bankbranch.completed.key=egov.egf.masters.bankbranch.completed.key -kafka.topics.egf.masters.bankaccount.completed.key=egov.egf.masters.bankaccount.completed.key -kafka.topics.egf.masters.accountcodepurpose.completed.key=egov.egf.masters.accountcodepurpose.completed.key -kafka.topics.egf.masters.accountdetailkey.completed.key=egov.egf.masters.accountdetailkey.completed.key -kafka.topics.egf.masters.accountdetailtype.completed.key=egov.egf.masters.accountdetailtype.completed.key -kafka.topics.egf.masters.accountentity.completed.key=egov.egf.masters.accountentity.completed.key -kafka.topics.egf.masters.budgetgroup.completed.key=egov.egf.masters.budgetgroup.completed.key -kafka.topics.egf.masters.chartofaccount.completed.key=egov.egf.masters.chartofaccount.completed.key -kafka.topics.egf.masters.chartofaccountdetail.completed.key=egov.egf.masters.chartofaccountdetail.completed.key -kafka.topics.egf.masters.financialyear.completed.key=egov.egf.masters.financialyear.completed.key -kafka.topics.egf.masters.fiscalperiod.completed.key=egov.egf.masters.fiscalperiod.completed.key -kafka.topics.egf.masters.functionary.completed.key=egov.egf.masters.functionary.completed.key -kafka.topics.egf.masters.function.completed.key=egov.egf.masters.function.completed.key -kafka.topics.egf.masters.fund.completed.key=egov.egf.masters.fund.completed.key -kafka.topics.egf.masters.fundsource.completed.key=egov.egf.masters.fundsource.completed.key -kafka.topics.egf.masters.scheme.completed.key=egov.egf.masters.scheme.completed.key -kafka.topics.egf.masters.subscheme.completed.key=egov.egf.masters.subscheme.completed.key -kafka.topics.egf.masters.supplier.completed.key=egov.egf.masters.supplier.completed.key -kafka.topics.egf.masters.financialstatus.completed.key=egov.egf.masters.financialstatus.completed.key -kafka.topics.egf.masters.financialconfiguration.completed.key=egov.egf.masters.financialconfiguration.completed.key -kafka.topics.egf.masters.recovery.completed.key=egov.egf.masters.recovery.completed.key -spring.flyway.user=postgres -spring.flyway.password=postgres -#spring.flyway.outOfOrder=true -spring.flyway.table=egf_masters_schema_version -spring.flyway.baseline-on-migrate=true -spring.flyway.url=jdbc:postgresql://localhost:5432/egf-master -spring.flyway.locations=classpath:/db/migration/main,db/migration/seed,db/migration/dev - -es.host=localhost -es.transport.port=9300 -es.cluster.name=docker-cluster - -egf.master.host.url=http://localhost:8280 - -logging.pattern.console=%clr(%X{CORRELATION_ID:-}) %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} - -spring.kafka.consumer.properties.spring.json.use.type.headers=false -spring.kafka.consumer.value-deserializer=org.egov.common.queue.HashMapDeserializer -spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.group-id=egf-master -spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer - -logging.level.org.egov=DEBUG \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/Dockerfile b/business-services/egf-master/src/main/resources/db/Dockerfile deleted file mode 100644 index bb0039c3f3f..00000000000 --- a/business-services/egf-master/src/main/resources/db/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM egovio/flyway:4.1.2 - -COPY ./migration/main /flyway/sql - -COPY ./migration/seed /flyway/seed - -COPY ./migration/dev /flyway/dev - -COPY ./migration/qa /flyway/qa - -COPY migrate.sh /usr/bin/migrate.sh - -RUN chmod +x /usr/bin/migrate.sh - -CMD ["/usr/bin/migrate.sh"] diff --git a/business-services/egf-master/src/main/resources/db/migrate.sh b/business-services/egf-master/src/main/resources/db/migrate.sh deleted file mode 100644 index 54d07c0940a..00000000000 --- a/business-services/egf-master/src/main/resources/db/migrate.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150149__chartofaccounts_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150149__chartofaccounts_data.sql deleted file mode 100644 index 9a70ea7eae6..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150149__chartofaccounts_data.sql +++ /dev/null @@ -1,1225 +0,0 @@ -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1, '1', 'Income', NULL, NULL, false, NULL, 'I', 0, false, false, '1', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (2, '2', 'Expenses', NULL, NULL, false, NULL, 'E', 0, false, false, '2', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (4, '4', 'Assets', NULL, NULL, false, NULL, 'A', 0, false, false, '4', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (3, '3', 'Liabilities', NULL, NULL, false, NULL, 'L', 0, false, false, '3', NULL, NULL, NULL, NULL, 0, 'default'); - -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (5, '110', 'Tax Revenue', NULL, NULL, false, 1, 'I', 1, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (6, '120', 'Assigned Revenues & Compensations', NULL, NULL, false, 1, 'I', 1, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (7, '130', 'Rental Income from Municipal Properties', NULL, NULL, false, 1, 'I', 1, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (8, '140', 'Fees & User Charges', NULL, NULL, false, 1, 'I', 1, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (9, '150', 'Sale & Hire Charges', NULL, NULL, false, 1, 'I', 1, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (10, '160', 'Revenue Grants, Contribution and Subsidies', NULL, NULL, false, 1, 'I', 1, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (11, '170', 'Income from Investments', NULL, NULL, false, 1, 'I', 1, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (12, '171', 'Interest Earned', NULL, NULL, false, 1, 'I', 1, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (13, '210', 'Establishment Expenses', NULL, NULL, false, 2, 'E', 1, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (14, '220', 'Administrative Expenses', NULL, NULL, false, 2, 'E', 1, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (15, '230', 'Operations & Maintenance', NULL, NULL, false, 2, 'E', 1, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (16, '240', 'Interest & Finance Charges', NULL, NULL, false, 2, 'E', 1, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (17, '250', 'Programme Expenses', NULL, NULL, false, 2, 'E', 1, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (18, '260', 'Revenue Grants, Contribution and Subsidies', NULL, NULL, false, 2, 'E', 1, false, false, '260', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (19, '270', 'Provisions and Write off', NULL, NULL, false, 2, 'E', 1, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (20, '271', 'Miscellaneous Expenses', NULL, NULL, false, 2, 'E', 1, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (21, '272', 'Depreciation', 17, NULL, false, 2, 'E', 1, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (22, '280', 'Prior Period Item', NULL, NULL, false, 2, 'E', 1, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (23, '290', 'Transfer to Reserve Funds', NULL, NULL, false, 2, 'E', 1, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (24, '310', 'Municipal Fund', NULL, NULL, false, 3, 'L', 1, false, false, '310', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (25, '311', 'Earmarked Funds', NULL, NULL, false, 3, 'L', 1, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (26, '312', 'Reserves', 18, NULL, false, 3, 'L', 1, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (27, '320', 'Grants , Contribution for specific purposes', NULL, NULL, false, 3, 'L', 1, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (28, '330', 'Secured Loans', NULL, NULL, false, 3, 'L', 1, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (29, '331', 'Unsecured Loans', NULL, NULL, false, 3, 'L', 1, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (30, '340', 'Deposits Received', NULL, NULL, false, 3, 'L', 1, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (31, '341', 'Deposit works', NULL, NULL, false, 3, 'L', 1, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (32, '350', 'Other Liabilities', NULL, NULL, false, 3, 'L', 1, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (33, '360', 'Provisions', NULL, NULL, false, 3, 'L', 1, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (34, '410', 'Fixed Assets', 11, NULL, false, 4, 'A', 1, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (35, '411', 'Accumulated Depreciation', 15, NULL, false, 4, 'A', 1, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (36, '412', 'Capital Work-In-Progress', NULL, NULL, false, 4, 'A', 1, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (37, '420', 'Investments - General Fund', NULL, NULL, false, 4, 'A', 1, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (38, '421', 'Investments - Other Funds', NULL, NULL, false, 4, 'A', 1, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (39, '430', 'Stock - in- hand', NULL, NULL, false, 4, 'A', 1, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (40, '431', 'Sundry Debtors (Receivables)', NULL, NULL, false, 4, 'A', 1, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (41, '432', 'Accumulated Provisions against Debtors (Receivables)', NULL, NULL, false, 4, 'A', 1, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (42, '440', 'Pre-paid Expenses', NULL, NULL, false, 4, 'A', 1, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (43, '450', 'Cash and Bank balance', NULL, NULL, false, 4, 'A', 1, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (44, '460', 'Loans, Advances and Deposits', NULL, NULL, false, 4, 'A', 1, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (45, '461', 'Accumulated Provisions against Loans, Advances and Deposits', NULL, NULL, false, 4, 'A', 1, false, false, '461', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (46, '470', 'Other Assets', NULL, NULL, false, 4, 'A', 1, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (47, '480', 'Miscellaneous Expenditure to be written off', NULL, NULL, false, 4, 'A', 1, false, false, '480', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (48, '11001', 'Property Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (49, '11002', 'Water Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (50, '11003', 'Sewerage Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (51, '11004', 'Conservancy Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (52, '11005', 'Lighting Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (53, '11006', 'Education Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (54, '11007', 'Vehicle Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (55, '11008', 'Tax on Animals', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (56, '11011', 'Advertisement Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (57, '11012', 'Pilgrimage Tax', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (58, '11051', 'Octroi and Toll', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (59, '11052', 'Cess', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (60, '11080', 'Others Taxes', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (61, '11090', 'Tax Remission and Refund', NULL, NULL, false, 5, 'I', 2, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (62, '12010', 'Taxes and Duties collected by others', NULL, NULL, false, 6, 'I', 2, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (63, '12020', 'Compensation in lieu of Taxes and duties', NULL, NULL, false, 6, 'I', 2, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (64, '12030', 'Compensations in lieu of Concessions', NULL, NULL, false, 6, 'I', 2, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (65, '13010', 'Rent from Civic Amenities', NULL, NULL, false, 7, 'I', 2, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (66, '13020', 'Rent from Office Buildings', NULL, NULL, false, 7, 'I', 2, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (67, '13030', 'Rent from Guest Houses', NULL, NULL, false, 7, 'I', 2, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (68, '13040', 'Rent from lease of lands', NULL, NULL, false, 7, 'I', 2, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (69, '13080', 'Other rents', NULL, NULL, false, 7, 'I', 2, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (70, '13090', 'Rent remission and refund', NULL, NULL, false, 7, 'I', 2, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (71, '14010', 'Empanelment and Registration Charges', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (72, '14011', 'Licensing Fees', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (73, '14012', 'Fees for Grant of Permit', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (74, '14013', 'Fees for Certificate or Extract', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (75, '14014', 'Development Charges', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (76, '14015', 'Regularization Fees', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (77, '14020', 'Penalties and Fines', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (78, '14040', 'Other Fees', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (79, '14050', 'User Charges', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (80, '14060', 'Entry Fees', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (81, '14070', 'Service Administrative Charges', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (82, '14080', 'Other Charges', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (83, '14090', 'Fees Remission and Refund', NULL, NULL, false, 8, 'I', 2, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (84, '15010', 'Sale of Products', NULL, NULL, false, 9, 'I', 2, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (85, '15011', 'Sale of Forms and Publications', NULL, NULL, false, 9, 'I', 2, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (86, '15012', 'Sale of stores and scrap', NULL, NULL, false, 9, 'I', 2, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (87, '15030', 'Sale of others', NULL, NULL, false, 9, 'I', 2, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (88, '15040', 'Hire Charges for Vehicles', NULL, NULL, false, 9, 'I', 2, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (89, '15041', 'Hire Charges on Equipments', NULL, NULL, false, 9, 'I', 2, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (90, '16010', 'Revenue Grant', NULL, NULL, false, 10, 'I', 2, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (91, '16020', 'Re-imbursement of expenses', NULL, NULL, false, 10, 'I', 2, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (92, '16030', 'Contribution towards schemes', NULL, NULL, false, 10, 'I', 2, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (93, '17010', 'Interest', NULL, NULL, false, 11, 'I', 2, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (94, '17020', 'Dividend', NULL, NULL, false, 11, 'I', 2, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (95, '17030', 'Income from projects taken up on commercial basis', NULL, NULL, false, 11, 'I', 2, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (96, '17040', 'Profit in Sale of Investments', NULL, NULL, false, 11, 'I', 2, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (97, '17080', 'Others', NULL, NULL, false, 11, 'I', 2, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (98, '17110', 'Interest from Bank Accounts', NULL, NULL, false, 12, 'I', 2, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (99, '17120', 'Interest on Loans and advances to Employees', NULL, NULL, false, 12, 'I', 2, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (100, '17130', 'Interest on loans to others', NULL, NULL, false, 12, 'I', 2, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (101, '17180', 'Other Interest', NULL, NULL, false, 12, 'I', 2, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (102, '18010', 'Deposits Forfeited', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (103, '18011', 'Lapsed Deposits', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (104, '18020', 'Insurance Claim Recovery', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (105, '18030', 'Profit on Disposal of Fixed assets', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (106, '18040', 'Recovery from Employees', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (107, '18050', 'Unclaimed Refund Payable Liabilities Written Back', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (108, '18060', 'Excess Provisions written back', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (109, '18080', 'Miscellaneous Income', NULL, NULL, false, 557, 'I', 2, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (110, '31010', 'General Fund', NULL, NULL, false, 24, 'L', 2, false, false, '310', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (111, '31090', 'Excess of Income over Expenditure', NULL, NULL, false, 24, 'L', 2, false, false, '310', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (112, '31110', 'Special Funds', NULL, NULL, false, 25, 'L', 2, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (113, '31150', 'Sinking Funds', NULL, NULL, false, 25, 'L', 2, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (114, '31170', 'Trust or Agency Funds', NULL, NULL, false, 25, 'L', 2, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (115, '31210', 'Capital Contribution', NULL, NULL, false, 26, 'L', 2, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (116, '31211', 'Capital Reserve', NULL, NULL, false, 26, 'L', 2, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (117, '31220', 'Borrowing Redemption reserve', NULL, NULL, false, 26, 'L', 2, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (118, '31230', 'Special Funds (Utilised)', NULL, NULL, false, 26, 'L', 2, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (119, '31240', 'Statutory Reserve', NULL, NULL, false, 26, 'L', 2, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (120, '31250', 'General Reserve', NULL, NULL, false, 26, 'L', 2, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (121, '31260', 'Revaluation Reserve', NULL, NULL, false, 26, 'L', 2, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (122, '32010', 'Central Government', NULL, NULL, false, 27, 'L', 2, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (123, '32020', 'State Government', NULL, NULL, false, 27, 'L', 2, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (124, '32030', 'Other Government Agencies', NULL, NULL, false, 27, 'L', 2, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (125, '32040', 'Financial Institutions', NULL, NULL, false, 27, 'L', 2, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (126, '32050', 'Welfare Bodies', NULL, NULL, false, 27, 'L', 2, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (127, '32060', 'International Organizations', NULL, NULL, false, 27, 'L', 2, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (128, '32080', 'Others', NULL, NULL, false, 27, 'L', 2, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (129, '33010', 'Loans from Central Government', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (130, '33020', 'Loans from State Government', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (131, '33030', 'Loans from Government Bodies and Association', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (132, '33040', 'Loans from International Agencies', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (133, '33050', 'Loans from Banks and Other Financial Institutions', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (134, '33060', 'Other Term Loans', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (135, '33070', 'Bonds and Debentures', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (136, '33080', 'Other Loans', NULL, NULL, false, 28, 'L', 2, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (137, '33110', 'Loans from Central Government', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (138, '33120', 'Loans from State Government', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (139, '33130', 'Loans from Government Bodies and Association', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (140, '33140', 'Loans from International Agencies', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (141, '33150', 'Loans from Banks and Other Financial Institutions', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (142, '33160', 'Other Term Loans', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (143, '33170', 'Bonds and Debentures', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (144, '33180', 'Other Loans', NULL, NULL, false, 29, 'L', 2, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (145, '34010', 'From Contractors Suppliers', NULL, NULL, false, 30, 'L', 2, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (146, '34020', 'Deposits – Revenues', NULL, NULL, false, 30, 'L', 2, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (147, '34030', 'From Staff', NULL, NULL, false, 30, 'L', 2, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (148, '34080', 'From Others', NULL, NULL, false, 30, 'L', 2, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (149, '34110', 'Civil works', NULL, NULL, false, 31, 'L', 2, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (150, '34120', 'Electrical works', NULL, NULL, false, 31, 'L', 2, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (151, '34180', 'Others', NULL, NULL, false, 31, 'L', 2, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (152, '35010', 'Creditors', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (153, '35011', 'Employee liabilities', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (154, '35012', 'Interest Accrued and due', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (155, '35020', 'Recoveries payable', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (156, '35030', 'Government Dues payable', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (157, '35040', 'Refunds payable', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (158, '35041', 'Advance Collection of Revenues', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (159, '35080', 'Others', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (160, '35090', 'Sale Proceeds', NULL, NULL, false, 32, 'L', 2, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (161, '36010', 'Provisions for Expenses', NULL, NULL, false, 33, 'L', 2, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (162, '36020', 'Provision for Interest', NULL, NULL, false, 33, 'L', 2, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (163, '36030', 'Provision for Other Assets', NULL, NULL, false, 33, 'L', 2, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (164, '36040', 'Provisions for Doubtful receivables', NULL, NULL, false, 33, 'L', 2, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (165, '41010', 'Land', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (166, '41020', 'Buildings', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (167, '41030', 'Roads and Bridges', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (168, '41031', 'Sewerage and Drainage', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (169, '41032', 'Water works', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (170, '41033', 'Public Lighting', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (171, '41040', 'Plant and Machinery', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (172, '41050', 'Vehicles', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (173, '41060', 'Office and Other Equipments', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (174, '41070', 'Furniture, Fixtures, Fittings and Electrical Appliances', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (175, '41080', 'Other Fixed Assets', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (176, '41090', 'Assets under Disposal', NULL, NULL, false, 34, 'A', 2, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (177, '41120', 'Buildings', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (178, '41130', 'Roads and Bridges', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (179, '41131', 'Sewerage and Drainage', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (180, '41132', 'Waterways', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (181, '41133', 'Public Lighting', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (182, '41140', 'Plant and Machinery', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (183, '41150', 'Vehicles', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (184, '41160', 'Office and Other Equipments', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (185, '41170', 'Furniture, Fixtures, Fittings and Electrical Appliances', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (186, '41180', 'Other Fixed Assets', NULL, NULL, false, 35, 'A', 2, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (187, '41200', 'General', NULL, NULL, false, 36, 'A', 2, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (188, '41210', 'Specific Grants', NULL, NULL, false, 36, 'A', 2, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (189, '41220', 'Special funds', NULL, NULL, false, 36, 'A', 2, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (190, '41230', 'Specific Schemes', NULL, NULL, false, 36, 'A', 2, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (191, '42010', 'Central Government Securities', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (192, '42020', 'State Government Securities', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (193, '42030', 'Debentures and Bonds', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (194, '42040', 'Preference Shares', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (195, '42050', 'Equity Shares', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (196, '42060', 'Units of Mutual Funds', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (197, '42080', 'Other Investments', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (198, '42090', 'Accumulated Provision', NULL, NULL, false, 37, 'A', 2, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (199, '42110', 'Central Government Securities', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (200, '42120', 'State Government Securities', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (201, '42130', 'Debentures and Bonds', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (202, '42140', 'Preference Shares', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (203, '42150', 'Equity Shares', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (204, '42160', 'Units of Mutual Funds', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (205, '42180', 'Other Investments', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (206, '42190', 'Accumulated Provision', NULL, NULL, false, 38, 'A', 2, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (208, '43010', 'Stores', NULL, NULL, false, 39, 'A', 2, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (209, '43020', 'Loose Tools', NULL, NULL, false, 39, 'A', 2, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (210, '43080', 'Others', NULL, NULL, false, 39, 'A', 2, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (211, '43110', 'Receivables for Property Taxes', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (212, '43119', 'Receivable for Other Taxes', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (213, '43120', 'Receivables for Cess', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (214, '43130', 'Receivable for Fees and User Charges', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (215, '43140', 'Receivable from other sources', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (216, '43150', 'Receivable from Government', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (217, '43180', 'Receivables control accounts', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (218, '43191', 'State Govt Cess/ levies in Property Taxes - Control account', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (219, '43192', 'State Govt Cess/ levies in Water Taxes - Control account', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (220, '43199', 'State Govt Cess/ levies in Other Taxes - Control account', NULL, NULL, false, 40, 'A', 2, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (221, '43210', 'Provision for outstanding Property Taxes', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (222, '43211', 'Provision for outstanding Water Taxes', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (223, '43212', 'Provision for outstanding Other Taxes', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (224, '43220', 'Provision for outstanding Cess', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (225, '43230', 'Provision for outstanding Fees and User Charges', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (226, '43240', 'Provision for outstanding other receivable', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (229, '43291', 'State Govt Cess/ levies in Property Taxes - Provision account', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (230, '43292', 'State Govt Cess/ levies in Water Taxes - Provision account', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (231, '43299', 'State Govt Cess/ levies in Other Taxes - Provision account', NULL, NULL, false, 41, 'A', 2, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (232, '44010', 'Establishment', NULL, NULL, false, 42, 'A', 2, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (233, '44020', 'Administration', NULL, NULL, false, 42, 'A', 2, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (234, '44030', 'Operations and Maintenance', NULL, NULL, false, 42, 'A', 2, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (235, '45010', 'Cash', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (237, '45021', 'Nationalised Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (238, '45022', 'Other Scheduled Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (239, '45023', 'Scheduled Co-operative Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (240, '45024', 'Post Office', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (241, '45041', 'Nationalised Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (242, '45042', 'Other Scheduled Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (243, '45043', 'Scheduled Co-operative Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (244, '45044', 'Post Office', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (245, '45061', 'Nationalised Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (246, '45062', 'Other Scheduled Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (247, '45063', 'Scheduled Co-operative Banks', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (248, '45064', 'Post Office', NULL, NULL, false, 43, 'A', 2, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (249, '46010', 'Loans and advances to employees', NULL, NULL, false, 44, 'A', 2, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (250, '46020', 'Employee Provident Fund Loans', NULL, NULL, false, 44, 'A', 2, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (251, '46030', 'Loans to Others', NULL, NULL, false, 44, 'A', 2, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (252, '46040', 'Advance to Suppliers and contractors', NULL, NULL, false, 44, 'A', 2, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (253, '46050', 'Advance to others', NULL, NULL, false, 44, 'A', 2, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (254, '46060', 'Deposits with external Agencies', NULL, NULL, false, 44, 'A', 2, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (255, '46080', 'Other Current Assets', NULL, NULL, false, 44, 'A', 2, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (256, '46110', 'Loans to Others', NULL, NULL, false, 45, 'A', 2, false, false, '461', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (257, '46120', 'Advances', NULL, NULL, false, 45, 'A', 2, false, false, '461', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (258, '46130', 'Deposits', NULL, NULL, false, 45, 'A', 2, false, false, '461', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (259, '47010', 'Deposit Works – Expenditure', NULL, NULL, false, 46, 'A', 2, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (260, '47020', 'Inter Unit Accounts', NULL, NULL, false, 46, 'A', 2, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (261, '47030', 'Interest Control Payable', NULL, NULL, false, 46, 'A', 2, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (262, '48010', 'Loan Issue Expenses', NULL, NULL, false, 47, 'A', 2, false, false, '480', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (263, '48020', 'Discount on Issue of loans', NULL, NULL, false, 47, 'A', 2, false, false, '480', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (264, '48030', 'Others', NULL, NULL, false, 47, 'A', 2, false, false, '480', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (265, '21010', 'Salaries, Wages and Bonus', NULL, NULL, false, 13, 'E', 2, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (266, '21020', 'Benefits and Allowances', NULL, NULL, false, 13, 'E', 2, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (267, '21030', 'Pension', NULL, NULL, false, 13, 'E', 2, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (268, '21040', 'Other Terminal and Retirement Benefits', NULL, NULL, false, 13, 'E', 2, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (269, '22010', 'Rent, Rates and Taxes', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (270, '22011', 'Office maintenance', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (271, '22012', 'Communication Expenses', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (272, '22020', 'Books and Periodicals', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (273, '22021', 'Printing and Stationery', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (274, '22030', 'Traveling and Conveyance', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (275, '22040', 'Insurance', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (276, '22050', 'Audit Fees', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (277, '22051', 'Legal Expenses', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (278, '22052', 'Professional and other Fees', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (279, '22060', 'Advertisement and Publicity', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (280, '22061', 'Membership and subscriptions', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (281, '22080', 'Others', NULL, NULL, false, 14, 'E', 2, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (282, '23010', 'Power and Fuel', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (283, '23020', 'Bulk Purchases', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (284, '23030', 'Consumption of Stores', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (285, '23040', 'Hire Charges', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (286, '23050', 'Repairs and maintenance Infrastructure Assets', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (287, '23051', 'Repairs and maintenance - Civic Amenities', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (288, '23052', 'Repairs and maintenance – Buildings', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (289, '23053', 'Repairs and maintenance – Vehicles', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (290, '23059', 'Repairs and maintenance – Others', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (291, '23080', 'Other operating and maintenance expenses', NULL, NULL, false, 15, 'E', 2, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (292, '24010', 'Interest on Loans from Central Government', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (293, '24020', 'Interest on Loans from State Government', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (294, '24030', 'Interest on Loans from Government Bodies and Associations', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (295, '24040', 'Interest on Loans from International Agencies', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (296, '24050', 'Interest on Loans from Banks and Other Financial Institutions', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (297, '24060', 'Other Interest', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (298, '24070', 'Bank Charges', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (299, '24080', 'Other Finance Expenses', NULL, NULL, false, 16, 'E', 2, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (300, '25010', 'Election Expenses', NULL, NULL, false, 17, 'E', 2, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (301, '25020', 'Own Programme', NULL, NULL, false, 17, 'E', 2, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (302, '25030', 'Share in Programme of others', NULL, NULL, false, 17, 'E', 2, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (303, '26010', 'Grants', NULL, NULL, false, 18, 'E', 2, false, false, '260', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (304, '26020', 'Contributions', NULL, NULL, false, 18, 'E', 2, false, false, '260', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (305, '26030', 'Subsidies', NULL, NULL, false, 18, 'E', 2, false, false, '260', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (306, '27010', 'Provisions for Doubtful receivables', NULL, NULL, false, 19, 'E', 2, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (307, '27020', 'Provision for other Assets', NULL, NULL, false, 19, 'E', 2, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (308, '27030', 'Revenues written off', NULL, NULL, false, 19, 'E', 2, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (309, '27040', 'Assets written off', NULL, NULL, false, 19, 'E', 2, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (310, '27050', 'Miscellaneous Expense written off', NULL, NULL, false, 19, 'E', 2, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (311, '27110', 'Loss on disposal of Assets', NULL, NULL, false, 20, 'E', 2, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (312, '27120', 'Loss on disposal of Investments', NULL, NULL, false, 20, 'E', 2, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (313, '27130', 'Decline in Value of Investments', NULL, NULL, false, 20, 'E', 2, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (314, '27180', 'Other miscellaneous expenditure', NULL, NULL, false, 20, 'E', 2, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (315, '27220', 'Buildings', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (316, '27230', 'Roads and Bridges', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (317, '27231', 'Sewerage and Drainage', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (318, '27232', 'Waterways', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (319, '27233', 'Public Lighting', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (320, '27240', 'Plant and machinery', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (321, '27250', 'Vehicles', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (322, '27260', 'Office and Other Equipments', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (323, '27270', 'Furniture, Fixtures, Fittings and Electrical Appliances', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (324, '27280', 'Other Fixed Assets', NULL, NULL, false, 21, 'E', 2, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (325, '28010', 'Taxes', NULL, NULL, false, 22, 'E', 2, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (326, '28020', 'Other – Revenues', NULL, NULL, false, 22, 'E', 2, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (327, '28030', 'Recovery of revenues written off', NULL, NULL, false, 22, 'E', 2, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (328, '28040', 'Other Income', NULL, NULL, false, 22, 'E', 2, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (329, '28050', 'Refund of Taxes', NULL, NULL, false, 22, 'E', 2, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (330, '28060', 'Refund of Other – Revenues', NULL, NULL, false, 22, 'E', 2, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (331, '28080', 'Other Expenses', NULL, NULL, false, 22, 'E', 2, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (332, '29010', 'Transfer to Capital Funds', NULL, NULL, false, 23, 'E', 2, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (333, '29020', 'Transfer to Earmarked Funds', NULL, NULL, false, 23, 'E', 2, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (334, '29030', 'Revenue Surplus', NULL, NULL, false, 23, 'E', 2, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (335, '1100101', 'Property Tax-Properties – General', NULL, NULL, true, 48, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (336, '1100102', 'Property Tax-Vacant Land', NULL, NULL, true, 48, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (337, '1100103', 'Property Tax-State Government Properties', NULL, NULL, true, 48, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (338, '1100104', 'Property Tax-State Government Undertaking Properties', NULL, NULL, true, 48, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (339, '1100105', 'Property Tax-Central Government Undertaking Properties', NULL, NULL, true, 48, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (340, '1100106', 'Property Tax-Service Charges in lieu of Property Tax', NULL, NULL, true, 48, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (341, '1100201', 'Water Tax-Properties – Water Tax', NULL, NULL, true, 49, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (342, '1100202', 'Water Tax-Direct Water Tax', NULL, NULL, true, 49, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (343, '1100301', 'Sewerage Tax-Properties – Sewerage Tax', NULL, NULL, true, 50, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (344, '1100401', 'Conservancy Tax-Properties – Conservancy Tax', NULL, NULL, true, 51, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (345, '1100501', 'Lighting Tax-Properties – Lighting Tax', NULL, NULL, true, 52, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (346, '1100601', 'Education Tax-Properties – Education Tax', NULL, NULL, true, 53, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (347, '1100700', 'Vehicle Tax-Vehicle Tax', NULL, NULL, true, 54, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (348, '1100800', 'Tax on Animals-Tax on Animals', NULL, NULL, true, 55, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (349, '1101101', 'Advertisement Tax-Land Hoardings', NULL, NULL, true, 56, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (350, '1101102', 'Advertisement Tax-Bus Shelters', NULL, NULL, true, 56, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (351, '1101103', 'Advertisement Tax-Hoardings on Vehicles', NULL, NULL, true, 56, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (352, '1101104', 'Advertisement Tax-Traffic Signals', NULL, NULL, true, 56, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (353, '1101105', 'Advertisement Tax-Adv. Tax on Cable Operators', NULL, NULL, true, 56, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (354, '1101200', 'Pilgrimage Tax-Pilgrimage Tax', NULL, NULL, true, 57, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (355, '1105100', 'Octroi and Toll-Octroi & Toll', NULL, NULL, true, 58, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (356, '1105200', 'Cess-Cess', NULL, NULL, true, 59, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (357, '1108001', 'Others Taxes-Tax on Cable Operators', NULL, NULL, true, 60, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (358, '1109001', 'Tax Remission and Refund-Vacancy Remission', NULL, NULL, true, 61, 'I', 4, false, false, '110', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (359, '1201001', 'Taxes and Duties collected by others-Surcharge on Stamp Duty for Transfer of Immovable Properties', NULL, NULL, true, 62, 'I', 4, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (360, '1201002', 'Taxes and Duties collected by others-Entertainment Tax', NULL, NULL, true, 62, 'I', 4, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (361, '1201003', 'Taxes and Duties collected by others-Profession Tax', NULL, NULL, true, 62, 'I', 4, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (362, '1202001', 'Compensation in lieu of Taxes and duties-Compensation in lieu of Octroi & Toll Tax', NULL, NULL, true, 63, 'I', 4, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (363, '1202002', 'Compensation in lieu of Taxes and duties-Compensation in lieu of Motor Vehicles Tax', NULL, NULL, true, 63, 'I', 4, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (364, '1203001', 'Compensations in lieu of Concessions-Property Tax compensations due to concessions to tax payers', NULL, NULL, true, 64, 'I', 4, false, false, '120', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (365, '1301001', 'Rent from Civic Amenities-Markets', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (366, '1301002', 'Rent from Civic Amenities-Auditoriums', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (367, '1301003', 'Rent from Civic Amenities-Function/Community Halls', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (368, '1301004', 'Rent from Civic Amenities-Playgrounds', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (369, '1301005', 'Rent from Civic Amenities-Staff Quarters', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (370, '1301006', 'Rent from Civic Amenities-Canteens', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (371, '1301007', 'Rent from Civic Amenities-Stalls in Slaughter Houses', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (372, '1301008', 'Rent from Civic Amenities-Lease of Canteen/Cycle Stands in slaughter houses', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (373, '1301009', 'Rent from Civic Amenities-Nurseries', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (374, '1301010', 'Rent from Civic Amenities-Lease/Rent from Parking Places', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (375, '1301011', 'Rent from Civic Amenities-Lease of Traffic Islands/ Central Media', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (376, '1301012', 'Rent from Civic Amenities-Lease of Land for Bus Shelters', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (377, '1301013', 'Rent from Civic Amenities-Lease of Jetties & Boats', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (378, '1301014', 'Rent from Civic Amenities-Lease of Advertisement Right', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (379, '1301015', 'Rent from Civic Amenities-Shopping Complexes', NULL, NULL, true, 65, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (380, '1302001', 'Rent from Office Buildings-Government', NULL, NULL, true, 66, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (381, '1302002', 'Rent from Office Buildings-Private', NULL, NULL, true, 66, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (382, '1303001', 'Rent from Guest Houses-Guest House', NULL, NULL, true, 67, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (383, '1304001', 'Rent from lease of lands-Lease of Land', NULL, NULL, true, 68, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (384, '1308000', 'Other rents-Other rents', NULL, NULL, true, 69, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (385, '1309000', 'Rent remission and refund-Rent remission and refund', NULL, NULL, true, 70, 'I', 4, false, false, '130', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (386, '1401001', 'Empanelment and Registration Charges-Contractors, Agencies etc', NULL, NULL, true, 71, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (387, '1401002', 'Empanelment and Registration Charges-Technical Professionals', NULL, NULL, true, 71, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (388, '1401003', 'Empanelment and Registration Charges-P.W. Contractors', NULL, NULL, true, 71, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (389, '1401004', 'Empanelment and Registration Charges-Carts', NULL, NULL, true, 71, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (390, '1401005', 'Empanelment and Registration Charges-Patients', NULL, NULL, true, 71, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (391, '1401101', 'Licensing Fees-Trade License', NULL, NULL, true, 72, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (392, '1401102', 'Licensing Fees-Cattle Pounding', NULL, NULL, true, 72, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (393, '1401103', 'Licensing Fees-Licensing of Animals', NULL, NULL, true, 72, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (394, '1401104', 'Licensing Fees-Slaughter House', NULL, NULL, true, 72, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (395, '1401105', 'Licensing Fees-Butchers & Traders of Meat', NULL, NULL, true, 72, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (396, '1401106', 'Licensing Fees-Encroachment Fee', NULL, NULL, true, 72, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (397, '1401201', 'Fees for Grant of Permit-Layout/Sub-division', NULL, NULL, true, 73, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (398, '1401202', 'Fees for Grant of Permit-Building Permit Fee', NULL, NULL, true, 73, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (399, '1401203', 'Fees for Grant of Permit-Fee for Erection of Hoardings', NULL, NULL, true, 73, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (400, '1401204', 'Fees for Grant of Permit-Intensive Zoning Fee', NULL, NULL, true, 73, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (401, '1401205', 'Fees for Grant of Permit-Film Shooting in Parks', NULL, NULL, true, 73, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (402, '1401206', 'Fees for Grant of Permit-Animal Slaughtering Fee', NULL, NULL, true, 73, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (403, '1401207', 'Fees for Grant of Permit-Beef Export Slaughtering Fee', NULL, NULL, true, 73, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (404, '1401301', 'Fees for Certificate or Extract-Copy of Plan/Certificate', NULL, NULL, true, 74, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (405, '1401302', 'Fees for Certificate or Extract-Birth & Death certificates', NULL, NULL, true, 74, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (406, '1401401', 'Development Charges-Building Development Charges', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (407, '1401402', 'Development Charges-Betterment Charges', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (408, '1401403', 'Development Charges-External Betterment Charges', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (409, '1401404', 'Development Charges-Special Development Contribution', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (410, '1401405', 'Development Charges-Impact Fee', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (411, '1401406', 'Development Charges-Un-Authorised Colony Improvement Contribution', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (412, '1401407', 'Development Charges-Open Space Contribution', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (413, '1401408', 'Development Charges-Parking Contribution', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (414, '1401409', 'Development Charges-Postage & Advertisement Charges', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (415, '1401410', 'Development Charges-Other town planning receipts', NULL, NULL, true, 75, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (416, '1401501', 'Regularization Fees-Building Regularization', NULL, NULL, true, 76, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (417, '1402001', 'Penalties and Fines-Penalty for Un-authorised Construction', NULL, NULL, true, 77, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (418, '1402002', 'Penalties and Fines-Contractors', NULL, NULL, true, 77, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (419, '1402003', 'Penalties and Fines-Continuing Penalty for Un- authorised Construction', NULL, NULL, true, 77, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (420, '1402004', 'Penalties and Fines-Spot Fines', NULL, NULL, true, 77, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (421, '1404001', 'Other Fees-Advertisement Fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (422, '1404002', 'Other Fees-Admission Fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (423, '1404003', 'Other Fees-Sports Fee', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (424, '1404004', 'Other Fees-Library Fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (425, '1404005', 'Other Fees-Survey fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (426, '1404006', 'Other Fees-Connection/ Disconnection Charges', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (427, '1404007', 'Other Fees-Notice Fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (428, '1404008', 'Other Fees-Warrant & Distraint Fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (429, '1404009', 'Other Fees-Mutation Fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (430, '1404010', 'Other Fees-Property Transfer Charges', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (431, '1404011', 'Other Fees-Other Fees', NULL, NULL, true, 78, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (432, '1405001', 'User Charges-Medicines', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (433, '1405002', 'User Charges-Examination Charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (434, '1405003', 'User Charges-Ambulance', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (435, '1405004', 'User Charges-Funeral Van', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (436, '1405005', 'User Charges-Garbage Collection Charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (437, '1405006', 'User Charges-Littering and Debris collection', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (438, '1405007', 'User Charges-Septic Tank clearance', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (439, '1405008', 'User Charges-Special Sanitation Charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (440, '1405009', 'User Charges-Sewerage clearance charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (441, '1405010', 'User Charges-Crematorium Charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (442, '1405011', 'User Charges-Burial Ground Charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (443, '1405012', 'User Charges-Pay & use toilets', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (444, '1405013', 'User Charges-Water Supply', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (445, '1405014', 'User Charges-Sale of Electricity', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (446, '1405015', 'User Charges-Water Tanker', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (447, '1405016', 'User Charges-Meter charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (448, '1405017', 'User Charges-Fire Extinguishing', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (449, '1405018', 'User Charges-Lighting charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (450, '1405019', 'User Charges-Ticket charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (451, '1405020', 'User Charges-Luggage charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (452, '1405021', 'User Charges-Parking fees', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (453, '1405022', 'User Charges-Pre-Paid Parking Fee', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (454, '1405023', 'User Charges-Post-Paid Parking Fee', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (455, '1405024', 'User Charges-Quality Control Charges', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (456, '1405025', 'User Charges-Coaching Camp', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (457, '1405026', 'User Charges-Gym', NULL, NULL, true, 79, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (458, '1406001', 'Entry Fees-Parks', NULL, NULL, true, 80, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (459, '1406002', 'Entry Fees-Playgrounds', NULL, NULL, true, 80, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (460, '1406003', 'Entry Fees-Swimming Pool', NULL, NULL, true, 80, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (461, '1406004', 'Entry Fees-Zoo', NULL, NULL, true, 80, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (462, '1406005', 'Entry Fees-Museum', NULL, NULL, true, 80, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (463, '1406006', 'Entry Fees-Monuments', NULL, NULL, true, 80, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (464, '1406007', 'Entry Fees-Gym', NULL, NULL, true, 80, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (465, '1407001', 'Service Administrative Charges-Road Cutting & Restoration Charges', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (466, '1407002', 'Service Administrative Charges-Library Cess Collection Administrative Charges', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (467, '1407003', 'Service Administrative Charges-Plan Preparation Charges', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (468, '1407004', 'Service Administrative Charges-Removal of Un-authorised Hoardings', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (469, '1407005', 'Service Administrative Charges-Removal of Demolition', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (470, '1407006', 'Service Administrative Charges-Removal of Encroachments', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (471, '1407007', 'Service Administrative Charges-Removal of Public Nuisances', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (472, '1407008', 'Service Administrative Charges-Administrative Charges for Deposit Works', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (473, '1407009', 'Service Administrative Charges-NOC of Public Health Section', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (474, '1407011', 'Service Administrative Charges-Water Supply – Tap Estimation Charges', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (475, '1407012', 'Service Administrative Charges-Water Supply – Tap repairs', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (476, '1407013', 'Service Administrative Charges-Solvency Certificate', NULL, NULL, true, 81, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (477, '1408001', 'Other Charges-Compounding fee', NULL, NULL, true, 82, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (478, '1409001', 'Fees Remission and Refund-Refund of Fees', NULL, NULL, true, 83, 'I', 4, false, false, '140', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (479, '1501001', 'Sale of Products-Tree-Guards', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (480, '1501002', 'Sale of Products-House Number Plates', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (481, '1501003', 'Sale of Products-Raw Water', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (482, '1501004', 'Sale of Products-Nursery plants', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (483, '1501005', 'Sale of Products-Grass, Flowers & Fruits', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (484, '1501006', 'Sale of Products-Trees', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (485, '1501007', 'Sale of Products-Rubbish', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (486, '1501008', 'Sale of Products-Garbage', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (487, '1501009', 'Sale of Products-Manure', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (488, '1501010', 'Sale of Products-Compost', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (489, '1501011', 'Sale of Products-Water meter', NULL, NULL, true, 84, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (490, '1501101', 'Sale of Forms and Publications-Tenders Schedules', NULL, NULL, true, 85, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (491, '1501102', 'Sale of Forms and Publications-Data, Plans & Maps', NULL, NULL, true, 85, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (492, '1501103', 'Sale of Forms and Publications-Forms & Pass Books', NULL, NULL, true, 85, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (493, '1501201', 'Sale of stores and scrap-Obsolete stores', NULL, NULL, true, 86, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (494, '1501202', 'Sale of stores and scrap-Scrap', NULL, NULL, true, 86, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (495, '1503001', 'Sale of others-Assets', NULL, NULL, true, 87, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (496, '1503002', 'Sale of others-Old newspapers', NULL, NULL, true, 87, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (497, '1504001', 'Hire Charges for Vehicles-Cars, Jeeps and Buses', NULL, NULL, true, 88, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (498, '1504101', 'Hire Charges on Equipments-Rollers', NULL, NULL, true, 89, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (499, '1504102', 'Hire Charges on Equipments-Tools & Equipments', NULL, NULL, true, 89, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (500, '1504103', 'Hire Charges on Equipments-Medical Equipments', NULL, NULL, true, 89, 'I', 4, false, false, '150', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (501, '1601001', 'Revenue Grant-Road Maintenance Grant', NULL, NULL, true, 90, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (502, '1601002', 'Revenue Grant-Per Capita Grant', NULL, NULL, true, 90, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (503, '1601003', 'Revenue Grant-Census Grant', NULL, NULL, true, 90, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (504, '1601004', 'Revenue Grant-Election Grants', NULL, NULL, true, 90, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (505, '1601005', 'Revenue Grant-Family Welfare Grant', NULL, NULL, true, 90, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (506, '1602001', 'Re-imbursement of expenses-Election Expenses', NULL, NULL, true, 91, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (507, '1602002', 'Re-imbursement of expenses-External-aided Projects', NULL, NULL, true, 91, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (508, '1602003', 'Re-imbursement of expenses-Family Planning Centre Expenses', NULL, NULL, true, 91, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (509, '1602004', 'Re-imbursement of expenses-Family Planning Incentives', NULL, NULL, true, 91, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (510, '1602005', 'Re-imbursement of expenses-Anti Malaria Expenses', NULL, NULL, true, 91, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (511, '1603001', 'Contribution towards schemes-Swarna Jayanthi Shari Rojgar Yojana', NULL, NULL, true, 92, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (512, '1603002', 'Contribution towards schemes-National Slum Development Project', NULL, NULL, true, 92, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (513, '1603003', 'Contribution towards schemes-Integrated Development of Small and Medium Towns', NULL, NULL, true, 92, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (514, '1603004', 'Contribution towards schemes-Integrated Low Cost Sanitation', NULL, NULL, true, 92, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (515, '1603005', 'Contribution towards schemes-Water Supply –Donation', NULL, NULL, true, 92, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (516, '1603006', 'Contribution towards schemes-Sewerage Donation', NULL, NULL, true, 92, 'I', 4, false, false, '160', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (517, '1701001', 'Interest-Fixed Deposits with Scheduled Banks', NULL, NULL, true, 93, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (518, '1701002', 'Interest-Fixed Deposits with Private Banks', NULL, NULL, true, 93, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (519, '1701003', 'Interest-Government Securities', NULL, NULL, true, 93, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (520, '1701004', 'Interest-Post office deposits', NULL, NULL, true, 93, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (521, '1702001', 'Dividend-Mutual Fund Investments', NULL, NULL, true, 94, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (522, '1703000', 'Income from projects taken up on commercial basis-Income from projects taken up on commercial basis', NULL, NULL, true, 95, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (523, '1704001', 'Profit in Sale of Investments-Mutual Fund Investment', NULL, NULL, true, 96, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (524, '1708001', 'Others-Application in Value of Investment', NULL, NULL, true, 97, 'I', 4, false, false, '170', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (525, '1711001', 'Interest from Bank Accounts-SB accounts', NULL, NULL, true, 98, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (526, '1712001', 'Interest on Loans and advances to Employees-House Building Advance', NULL, NULL, true, 99, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (527, '1712002', 'Interest on Loans and advances to Employees-Hire Purchase Quarters', NULL, NULL, true, 99, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (528, '1712003', 'Interest on Loans and advances to Employees-Conveyance Advance (Vehicle Advance)', NULL, NULL, true, 99, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (529, '1712004', 'Interest on Loans and advances to Employees-Marriage Advance', NULL, NULL, true, 99, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (530, '1712005', 'Interest on Loans and advances to Employees-Computer Advance', NULL, NULL, true, 99, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (531, '1713000', 'Interest on loans to others-Interest on loans to others', NULL, NULL, true, 100, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (532, '1718001', 'Other Interest-Interest on Late Payment', NULL, NULL, true, 101, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (533, '1718002', 'Other Interest-Interest on HP Sales', NULL, NULL, true, 101, 'I', 4, false, false, '171', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (534, '1801001', 'Deposits Forfeited-Security Deposits', NULL, NULL, true, 102, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (535, '1801101', 'Lapsed Deposits-Earnest Money Deposit', NULL, NULL, true, 103, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (536, '1801102', 'Lapsed Deposits-Deposits', NULL, NULL, true, 103, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (537, '1802000', 'Insurance Claim Recovery-Insurance Claim Recovery', NULL, NULL, true, 104, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (538, '1803000', 'Profit on Disposal of Fixed assets-Profit on Disposal of Fixed assets', NULL, NULL, true, 105, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (539, '1804001', 'Recovery from Employees-Recovery of Private Trunk calls charges', NULL, NULL, true, 106, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (540, '1804002', 'Recovery from Employees-Recovery of Vehicle Use Charges', NULL, NULL, true, 106, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (541, '1804003', 'Recovery from Employees-Recovery of Water & Electricity Charges', NULL, NULL, true, 106, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (542, '1804004', 'Recovery from Employees-Recovery of cell phone charges', NULL, NULL, true, 106, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (543, '1805001', 'Unclaimed Refund Payable Liabilities Written Back-Liabilities', NULL, NULL, true, 107, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (544, '1805002', 'Unclaimed Refund Payable Liabilities Written Back-Stale Cheques', NULL, NULL, true, 107, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (545, '1806001', 'Excess Provisions written back-Property Tax', NULL, NULL, true, 108, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (546, '1806002', 'Excess Provisions written back-Advertisement Tax', NULL, NULL, true, 108, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (547, '1806003', 'Excess Provisions written back-Trade License', NULL, NULL, true, 108, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (548, '1806004', 'Excess Provisions written back-confluence.egovernments.org', NULL, NULL, true, 108, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (549, '1806005', 'Excess Provisions written back-Loans & Advances to Others', NULL, NULL, true, 108, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (550, '1806006', 'Excess Provisions written back-Others', NULL, NULL, true, 108, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (551, '1808001', 'Miscellaneous Income-Pension & Leave Salary Contribution', NULL, NULL, true, 109, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (552, '1808002', 'Miscellaneous Income-Bounced Cheques Realization Charges', NULL, NULL, true, 109, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (553, '1808003', 'Miscellaneous Income-Fines Imposed by the Court', NULL, NULL, true, 109, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (554, '1808004', 'Miscellaneous Income-Prior Period Income', NULL, NULL, true, 109, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (555, '1808005', 'Miscellaneous Income-Penalties', NULL, NULL, true, 109, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (556, '1808006', 'Miscellaneous Income-Other Income Un-Classified', NULL, NULL, true, 109, 'I', 4, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (557, '180', 'Other Income', NULL, NULL, false, 1, 'I', 1, false, false, '180', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (558, '2101001', 'Salaries, Wages and Bonus-Basic Pay', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (559, '2101002', 'Salaries, Wages and Bonus-Dearness Allowance', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (560, '2101003', 'Salaries, Wages and Bonus-House Rent Allowance', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (561, '2101004', 'Salaries, Wages and Bonus-CCA', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (562, '2101005', 'Salaries, Wages and Bonus-Conveyance Allowance', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (563, '2101006', 'Salaries, Wages and Bonus-Interim Relief', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (564, '2101007', 'Salaries, Wages and Bonus-Surrender Leave Encashment', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (565, '2101008', 'Salaries, Wages and Bonus-Performance Bonus', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (566, '2101009', 'Salaries, Wages and Bonus-Honorarium/Sitting Fees to Corporators', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (567, '2101010', 'Salaries, Wages and Bonus-Honorarium – others', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (568, '2101011', 'Salaries, Wages and Bonus-Wages to workers through Placement Agencies', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (569, '2101012', 'Salaries, Wages and Bonus-Pensionary Contribution', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (570, '2101013', 'Salaries, Wages and Bonus-Anticipatory Pension', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (571, '2101016', 'Salaries, Wages and Bonus-Family Planning Incentive', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (572, '2101017', 'Salaries, Wages and Bonus-Graduate Allowance', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (573, '2101018', 'Salaries, Wages and Bonus-Post Graduate Allowance', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (574, '2101019', 'Salaries, Wages and Bonus-Stagnation Increment', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (575, '2101020', 'Salaries, Wages and Bonus-Addl. House Rent Allowance', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (576, '2101021', 'Salaries, Wages and Bonus-Dearness Pay', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (577, '2101022', 'Salaries, Wages and Bonus-Special Pay', NULL, NULL, true, 265, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (578, '2102001', 'Benefits and Allowances-Leave Travel Concession', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (579, '2102002', 'Benefits and Allowances-Medical Reimbursement', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (580, '2102003', 'Benefits and Allowances-Tuition Fees', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (581, '2102004', 'Benefits and Allowances-Education Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (582, '2102005', 'Benefits and Allowances-Uniform allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (583, '2102006', 'Benefits and Allowances-Workmen Compensations', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (584, '2102007', 'Benefits and Allowances-Training', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (585, '2102008', 'Benefits and Allowances-Concession in Bus-Pass', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (586, '2102009', 'Benefits and Allowances-Staff Welfare Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (587, '2102010', 'Benefits and Allowances-Educational Concession & Scholarships', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (588, '2102011', 'Benefits and Allowances-Over Time Allowances', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (589, '2102012', 'Benefits and Allowances-Special Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (590, '2102013', 'Benefits and Allowances-Addl. Charge Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (591, '2102014', 'Benefits and Allowances-Suspension Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (592, '2102016', 'Benefits and Allowances-Night Shift Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (593, '2102017', 'Benefits and Allowances-Conveyance Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (594, '2102018', 'Benefits and Allowances-Non Private Practice Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (595, '2102019', 'Benefits and Allowances-Washing Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (596, '2102020', 'Benefits and Allowances-Physically Handicapped Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (597, '2102021', 'Benefits and Allowances-Tribal/Bad Climate Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (598, '2102022', 'Benefits and Allowances-Risk Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (599, '2102023', 'Benefits and Allowances-Typist Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (600, '2102024', 'Benefits and Allowances-Computer Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (601, '2102025', 'Benefits and Allowances-Academic Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (602, '2102026', 'Benefits and Allowances-Higher Classes Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (603, '2102027', 'Benefits and Allowances-Reading Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (604, '2102028', 'Benefits and Allowances-Supervisory Allowance', NULL, NULL, true, 266, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (605, '2103001', 'Pension-Service Pension', NULL, NULL, true, 267, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (606, '2103002', 'Pension-Family Pension', NULL, NULL, true, 267, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (607, '2103003', 'Pension-Provisional Pension', NULL, NULL, true, 267, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (608, '2104001', 'Other Terminal and Retirement Benefits-Leave encashment on retirement', NULL, NULL, true, 268, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (609, '2104002', 'Other Terminal and Retirement Benefits-Death cum Retirement gratuity', NULL, NULL, true, 268, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (610, '2104003', 'Other Terminal and Retirement Benefits-Commuted Pension', NULL, NULL, true, 268, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (611, '2104004', 'Other Terminal and Retirement Benefits-Pension and Leave Salary Contributions for Deputationists', NULL, NULL, true, 268, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (612, '2104005', 'Other Terminal and Retirement Benefits-General Provident Fund Shortfall', NULL, NULL, true, 268, 'E', 4, false, false, '210', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (613, '2201001', 'Rent, Rates and Taxes-Rents for Hired Premises', NULL, NULL, true, 269, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (614, '2201002', 'Rent, Rates and Taxes-Rates and Taxes', NULL, NULL, true, 269, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (615, '2201101', 'Office maintenance-Electricity Charges', NULL, NULL, true, 270, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (616, '2201102', 'Office maintenance-Water charges security expenses', NULL, NULL, true, 270, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (617, '2201103', 'Office maintenance-Office Security', NULL, NULL, true, 270, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (618, '2201201', 'Communication Expenses-Telephone', NULL, NULL, true, 271, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (619, '2201202', 'Communication Expenses-Mobiles', NULL, NULL, true, 271, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (620, '2201203', 'Communication Expenses-Faxes', NULL, NULL, true, 271, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (621, '2201204', 'Communication Expenses-Leased Lines & Internet', NULL, NULL, true, 271, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (622, '2202001', 'Books and Periodicals-Newspapers & Journals', NULL, NULL, true, 272, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (623, '2202002', 'Books and Periodicals-Magazines', NULL, NULL, true, 272, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (624, '2202101', 'Printing and Stationery-Printing', NULL, NULL, true, 273, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (625, '2202102', 'Printing and Stationery-Stationery', NULL, NULL, true, 273, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (626, '2202103', 'Printing and Stationery-Computer Consumables', NULL, NULL, true, 273, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (627, '2202104', 'Printing and Stationery-Service postage', NULL, NULL, true, 273, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (628, '2203001', 'Traveling and Conveyance-Traveling – In land', NULL, NULL, true, 274, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (629, '2203002', 'Traveling and Conveyance-Traveling – Abroad', NULL, NULL, true, 274, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (630, '2203003', 'Traveling and Conveyance-Fuel – (Petrol & Diesel)', NULL, NULL, true, 274, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (631, '2204001', 'Insurance-Buildings', NULL, NULL, true, 275, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (632, '2204002', 'Insurance-Vehicles', NULL, NULL, true, 275, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (633, '2204003', 'Insurance-Electronic Equipment', NULL, NULL, true, 275, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (634, '2204004', 'Insurance-Furniture', NULL, NULL, true, 275, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (635, '2204005', 'Insurance-Inventory', NULL, NULL, true, 275, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (636, '2205001', 'Audit Fees-Statutory Audit Fee', NULL, NULL, true, 276, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (637, '2205002', 'Audit Fees-Certification Fee', NULL, NULL, true, 276, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (638, '2205003', 'Audit Fees-Out of Pocket Expenses', NULL, NULL, true, 276, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (639, '2205101', 'Legal Expenses-Legal Fees', NULL, NULL, true, 277, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (640, '2205102', 'Legal Expenses-Cost of recoveries of tax revenue', NULL, NULL, true, 277, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (641, '2205103', 'Legal Expenses-Cost of recoveries of other revenues', NULL, NULL, true, 277, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (642, '2205104', 'Legal Expenses-Compensation ordered by courts', NULL, NULL, true, 277, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (643, '2205201', 'Professional and other Fees-Consultancy Charges', NULL, NULL, true, 278, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (644, '2205202', 'Professional and other Fees-Other Professional Charges', NULL, NULL, true, 278, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (645, '2206001', 'Advertisement and Publicity-Advertisement – Print Media', NULL, NULL, true, 279, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (646, '2206002', 'Advertisement and Publicity-Advertisement -TV & Radio media', NULL, NULL, true, 279, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (647, '2206003', 'Advertisement and Publicity-Hoardings', NULL, NULL, true, 279, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (648, '2206004', 'Advertisement and Publicity-Hospitality Expenses', NULL, NULL, true, 279, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (649, '2206005', 'Advertisement and Publicity-Organisation of Festivals', NULL, NULL, true, 279, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (650, '2206100', 'Membership and subscriptions-Membership & subscriptions', NULL, NULL, true, 280, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (651, '2208000', 'Others-Others', NULL, NULL, true, 281, 'E', 4, false, false, '220', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (652, '2301001', 'Power and Fuel-Power Charges for Street Lighting', NULL, NULL, true, 282, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (653, '2301002', 'Power and Fuel-Power charges for water pumping', NULL, NULL, true, 282, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (654, '2301003', 'Power and Fuel-Power charges for other services', NULL, NULL, true, 282, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (655, '2301004', 'Power and Fuel-Fuel to Heavy Vehicles', NULL, NULL, true, 282, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (656, '2301005', 'Power and Fuel-Fuel to Light Vehicles', NULL, NULL, true, 282, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (657, '2301006', 'Power and Fuel-Fuel supply for field staff vehicles', NULL, NULL, true, 282, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (658, '2302001', 'Bulk Purchases-Sanitation/Conservancy Material', NULL, NULL, true, 283, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (659, '2302002', 'Bulk Purchases-Purchase of Medicines', NULL, NULL, true, 283, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (660, '2303001', 'Consumption of Stores-Engineering Stores', NULL, NULL, true, 284, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (661, '2303002', 'Consumption of Stores-Transport Stores', NULL, NULL, true, 284, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (662, '2303003', 'Consumption of Stores-Medical Stores', NULL, NULL, true, 284, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (663, '2303004', 'Consumption of Stores-Central Stationary Stores', NULL, NULL, true, 284, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (664, '2304001', 'Hire Charges-Machinery Rent', NULL, NULL, true, 285, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (665, '2304002', 'Hire Charges-Vehicles', NULL, NULL, true, 285, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (666, '2305001', 'Repairs and maintenance Infrastructure Assets-Main Roads', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (667, '2305002', 'Repairs and maintenance Infrastructure Assets-By-lane Roads', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (668, '2305003', 'Repairs and maintenance Infrastructure Assets-Bridges', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (669, '2305004', 'Repairs and maintenance Infrastructure Assets-Fly-Overs', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (670, '2305005', 'Repairs and maintenance Infrastructure Assets-Water Supply Lines', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (671, '2305006', 'Repairs and maintenance Infrastructure Assets-Sewerage Lines', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (672, '2305007', 'Repairs and maintenance Infrastructure Assets-Storm Water Drains', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (673, '2305008', 'Repairs and maintenance Infrastructure Assets-Traffic Signals', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (674, '2305009', 'Repairs and maintenance Infrastructure Assets-Street Lighting', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (675, '2305010', 'Repairs and maintenance Infrastructure Assets-Burial Grounds', NULL, NULL, true, 286, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (676, '2305101', 'Repairs and maintenance - Civic Amenities-Major Parks', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (677, '2305102', 'Repairs and maintenance - Civic Amenities-Minor Parks', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (678, '2305103', 'Repairs and maintenance - Civic Amenities-Colony Parks', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (679, '2305104', 'Repairs and maintenance - Civic Amenities-Stadium', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (680, '2305105', 'Repairs and maintenance - Civic Amenities-Play Grounds', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (681, '2305106', 'Repairs and maintenance - Civic Amenities-Swimming Pools', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (682, '2305107', 'Repairs and maintenance - Civic Amenities-Nursery', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (683, '2305108', 'Repairs and maintenance - Civic Amenities-Play Materials', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (684, '2305109', 'Repairs and maintenance - Civic Amenities-Public Toilets', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (685, '2305110', 'Repairs and maintenance - Civic Amenities-Market Yards', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (686, '2305111', 'Repairs and maintenance - Civic Amenities-Parking Lots', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (687, '2305112', 'Repairs and maintenance - Civic Amenities-Avenue and Other Plantations', NULL, NULL, true, 287, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (688, '2305201', 'Repairs and maintenance – Buildings-Community Halls', NULL, NULL, true, 288, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (689, '2305202', 'Repairs and maintenance – Buildings-Commercial Complex', NULL, NULL, true, 288, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (690, '2305203', 'Repairs and maintenance – Buildings-Office Buildings', NULL, NULL, true, 288, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (691, '2305204', 'Repairs and maintenance – Buildings-Staff Quarters', NULL, NULL, true, 288, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (692, '2305301', 'Repairs and maintenance – Vehicles-Heavy Vehicles', NULL, NULL, true, 289, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (693, '2305302', 'Repairs and maintenance – Vehicles-Light Vehicles', NULL, NULL, true, 289, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (694, '2305901', 'Repairs and maintenance – Others-Furniture & Fixtures', NULL, NULL, true, 290, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (695, '2305902', 'Repairs and maintenance – Others-Computers & Net Work', NULL, NULL, true, 290, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (696, '2305903', 'Repairs and maintenance – Others-Electronic Equipment', NULL, NULL, true, 290, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (697, '2305904', 'Repairs and maintenance – Others-Office Equipment', NULL, NULL, true, 290, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (698, '2305905', 'Repairs and maintenance – Others-Survey & Drawing Equipment', NULL, NULL, true, 290, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (699, '2305906', 'Repairs and maintenance – Others-Plant & Machinery', NULL, NULL, true, 290, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (700, '2305907', 'Repairs and maintenance – Others-Conservancy Tools', NULL, NULL, true, 290, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (701, '2308001', 'Other operating and maintenance expenses-Garbage Clearance', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (702, '2308002', 'Other operating and maintenance expenses-Testing & Inspection', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (703, '2308003', 'Other operating and maintenance expenses-Field Survey & Inspection', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (704, '2308004', 'Other operating and maintenance expenses-Water Purification', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (705, '2308005', 'Other operating and maintenance expenses-Mapping, Plotting & Drawing Expenses', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (706, '2308006', 'Other operating and maintenance expenses-Naming & Numbering of Streets', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (707, '2308007', 'Other operating and maintenance expenses-Demolition & Removal Expenses', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (708, '2308008', 'Other operating and maintenance expenses-Quality Control Expenses', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (709, '2308009', 'Other operating and maintenance expenses-Prevention of Epidemics', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (710, '2308010', 'Other operating and maintenance expenses-Collection and Testing of Food Samples', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (711, '2308011', 'Other operating and maintenance expenses-Expenses on Unclaimed Dead Bodies', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (712, '2308012', 'Other operating and maintenance expenses-Control of Stray Animals', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (713, '2308013', 'Other operating and maintenance expenses-Sanitation/Conservancy Expenses', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (714, '2308014', 'Other operating and maintenance expenses-Intensive/Special Sanitation including for Fairs & Festivals', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (715, '2308015', 'Other operating and maintenance expenses-Maintenance of Garbage Dumping Yards/Transfer Stations', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (716, '2308016', 'Other operating and maintenance expenses-Maintenance of slaughter houses', NULL, NULL, true, 291, 'E', 4, false, false, '230', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (717, '2401000', 'Interest on Loans from Central Government-Interest on Loans from Central Government', NULL, NULL, true, 292, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (718, '2402000', 'Interest on Loans from State Government-Interest on Loans from State Government', NULL, NULL, true, 293, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (719, '2403000', 'Interest on Loans from Government Bodies and Associations-Interest on Loans from Government Bodies & Associations', NULL, NULL, true, 294, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (720, '2404000', 'Interest on Loans from International Agencies-Interest on Loans from International Agencies', NULL, NULL, true, 295, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (721, '2405000', 'Interest on Loans from Banks and Other Financial Institutions-Interest on Loans from Banks and Other Financial Institutions', NULL, NULL, true, 296, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (722, '2406001', 'Other Interest-Bonds', NULL, NULL, true, 297, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (723, '2406002', 'Other Interest-Finance Lease', NULL, NULL, true, 297, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (724, '2406003', 'Other Interest-Hire Purchase', NULL, NULL, true, 297, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (725, '2407001', 'Bank Charges-Miscellaneous Bank Charges', NULL, NULL, true, 298, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (726, '2408001', 'Other Finance Expenses-Expenses on Issue of Bonds', NULL, NULL, true, 299, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (727, '2408002', 'Other Finance Expenses-Surveillance Fee', NULL, NULL, true, 299, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (728, '2408003', 'Other Finance Expenses-Transaction Processing For Collections', NULL, NULL, true, 299, 'E', 4, false, false, '240', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (729, '2501001', 'Election Expenses-Local Body Elections', NULL, NULL, true, 300, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (730, '2501002', 'Election Expenses-MLA/MP Elections', NULL, NULL, true, 300, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (731, '2502001', 'Own Programme-Environmental Awareness Programme', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (732, '2502002', 'Own Programme-Urban Malaria Eradication', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (733, '2502003', 'Own Programme-Study Tour/Trainings', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (734, '2502004', 'Own Programme-Seminars', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (735, '2502005', 'Own Programme-Voluntary Garbage Disposal Programme', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (736, '2502006', 'Own Programme-Cultural Programmes', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (737, '2502007', 'Own Programme-Community Organisation / Mobilisation', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (738, '2502008', 'Own Programme-Special Nutritation Programme', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (739, '2502009', 'Own Programme-Summer/Winter Coaching Camps', NULL, NULL, true, 301, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (740, '2503001', 'Share in Programme of others-Family Welfare Programme', NULL, NULL, true, 302, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (741, '2503002', 'Share in Programme of others-Financial Aid for Urban Self Help Groups', NULL, NULL, true, 302, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (742, '2503003', 'Share in Programme of others-Disbursements to T&S / DWCUA and Self Help groups under SJSRY', NULL, NULL, true, 302, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (743, '2503004', 'Share in Programme of others-Shilparamam Greening/Others', NULL, NULL, true, 302, 'E', 4, false, false, '250', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (744, '2601000', 'Grants-Grants', NULL, NULL, true, 303, 'E', 4, false, false, '260', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (745, '2602000', 'Contributions-Contributions', NULL, NULL, true, 304, 'E', 4, false, false, '260', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (746, '2603000', 'Subsidies-Subsidies', NULL, NULL, true, 305, 'E', 4, false, false, '260', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (747, '2701001', 'Provisions for Doubtful receivables-Property Tax', NULL, NULL, true, 306, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (748, '2701002', 'Provisions for Doubtful receivables-Advertisement Tax', NULL, NULL, true, 306, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (749, '2701003', 'Provisions for Doubtful receivables-Others', NULL, NULL, true, 306, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (750, '2702001', 'Provision for other Assets-Inventory', NULL, NULL, true, 307, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (751, '2702002', 'Provision for other Assets-Investments', NULL, NULL, true, 307, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (752, '2702003', 'Provision for other Assets-Loans & Advances to others', NULL, NULL, true, 307, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (753, '2703001', 'Revenues written off-Property Tax', NULL, NULL, true, 308, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (754, '2703002', 'Revenues written off-Advertisement Tax', NULL, NULL, true, 308, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (755, '2703003', 'Revenues written off-Assigned Revenue', NULL, NULL, true, 308, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (756, '2704001', 'Assets written off-Stores', NULL, NULL, true, 309, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (757, '2704002', 'Assets written off-Investments', NULL, NULL, true, 309, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (758, '2704003', 'Assets written off-Decline in Fixed Assets', NULL, NULL, true, 309, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (759, '2704004', 'Assets written off-Loans & Advances to others', NULL, NULL, true, 309, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (760, '2705001', 'Miscellaneous Expense written off-Deferred Revenue Expenses', NULL, NULL, true, 310, 'E', 4, false, false, '270', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (761, '2711000', 'Loss on disposal of Assets-Loss on disposal of Assets', NULL, NULL, true, 311, 'E', 4, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (762, '2712001', 'Loss on disposal of Investments-Mutual Fund Investment', NULL, NULL, true, 312, 'E', 4, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (763, '2713000', 'Decline in Value of Investments-Decline in Value of Investments', NULL, NULL, true, 313, 'E', 4, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (764, '2718000', 'Other miscellaneous expenditure-Other miscellaneous expenditure', NULL, NULL, true, 314, 'E', 4, false, false, '271', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (765, '2722000', 'Buildings-Buildings', NULL, NULL, true, 315, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (766, '2723000', 'Roads and Bridges-Roads & Bridges', NULL, NULL, true, 316, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (767, '2723100', 'Sewerage and Drainage-Sewerage and Drainage', NULL, NULL, true, 317, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (768, '2723200', 'Waterways-Waterways', NULL, NULL, true, 318, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (769, '2723300', 'Public Lighting-Public Lighting', NULL, NULL, true, 319, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (770, '2724000', 'Plant and machinery-Plant & machinery', NULL, NULL, true, 320, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (771, '2725000', 'Vehicles-Vehicles', NULL, NULL, true, 321, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (772, '2726000', 'Office and Other Equipments-Office & Other Equipments', NULL, NULL, true, 322, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (773, '2727000', 'Furniture, Fixtures, Fittings and Electrical Appliances-Furniture, Fixtures, Fittings and Electrical Appliances', NULL, NULL, true, 323, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (774, '2728000', 'Other Fixed Assets-Other Fixed Assets', NULL, NULL, true, 324, 'E', 4, false, false, '272', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (775, '2801000', 'Taxes-Taxes', NULL, NULL, true, 325, 'E', 4, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (776, '2802000', 'Other – Revenues-Other – Revenues', NULL, NULL, true, 326, 'E', 4, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (777, '2803000', 'Recovery of revenues written off-Recovery of revenues written off', NULL, NULL, true, 327, 'E', 4, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (778, '2804000', 'Other Income-Other Income', NULL, NULL, true, 328, 'E', 4, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (779, '2805000', 'Refund of Taxes-Refund of Taxes', NULL, NULL, true, 329, 'E', 4, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (780, '2806000', 'Refund of Other – Revenues-Refund of Other – Revenues', NULL, NULL, true, 330, 'E', 4, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (781, '2808000', 'Other Expenses-Other Expenses', NULL, NULL, true, 331, 'E', 4, false, false, '280', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (782, '2901001', 'Transfer to Capital Funds-City Development Fund', NULL, NULL, true, 332, 'E', 4, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (783, '2901002', 'Transfer to Capital Funds-UCD Fund', NULL, NULL, true, 332, 'E', 4, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (784, '2902001', 'Transfer to Earmarked Funds-Sinking Fund', NULL, NULL, true, 333, 'E', 4, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (785, '2902002', 'Transfer to Earmarked Funds-Salary Reserve Fund', NULL, NULL, true, 333, 'E', 4, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (786, '2902003', 'Transfer to Earmarked Funds-Pension Reserve Fund', NULL, NULL, true, 333, 'E', 4, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (787, '2903001', 'Revenue Surplus-General Reserve', NULL, NULL, true, 334, 'E', 4, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (788, '2903002', 'Revenue Surplus-Surplus of Income Over Expenditure', NULL, NULL, true, 334, 'E', 4, false, false, '290', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (789, '3101001', 'General Fund-Revenue Transfers', NULL, NULL, true, 110, 'L', 4, false, false, '310', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (790, '3111001', 'Special Funds-City Development Fund', NULL, NULL, true, 112, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (791, '3111002', 'Special Funds-Urban Poverty Alleviation Fund', NULL, NULL, true, 112, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (792, '3111003', 'Special Funds-Abatement of Pollution of Rivers', NULL, NULL, true, 112, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (793, '3111004', 'Special Funds-Preservation of Heritage sites fund', NULL, NULL, true, 112, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (794, '3111005', 'Special Funds-Revolving Fund', NULL, NULL, true, 112, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (795, '3115001', 'Sinking Funds-City Development Bonds', NULL, NULL, true, 113, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (796, '3117001', 'Trust or Agency Funds-Salary Reserve Fund', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (797, '3117002', 'Trust or Agency Funds-Pension Fund', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (798, '3117003', 'Trust or Agency Funds-General Provident Fund', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (799, '3117004', 'Trust or Agency Funds-Leave Salary and Gratuity Fund', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (800, '3117005', 'Trust or Agency Funds-Employee Welfare Fund', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (801, '3117006', 'Trust or Agency Funds-Old age Pension', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (802, '3117007', 'Trust or Agency Funds-Widow Pension', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (803, '3117008', 'Trust or Agency Funds-Disabled Pension', NULL, NULL, true, 114, 'L', 4, false, false, '311', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (805, '3121000', 'Capital Contribution-Capital Contribution', NULL, NULL, true, 115, 'L', 4, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (806, '3121100', 'Capital Reserve-Capital Reserve', NULL, NULL, true, 116, 'L', 4, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (807, '3122000', 'Borrowing Redemption reserve-Borrowing Redemption reserve', NULL, NULL, true, 117, 'L', 4, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (808, '3123000', 'Special Funds (Utilised)-Special Funds (Utilised)', NULL, NULL, true, 118, 'L', 4, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (809, '3124000', 'Statutory Reserve-Statutory Reserve', NULL, NULL, true, 119, 'L', 4, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (810, '3125000', 'General Reserve-General Reserve', NULL, NULL, true, 120, 'L', 4, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (811, '3126001', 'Revaluation Reserve-Fixed Assets', NULL, NULL, true, 121, 'L', 4, false, false, '312', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (812, '3201001', 'Central Government-Adarsh Basti Scheme', NULL, NULL, true, 122, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (813, '3201002', 'Central Government-Abatement of Pollution of Rivers', NULL, NULL, true, 122, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (814, '3202001', 'State Government-Water Supply', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (815, '3202002', 'State Government-XIIth Finance Commission', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (816, '3202003', 'State Government-MP Local Area Development', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (817, '3202004', 'State Government-Assembly Constituency Development Programme', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (818, '3202005', 'State Government-Clean & Green Programme', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (819, '3202006', 'State Government-Janmabhoomi Programme', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (820, '3202007', 'State Government-Mega City Project (MCP)', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (821, '3202008', 'State Government-Improvement of Cities', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (822, '3202009', 'State Government-Charminar Pedestrianisation Project', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (823, '3202010', 'State Government-Rain Water Harvesting (RWH)', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (824, '3202011', 'State Government-Make City Green', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (825, '3202012', 'State Government-MRTS Project', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (826, '3202013', 'State Government-TWINS/e-Seva Project', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (827, '3202014', 'State Government-National Slum Development Programme (NSDP)', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (828, '3202015', 'State Government-Swarna Jayanthi Shahri Rozgar Yojana (SJSRY)/NRY', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (829, '3202016', 'State Government-Balika Samrudhi Yojana (BSY)', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (830, '3202017', 'State Government-Local Water Supply & Sewerage in Slums', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (831, '3202018', 'State Government-Urban Community Development (UCD)', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (832, '3202019', 'State Government-IPP VIII Project', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (833, '3202020', 'State Government-Natural Calamities Grant', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (834, '3202021', 'State Government-Reimbursement from Govt Departments including R&B', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (835, '3202022', 'State Government-Abatement of Pollution of Rivers', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (836, '3202023', 'State Government-Others', NULL, NULL, true, 123, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (837, '3203001', 'Other Government Agencies-Green House Gas Pollution Prevention Project', NULL, NULL, true, 124, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (838, '3204000', 'Financial Institutions-Financial Institutions', NULL, NULL, true, 125, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (839, '3205000', 'Welfare Bodies-Welfare Bodies', NULL, NULL, true, 126, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (840, '3206001', 'International Organizations-Water & Sanitation Programme (World Bank)', NULL, NULL, true, 127, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (841, '3206002', 'International Organizations-Urban Management/Cities Alliance Programme (UNCHS – World Bank)', NULL, NULL, true, 127, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (842, '3208001', 'Others-Public Contribution for Works', NULL, NULL, true, 128, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (843, '3208002', 'Others-Abatement of Pollution of River (Industry Contribution)', NULL, NULL, true, 128, 'L', 4, false, false, '320', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (844, '3301001', 'Loans from Central Government-Short Term Loan', NULL, NULL, true, 129, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (845, '3301002', 'Loans from Central Government-Long Term Loan', NULL, NULL, true, 129, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (846, '3302001', 'Loans from State Government-Short Term Loan', NULL, NULL, true, 130, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (847, '3302002', 'Loans from State Government-Long Term Loan', NULL, NULL, true, 130, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (848, '3303000', 'Loans from Government Bodies and Association-Loans from Government Bodies & Association', NULL, NULL, true, 131, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (849, '3304000', 'Loans from International Agencies-Loans from International Agencies', NULL, NULL, true, 132, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (850, '3305001', 'Loans from Banks and Other Financial Institutions-From Banks', NULL, NULL, true, 133, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (851, '3305002', 'Loans from Banks and Other Financial Institutions-From Other Financial Institutions', NULL, NULL, true, 133, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (852, '3305003', 'Loans from Banks and Other Financial Institutions-Institutional Agencies', NULL, NULL, true, 133, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (853, '3306001', 'Other Term Loans-HUDCO Loans', NULL, NULL, true, 134, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (854, '3306002', 'Other Term Loans-Others', NULL, NULL, true, 134, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (855, '3307001', 'Bonds and Debentures-City Development Bonds', NULL, NULL, true, 135, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (856, '3308000', 'Other Loans-Other Loans', NULL, NULL, true, 136, 'L', 4, false, false, '330', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (857, '3311001', 'Loans from Central Government-Short Term Loan', NULL, NULL, true, 137, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (858, '3311002', 'Loans from Central Government-Long Term Loan', NULL, NULL, true, 137, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (859, '3312001', 'Loans from State Government-Short Term Loan', NULL, NULL, true, 138, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (860, '3312002', 'Loans from State Government-Long Term Loan', NULL, NULL, true, 138, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (861, '3313000', 'Loans from Government Bodies and Association-Loans from Government Bodies and Association', NULL, NULL, true, 139, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (862, '3314000', 'Loans from International Agencies-Loans from International Agencies', NULL, NULL, true, 140, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (863, '3315001', 'Loans from Banks and Other Financial Institutions-From Banks', NULL, NULL, true, 141, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (864, '3315002', 'Loans from Banks and Other Financial Institutions-From Other Financial Institutions', NULL, NULL, true, 141, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (865, '3315003', 'Loans from Banks and Other Financial Institutions-Institutional Agencies', NULL, NULL, true, 141, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (866, '3316001', 'Other Term Loans-HUDCO Loans', NULL, NULL, true, 142, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (867, '3317001', 'Bonds and Debentures-City Development Bonds', NULL, NULL, true, 143, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (868, '3318000', 'Other Loans-', NULL, NULL, true, 144, 'L', 4, false, false, '331', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (869, '3401001', 'From Contractors Suppliers-Ernest Money Deposit', NULL, NULL, true, 145, 'L', 4, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (870, '3401002', 'From Contractors Suppliers-Retention Money Deposit', 95, NULL, true, 145, 'L', 4, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (871, '3401003', 'From Contractors Suppliers-Further Security Deposit', 29, NULL, true, 145, 'L', 4, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (872, '3402001', 'Deposits – Revenues-Rental Deposits', NULL, NULL, true, 146, 'L', 4, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (873, '3402002', 'Deposits – Revenues-Security Deposits', NULL, NULL, true, 146, 'L', 4, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (874, '3403000', 'From Staff-From Staff', NULL, NULL, true, 147, 'L', 4, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (875, '3408000', 'From Others-From Others', NULL, NULL, true, 148, 'L', 4, false, false, '340', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (876, '3411001', 'Civil works-State Government Departments', NULL, NULL, true, 149, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (877, '3411002', 'Civil works-Public Sector Undertakings', NULL, NULL, true, 149, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (878, '3411003', 'Civil works-Private Organizations & Citizens', NULL, NULL, true, 149, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (879, '3412001', 'Electrical works-State Government Departments', NULL, NULL, true, 150, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (880, '3412002', 'Electrical works-Public Sector Undertakings', NULL, NULL, true, 150, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (881, '3412003', 'Electrical works-Private Organizations & Citizens', NULL, NULL, true, 150, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (882, '3418001', 'Others-State Government Departments', NULL, NULL, true, 151, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (883, '3418002', 'Others-Public Sector Undertakings', NULL, NULL, true, 151, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (884, '3418003', 'Others-Private Organizations & Citizens', NULL, NULL, true, 151, 'L', 4, false, false, '341', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (886, '3501001', 'Creditors-Suppliers', 27, NULL, true, 152, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (887, '3501002', 'Creditors-Contractors', 26, NULL, true, 152, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (888, '3501003', 'Creditors-Expenses', 28, NULL, true, 152, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (889, '3501101', 'Employee liabilities-Salary Payable', NULL, NULL, true, 153, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (890, '3501102', 'Employee liabilities-Pension Payable', NULL, NULL, true, 153, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (891, '3501103', 'Employee liabilities-Leave Salary Payable', NULL, NULL, true, 153, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (892, '3501104', 'Employee liabilities-Terminal Benefits Payable', NULL, NULL, true, 153, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (893, '3501105', 'Employee liabilities-GPF Payable', NULL, NULL, true, 153, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (894, '3501106', 'Employee liabilities-Unpaid Salaries', NULL, NULL, true, 153, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (895, '3501107', 'Employee liabilities-Contributory Pension Payable', NULL, NULL, true, 153, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (896, '3501201', 'Interest Accrued and due-Central Government Loans', NULL, NULL, true, 154, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (897, '3501202', 'Interest Accrued and due-State Government Loans', NULL, NULL, true, 154, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (898, '3501203', 'Interest Accrued and due-International Agencies', NULL, NULL, true, 154, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (899, '3501204', 'Interest Accrued and due-Financial Institutions', NULL, NULL, true, 154, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (900, '3501205', 'Interest Accrued and due-Bonds', NULL, NULL, true, 154, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (901, '3501206', 'Interest Accrued and due-Others', NULL, NULL, true, 154, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (902, '3502001', 'Recoveries payable-GPF', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (903, '3502002', 'Recoveries payable-GPF –Employees on Deputation', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (904, '3502003', 'Recoveries payable-GIS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (905, '3502004', 'Recoveries payable-Profession Tax', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (906, '3502005', 'Recoveries payable-APGLI', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (907, '3502006', 'Recoveries payable-LIC', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (908, '3502007', 'Recoveries payable-Banks Loan', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (909, '3502008', 'Recoveries payable-TDS from Employees', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (910, '3502009', 'Recoveries payable-APWEF', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (911, '3502010', 'Recoveries payable-Court Recoveries', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (912, '3502011', 'Recoveries payable-House Rent (Other than Municipal Quarters)', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (913, '3502012', 'Recoveries payable-SCCS(SD)', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (914, '3502013', 'Recoveries payable-KCCS(SD)', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (915, '3502014', 'Recoveries payable-NGOCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (916, '3502015', 'Recoveries payable-SMUCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (917, '3502016', 'Recoveries payable-MDCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (918, '3502017', 'Recoveries payable-LCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (919, '3502018', 'Recoveries payable-DGCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (920, '3502019', 'Recoveries payable-TWF', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (921, '3502020', 'Recoveries payable-MBF', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (922, '3502021', 'Recoveries payable-KNCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (923, '3502022', 'Recoveries payable-SCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (924, '3502023', 'Recoveries payable-KCCS', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (925, '3502024', 'Recoveries payable-Other Employee Deductions', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (926, '3502025', 'Recoveries payable-TDS from Contractors', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (927, '3502051', 'Recoveries payable-Turnover Tax', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (928, '3502052', 'Recoveries payable-APGST', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (929, '3502053', 'Recoveries payable-CST', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (930, '3502054', 'Recoveries payable-Service Tax', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (931, '3502055', 'Recoveries payable-NAC', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (932, '3502056', 'Recoveries payable-Seignorage Charges', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (933, '3502057', 'Recoveries payable-TDS Payable Interest', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (934, '3502058', 'Recoveries payable-Other Recoveries From Contractors', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (935, '3502061', 'Recoveries payable-Court Attachments', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (936, '3502062', 'Recoveries payable-PH Employees Coop Society', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (937, '3502063', 'Recoveries payable-DCC Bank', NULL, NULL, true, 155, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (938, '3503001', 'Government Dues payable-Library Cess', NULL, NULL, true, 156, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (939, '3503002', 'Government Dues payable-Education Cess', NULL, NULL, true, 156, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (940, '3503003', 'Government Dues payable-Court Attachment', NULL, NULL, true, 156, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (941, '3504001', 'Refunds payable-Taxes', NULL, NULL, true, 157, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (942, '3504002', 'Refunds payable-Family Benefit Fund Settlements', NULL, NULL, true, 157, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (943, '3504003', 'Refunds payable-Group Insurance Settlements', NULL, NULL, true, 157, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (944, '3504004', 'Refunds payable-Unutilized Grants', NULL, NULL, true, 157, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (945, '3504005', 'Refunds payable-Deposit Works', NULL, NULL, true, 157, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (946, '3504006', 'Refunds payable-Development Charges to UDA', NULL, NULL, true, 157, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (947, '3504007', 'Refunds payable-Others', NULL, NULL, true, 157, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (948, '3504101', 'Advance Collection of Revenues-Property Tax', NULL, NULL, true, 158, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (949, '3504102', 'Advance Collection of Revenues-Advertisement Tax', NULL, NULL, true, 158, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (950, '3504103', 'Advance Collection of Revenues-Trade License', NULL, NULL, true, 158, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (951, '3504104', 'Advance Collection of Revenues-Rent', NULL, NULL, true, 158, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (952, '3508001', 'Others-Stale Cheque', NULL, NULL, true, 159, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (953, '3508002', 'Others-Compensation Payable', NULL, NULL, true, 159, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (954, '3508003', 'Others-Lease Charges payable', NULL, NULL, true, 159, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (955, '3508004', 'Others-Advances under HP', NULL, NULL, true, 159, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (956, '3508005', 'Others-Election deposit from candidates', NULL, NULL, true, 159, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (957, '3509001', 'Sale Proceeds-Attached Properties', NULL, NULL, true, 160, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (958, '3509002', 'Sale Proceeds-Assets', NULL, NULL, true, 160, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (959, '3509003', 'Sale Proceeds-Stores', NULL, NULL, true, 160, 'L', 4, false, false, '350', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (960, '3601001', 'Provisions for Expenses-Establishment Expenses', NULL, NULL, true, 161, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (961, '3601002', 'Provisions for Expenses-Administrative Expenses', NULL, NULL, true, 161, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (962, '3601003', 'Provisions for Expenses-Operations & Maintenance', NULL, NULL, true, 161, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (963, '3602001', 'Provision for Interest-Interest Accrued and not due', NULL, NULL, true, 162, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (964, '3603001', 'Provision for Other Assets-Inventory', NULL, NULL, true, 163, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (965, '3603002', 'Provision for Other Assets-Investments', NULL, NULL, true, 163, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (966, '3604001', 'Provisions for Doubtful receivables-Property Tax', NULL, NULL, true, 164, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (967, '3604002', 'Provisions for Doubtful receivables-Advertisement Tax', NULL, NULL, true, 164, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (968, '3604003', 'Provisions for Doubtful receivables-Trade License', NULL, NULL, true, 164, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (969, '3604004', 'Provisions for Doubtful receivables-Rents', NULL, NULL, true, 164, 'L', 4, false, false, '360', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (970, '4101001', 'Land-Open Space', NULL, NULL, true, 165, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (971, '4101002', 'Land-Grounds', NULL, NULL, true, 165, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (972, '4101003', 'Land-Parks', NULL, NULL, true, 165, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (973, '4101004', 'Land-Gardens', NULL, NULL, true, 165, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (974, '4102001', 'Buildings-Office Buildings', NULL, NULL, true, 166, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (975, '4102002', 'Buildings-Commercial Complex', NULL, NULL, true, 166, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (976, '4102003', 'Buildings-Hospitals, Dispensaries & Health Posts', NULL, NULL, true, 166, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (977, '4102004', 'Buildings-Community Halls & Reading Rooms', NULL, NULL, true, 166, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (978, '4102005', 'Buildings-Gust Houses', NULL, NULL, true, 166, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (979, '4102006', 'Buildings-Staff Quarters', NULL, NULL, true, 166, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (980, '4102007', 'Buildings-Public Latrines & Urinals', NULL, NULL, true, 166, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (981, '4103001', 'Roads and Bridges-Concrete Road', NULL, NULL, true, 167, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (982, '4103002', 'Roads and Bridges-Black Topped Roads', NULL, NULL, true, 167, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (983, '4103003', 'Roads and Bridges-Link Roads, Parallel Roads & Slip Roads', NULL, NULL, true, 167, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (984, '4103004', 'Roads and Bridges-Footpaths & Table Drains', NULL, NULL, true, 167, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (985, '4103005', 'Roads and Bridges-Bridges & Culverts', NULL, NULL, true, 167, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (986, '4103006', 'Roads and Bridges-Fly-overs & Over Bridges', NULL, NULL, true, 167, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (987, '4103007', 'Roads and Bridges-Subways & Causeways', NULL, NULL, true, 167, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (988, '4103101', 'Sewerage and Drainage-Underground Drains', NULL, NULL, true, 168, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (989, '4103102', 'Sewerage and Drainage-Open Drains', NULL, NULL, true, 168, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (990, '4103201', 'Water works-Water works', NULL, NULL, true, 169, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (991, '4103202', 'Water works-Open/bore Wells', NULL, NULL, true, 169, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (992, '4103203', 'Water works-Reservoirs', NULL, NULL, true, 169, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (993, '4103301', 'Public Lighting-Modern Lighting On Main Roads', NULL, NULL, true, 170, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (994, '4103302', 'Public Lighting-Modern Lighting On Lanes, By- lanes', NULL, NULL, true, 170, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (995, '4104000', 'Plant and Machinery-Plant & Machinery', NULL, NULL, true, 171, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (996, '4105001', 'Vehicles-Ambulance', NULL, NULL, true, 172, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (997, '4105002', 'Vehicles-Buses', NULL, NULL, true, 172, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (998, '4105003', 'Vehicles-Cars & Jeeps', NULL, NULL, true, 172, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (999, '4105004', 'Vehicles-Cranes', NULL, NULL, true, 172, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1000, '4105005', 'Vehicles-Trucks', NULL, NULL, true, 172, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1001, '4105006', 'Vehicles-Tankers', NULL, NULL, true, 172, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1002, '4106001', 'Office and Other Equipments-Air Conditioners', NULL, NULL, true, 173, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1003, '4106002', 'Office and Other Equipments-Computers', NULL, NULL, true, 173, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1004, '4106003', 'Office and Other Equipments-Faxes', NULL, NULL, true, 173, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1005, '4106004', 'Office and Other Equipments-Photocopiers', NULL, NULL, true, 173, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1006, '4106005', 'Office and Other Equipments-Refrigerators', NULL, NULL, true, 173, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1007, '4106006', 'Office and Other Equipments-Network Equipment', NULL, NULL, true, 173, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1008, '4107001', 'Furniture, Fixtures, Fittings and Electrical Appliances-Cabinets & Partitions', NULL, NULL, true, 174, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1009, '4107002', 'Furniture, Fixtures, Fittings and Electrical Appliances-Cupboards', NULL, NULL, true, 174, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1010, '4107003', 'Furniture, Fixtures, Fittings and Electrical Appliances-Fans', NULL, NULL, true, 174, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1011, '4107004', 'Furniture, Fixtures, Fittings and Electrical Appliances-Electrical Fittings', NULL, NULL, true, 174, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1012, '4107005', 'Furniture, Fixtures, Fittings and Electrical Appliances-Tables & Chairs', NULL, NULL, true, 174, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1013, '4108000', 'Other Fixed Assets-Other Fixed Assets', NULL, NULL, true, 175, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1014, '4109001', 'Assets under Disposal-Valuable Assets', NULL, NULL, true, 176, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1015, '4109002', 'Assets under Disposal-Scraped Assets', NULL, NULL, true, 176, 'A', 4, false, false, '410', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1016, '4112001', 'Buildings-Office Buildings', NULL, NULL, true, 177, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1017, '4112002', 'Buildings-Commercial Complex', NULL, NULL, true, 177, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1018, '4112003', 'Buildings-Hospitals, Dispensaries & Health Posts', NULL, NULL, true, 177, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1019, '4112004', 'Buildings-Community Halls & Reading Rooms', NULL, NULL, true, 177, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1020, '4112005', 'Buildings-Gust Houses', NULL, NULL, true, 177, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1021, '4112006', 'Buildings-Staff Quarters', NULL, NULL, true, 177, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1022, '4112007', 'Buildings-Public Latrines & Urinals', NULL, NULL, true, 177, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1023, '4113001', 'Roads and Bridges-Concrete Road', NULL, NULL, true, 178, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1024, '4113002', 'Roads and Bridges-Black Topped Roads', NULL, NULL, true, 178, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1025, '4113003', 'Roads and Bridges-Link Roads, Parallel Roads & Slip Roads', NULL, NULL, true, 178, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1026, '4113004', 'Roads and Bridges-Footpaths & Table Drains', NULL, NULL, true, 178, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1027, '4113005', 'Roads and Bridges-Bridges & Culverts', NULL, NULL, true, 178, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1028, '4113006', 'Roads and Bridges-Fly-overs & Over Bridges', NULL, NULL, true, 178, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1029, '4113007', 'Roads and Bridges-Subways & Causeways', NULL, NULL, true, 178, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1030, '4113101', 'Sewerage and Drainage-Underground Drains', NULL, NULL, true, 179, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1031, '4113102', 'Sewerage and Drainage-Open Drains', NULL, NULL, true, 179, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1032, '4113201', 'Waterways-Bore wells', NULL, NULL, true, 180, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1033, '4113202', 'Waterways-Open Wells', NULL, NULL, true, 180, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1034, '4113203', 'Waterways-Reservoirs', NULL, NULL, true, 180, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1035, '4113301', 'Public Lighting-Modern Lighting On Main Roads', NULL, NULL, true, 181, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1036, '4113302', 'Public Lighting-Modern Lighting On Lanes, By- lanes', NULL, NULL, true, 181, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1037, '4114000', 'Plant and Machinery-Plant & Machinery', NULL, NULL, true, 182, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1038, '4115001', 'Vehicles-Ambulance', NULL, NULL, true, 183, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1039, '4115002', 'Vehicles-Buses', NULL, NULL, true, 183, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1040, '4115003', 'Vehicles-Cars & Jeeps', NULL, NULL, true, 183, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1041, '4115004', 'Vehicles-Cranes', NULL, NULL, true, 183, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1042, '4115005', 'Vehicles-Trucks', NULL, NULL, true, 183, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1043, '4115006', 'Vehicles-Tankers', NULL, NULL, true, 183, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1044, '4116001', 'Office and Other Equipments-Air Conditioners', NULL, NULL, true, 184, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1045, '4116002', 'Office and Other Equipments-Computers', NULL, NULL, true, 184, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1046, '4116003', 'Office and Other Equipments-Faxes', NULL, NULL, true, 184, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1047, '4116004', 'Office and Other Equipments-Photocopiers', NULL, NULL, true, 184, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1048, '4116005', 'Office and Other Equipments-Refrigerators', NULL, NULL, true, 184, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1049, '4116006', 'Office and Other Equipments-Network Equipment', NULL, NULL, true, 184, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1050, '4117001', 'Furniture, Fixtures, Fittings and Electrical Appliances-Cabinets & Partitions', NULL, NULL, true, 185, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1051, '4117002', 'Furniture, Fixtures, Fittings and Electrical Appliances-Cupboards', NULL, NULL, true, 185, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1052, '4117003', 'Furniture, Fixtures, Fittings and Electrical Appliances-Fans', NULL, NULL, true, 185, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1053, '4117004', 'Furniture, Fixtures, Fittings and Electrical Appliances-Electrical Fittings', NULL, NULL, true, 185, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1054, '4117005', 'Furniture, Fixtures, Fittings and Electrical Appliances-Tables & Chairs', NULL, NULL, true, 185, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1055, '4118000', 'Other Fixed Assets-Other Fixed Assets', NULL, NULL, true, 186, 'A', 4, false, false, '411', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1056, '4120011', 'General-Land Acquisition', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1057, '4120012', 'General-Garbage Dumping Yards', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1058, '4120013', 'General-Parking Lots', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1059, '4120014', 'General-Major Parks', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1060, '4120015', 'General-Colony Parks', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1061, '4120016', 'General-Traffic Islands/Central Media', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1062, '4120017', 'General-Raising of Nurseries', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1063, '4120018', 'General-Playgrounds/Stadia', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1064, '4120019', 'General-Purchase of Plants/ Translocation of Plants', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1065, '4120021', 'General-Office Buildings', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1066, '4120022', 'General-Markets, Shopping Complexes & Other Remunerative Enterprises', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1067, '4120023', 'General-Community Halls & Reading Rooms', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1068, '4120024', 'General-School Buildings', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1069, '4120025', 'General-Hospitals, Dispensaries, Health Posts', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1070, '4120026', 'General-Public Latrines & Urinals', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1071, '4120027', 'General-Burial Grounds/Crematoria', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1072, '4120031', 'General-Bridges & Culverts', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1073, '4120032', 'General-Fly-Overs', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1074, '4120033', 'General-Rail Over/Under-Bridges', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1075, '4120034', 'General-Subways & Causeways, Foot over Bridges', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1076, '4120041', 'General-Road Development/Upgradation', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1077, '4120042', 'General-Link, Parallel and Slip Road', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1078, '4120043', 'General-Road Widening', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1079, '4120044', 'General-Footpaths and Table Drains', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1080, '4120045', 'General-Junction Improvements', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1081, '4120046', 'General-Station Area Development', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1082, '4120047', 'General-Traffic Signals & Signage', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1083, '4120048', 'General-Local Rail Transit Infrastructure', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1084, '4120051', 'General-Major Strom Water Drains', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1085, '4120052', 'General-Minor Strom Water Drains', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1086, '4120053', 'General-Rainwater Harvesting', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1087, '4120054', 'General-Sewerage Lines', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1088, '4120055', 'General-Sewerage Treatment Plants', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1089, '4120056', 'General-Conservation of Rivers/Lakes', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1090, '4120057', 'General-Construction of Dhobighats', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1091, '4120061', 'General-Modern Lighting on Major Roads', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1092, '4120062', 'General-Modern Lighting in Lanes and Bye- lanes', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1093, '4120071', 'General-Heavy Vehicles', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1094, '4120072', 'General-Light Vehicles', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1095, '4120073', 'General-Other Vehicles', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1096, '4120081', 'General-Office Equipment', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1097, '4120082', 'General-Computers, Servers & Net Work Equipment', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1098, '4120083', 'General-Urban Mapping – GIS', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1099, '4120084', 'General-Hospital Equipment', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1100, '4120085', 'General-Play and Sports Equipment', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1101, '4120086', 'General-Water Fountains', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1102, '4120087', 'General-Dumber Bins/Garbage Dust and Litter Bins', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1103, '4120088', 'General-Machinery and Equipment', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1104, '4120091', 'General-Furniture', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1105, '4120092', 'General-Fixtures and Fittings', NULL, NULL, true, 187, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1106, '4121000', 'Specific Grants-Specific Grants', NULL, NULL, true, 188, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1107, '4122000', 'Special funds-Special funds', NULL, NULL, true, 189, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1108, '4123000', 'Specific Schemes-Specific Schemes', NULL, NULL, true, 190, 'A', 4, false, false, '412', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1109, '4201000', 'Central Government Securities-Central Government Securities', NULL, NULL, true, 191, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1110, '4202000', 'State Government Securities-State Government Securities', NULL, NULL, true, 192, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1111, '4203000', 'Debentures and Bonds-Debentures and Bonds', NULL, NULL, true, 193, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1112, '4204000', 'Preference Shares-Preference Shares', NULL, NULL, true, 194, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1113, '4205000', 'Equity Shares-Equity Shares', NULL, NULL, true, 195, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1114, '4206001', 'Units of Mutual Funds-Open Ended Debt Fund', NULL, NULL, true, 196, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1115, '4206002', 'Units of Mutual Funds-Open Ended Equity Fund', NULL, NULL, true, 196, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1116, '4208001', 'Other Investments-Fixed Deposits', NULL, NULL, true, 197, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1117, '4209001', 'Accumulated Provision-Decline in Investment Value', NULL, NULL, true, 198, 'A', 4, false, false, '420', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1118, '4211000', 'Central Government Securities-Central Government Securities', NULL, NULL, true, 199, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1119, '4212000', 'State Government Securities-State Government Securities', NULL, NULL, true, 200, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1120, '4213000', 'Debentures and Bonds-Debentures and Bonds', NULL, NULL, true, 201, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1121, '4214000', 'Preference Shares-Preference Shares', NULL, NULL, true, 202, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1122, '4215000', 'Equity Shares-Equity Shares', NULL, NULL, true, 203, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1123, '4216001', 'Units of Mutual Funds-Open Ended Debt Fund', NULL, NULL, true, 204, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1124, '4216002', 'Units of Mutual Funds-Open Ended Equity Fund', NULL, NULL, true, 204, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1125, '4218001', 'Other Investments-Fixed Deposits with Banks', NULL, NULL, true, 205, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1126, '4219001', 'Accumulated Provision-Decline in Investment Value', NULL, NULL, true, 206, 'A', 4, false, false, '421', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1127, '4301001', 'Stores-Engineering Stores', NULL, NULL, true, 208, 'A', 4, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1128, '4301002', 'Stores-Transport Stores', NULL, NULL, true, 208, 'A', 4, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1129, '4301003', 'Stores-Medical Stores', NULL, NULL, true, 208, 'A', 4, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1130, '4301004', 'Stores-Central Stationary Stores', NULL, NULL, true, 208, 'A', 4, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1131, '4302000', 'Loose Tools-Loose Tools', NULL, NULL, true, 209, 'A', 4, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1132, '4308000', 'Others-Others', NULL, NULL, true, 210, 'A', 4, false, false, '430', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1133, '4311001', 'Receivables for Property Taxes-Private Properties', NULL, NULL, true, 211, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1134, '4311002', 'Receivables for Property Taxes-Government Properties', NULL, NULL, true, 211, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1135, '4311003', 'Receivables for Property Taxes-Vacant Lands', NULL, NULL, true, 211, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1136, '4311901', 'Receivable for Other Taxes-Private Properties', NULL, NULL, true, 212, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1137, '4311902', 'Receivable for Other Taxes-Government Properties', NULL, NULL, true, 212, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1138, '4312000', 'Receivables for Cess-Receivables for Cess', NULL, NULL, true, 213, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1139, '4313001', 'Receivable for Fees and User Charges-Water Supply', NULL, NULL, true, 214, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1140, '4313002', 'Receivable for Fees and User Charges-Trade Licence', NULL, NULL, true, 214, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1141, '4314001', 'Receivable from other sources-Rent', NULL, NULL, true, 215, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1142, '4314002', 'Receivable from other sources-Interest Accrued & Due', NULL, NULL, true, 215, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1143, '4314003', 'Receivable from other sources-Interest Accrued but not due', NULL, NULL, true, 215, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1144, '4314004', 'Receivable from other sources-Interest Receivable On Employee Loans', NULL, NULL, true, 215, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1145, '4314005', 'Receivable from other sources-Other Rent', NULL, NULL, true, 215, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1146, '4315001', 'Receivable from Government-State Government', NULL, NULL, true, 216, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1147, '4315002', 'Receivable from Government-Central Government', NULL, NULL, true, 216, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1148, '4315003', 'Receivable from Government-Government Departments', NULL, NULL, true, 216, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1149, '4315004', 'Receivable from Government-Public Sector Undertakings', NULL, NULL, true, 216, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1150, '4318001', 'Receivables control accounts-Property Taxes', NULL, NULL, true, 217, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1151, '4319100', 'State Govt Cess/ levies in Property Taxes - Control account-State Govt Cess/ levies in Property Taxes - Control account', NULL, NULL, true, 218, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1152, '4319200', 'State Govt Cess/ levies in Water Taxes - Control account-State Govt Cess/ levies in Water Taxes - Control account', NULL, NULL, true, 219, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1153, '4319900', 'State Govt Cess/ levies in Other Taxes - Control account-State Govt Cess/ levies in Other Taxes - Control account', NULL, NULL, true, 220, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1154, '4321000', 'Provision for outstanding Property Taxes-Provision for outstanding Property Taxes', NULL, NULL, true, 221, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1155, '4321100', 'Provision for outstanding Water Taxes-Provision for outstanding Water Taxes', NULL, NULL, true, 222, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1156, '4321200', 'Provision for outstanding Other Taxes-Provision for outstanding Other Taxes', NULL, NULL, true, 223, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1157, '4322000', 'Provision for outstanding Cess-Provision for outstanding Cess', NULL, NULL, true, 224, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1158, '4323000', 'Provision for outstanding Fees and User Charges-Provision for outstanding Fees & User Charges', NULL, NULL, true, 225, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1159, '4324000', 'Provision for outstanding other receivable-Provision for outstanding other receivable', NULL, NULL, true, 226, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1160, '4329100', 'State Govt Cess/ levies in Property Taxes - Provision account-State Govt Cess/ levies in Property Taxes - Provision account', NULL, NULL, true, 229, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1161, '4329200', 'State Govt Cess/ levies in Water Taxes - Provision account-State Govt Cess/ levies in Water Taxes - Provision account', NULL, NULL, true, 230, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1162, '4329900', 'State Govt Cess/ levies in Other Taxes - Provision account-State Govt Cess/ levies in Other Taxes - Provision account', NULL, NULL, true, 231, 'A', 4, false, false, '432', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1163, '4401000', 'Establishment-Establishment', NULL, NULL, true, 232, 'A', 4, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1164, '4402001', 'Administration-Rent, Rates Taxes', NULL, NULL, true, 233, 'A', 4, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1165, '4402002', 'Administration-Insurance', NULL, NULL, true, 233, 'A', 4, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1166, '4403001', 'Operations and Maintenance-Annual Maintenance Contracts', NULL, NULL, true, 234, 'A', 4, false, false, '440', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1167, '4501001', 'Cash-Cash On Hand', 4, NULL, true, 235, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1168, '4501002', 'Cash-Cash In Transit', 121, NULL, true, 235, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1169, '4501051', 'Cash-Cheques-in-hand', 5, NULL, true, 235, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1170, '4501091', 'Cash-Inter Bank Account Fund Transfer', NULL, NULL, true, 235, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1171, '4502101', 'Nationalised Banks-State Bank of India', NULL, NULL, true, 237, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1172, '4502102', 'Nationalised Banks-State Bank of Hyderabad', NULL, NULL, true, 237, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1173, '4502103', 'Nationalised Banks-Andhra Bank', NULL, NULL, true, 237, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1174, '4502104', 'Nationalised Banks-Canara Bank', NULL, NULL, true, 237, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1175, '4502201', 'Other Scheduled Banks-ICICI Bank', NULL, NULL, true, 238, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1176, '4502202', 'Other Scheduled Banks-IDBI Bank', NULL, NULL, true, 238, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1177, '4502203', 'Other Scheduled Banks-HDFC Bank', NULL, NULL, true, 238, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1178, '4502300', 'Scheduled Co-operative Banks-Scheduled Co-operative Banks', NULL, NULL, true, 239, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1179, '4502400', 'Post Office-Post Office', NULL, NULL, true, 240, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1180, '4504101', 'Nationalised Banks-State Bank Of India', NULL, NULL, true, 241, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1181, '4504102', 'Nationalised Banks-State Bank Of Hyderabad', NULL, NULL, true, 241, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1182, '4504103', 'Nationalised Banks-Andhra Bank', NULL, NULL, true, 241, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1183, '4504104', 'Nationalised Banks-Canara Bank', NULL, NULL, true, 241, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1184, '4504201', 'Other Scheduled Banks-ICICI Bank', NULL, NULL, true, 242, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1185, '4504202', 'Other Scheduled Banks-IDBI Bank', NULL, NULL, true, 242, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1186, '4504203', 'Other Scheduled Banks-HDFC Bank', NULL, NULL, true, 242, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1187, '4504300', 'Scheduled Co-operative Banks-Scheduled Co-operative Banks', NULL, NULL, true, 243, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1188, '4504400', 'Post Office-Post Office', NULL, NULL, true, 244, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1189, '4506101', 'Nationalised Banks-State Bank Of India', NULL, NULL, true, 245, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1190, '4506102', 'Nationalised Banks-State Bank Of Hyderabad', NULL, NULL, true, 245, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1191, '4506200', 'Other Scheduled Banks-Other Scheduled Banks', NULL, NULL, true, 246, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1192, '4506300', 'Scheduled Co-operative Banks-Scheduled Co-operative Banks', NULL, NULL, true, 247, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1193, '4506400', 'Post Office-Post Office', NULL, NULL, true, 248, 'A', 4, false, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1194, '4601001', 'Loans and advances to employees-House Building Advance', NULL, NULL, true, 249, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1195, '4601002', 'Loans and advances to employees-Conveyance Advance', NULL, NULL, true, 249, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1196, '4601003', 'Loans and advances to employees-Computer Advance', NULL, NULL, true, 249, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1197, '4601004', 'Loans and advances to employees-Festival Advance', NULL, NULL, true, 249, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1198, '4601005', 'Loans and advances to employees-Education Advance', NULL, NULL, true, 249, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1199, '4601006', 'Loans and advances to employees-Miscellaneous Advance', NULL, NULL, true, 249, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1200, '4602000', 'Employee Provident Fund Loans-Employee Provident Fund Loans', NULL, NULL, true, 250, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1201, '4603000', 'Loans to Others-Loans to Others', NULL, NULL, true, 251, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1202, '4604001', 'Advance to Suppliers and contractors-Suppliers', NULL, NULL, true, 252, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1203, '4604002', 'Advance to Suppliers and contractors-Contractors', NULL, NULL, true, 252, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1204, '4604003', 'Advance to Suppliers and contractors-Expenses', NULL, NULL, true, 252, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1205, '4604004', 'Advance to Suppliers and contractors-Materials Issued to Contractors', NULL, NULL, true, 252, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1206, '4605001', 'Advance to others-Employees for works', NULL, NULL, true, 253, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1207, '4605002', 'Advance to others-Travel Advance', NULL, NULL, true, 253, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1208, '4605003', 'Advance to others-Imprest', NULL, NULL, true, 253, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1209, '4605004', 'Advance to others-Executing agency for projects', NULL, NULL, true, 253, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1210, '4606001', 'Deposits with external Agencies-Telephone', NULL, NULL, true, 254, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1211, '4606002', 'Deposits with external Agencies-Electricity', NULL, NULL, true, 254, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1212, '4606003', 'Deposits with external Agencies-Petrol Pumps', NULL, NULL, true, 254, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1213, '4608001', 'Other Current Assets-HP Installments receivable', NULL, NULL, true, 255, 'A', 4, false, false, '460', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1214, '4611000', 'Loans to Others-Loans to Others', NULL, NULL, true, 256, 'A', 4, false, false, '461', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1215, '4612000', 'Advances-Advances', NULL, NULL, true, 257, 'A', 4, false, false, '461', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1216, '4613000', 'Deposits-Deposits', NULL, NULL, true, 258, 'A', 4, false, false, '461', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1217, '4701001', 'Deposit Works – Expenditure-Civil Works', NULL, NULL, true, 259, 'A', 4, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1218, '4701002', 'Deposit Works – Expenditure-Electric Works', NULL, NULL, true, 259, 'A', 4, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1219, '4701003', 'Deposit Works – Expenditure-Other Works', NULL, NULL, true, 259, 'A', 4, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1220, '4702000', 'Inter Unit Accounts-Inter Unit Accounts', NULL, NULL, true, 260, 'A', 4, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1221, '4702051', 'Inter Unit Accounts-Inter Fund Transfer', NULL, NULL, true, 260, 'A', 4, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1222, '4703000', 'Interest Control Payable-Interest Control Payable', NULL, NULL, true, 261, 'A', 4, false, false, '470', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1223, '4801001', 'Loan Issue Expenses-Deferred Revenue Expenses', NULL, NULL, true, 262, 'A', 4, false, false, '480', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1224, '4802000', 'Discount on Issue of loans-Discount on Issue of loans', NULL, NULL, true, 263, 'A', 4, false, false, '480', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1225, '4803000', 'Others-Others', NULL, NULL, true, 264, 'A', 4, false, false, '480', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1226, '4311004', 'Receivables for Property Taxes- Arrears', NULL, NULL, true, 211, 'A', 4, false, false, '431', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1227, '4504204', 'Allahabad UP Gramin Bank-Main branch-000000000001', NULL, 'Allahabad UP Gramin Bank-Main branch-000000000001', true, 242, 'A', 4, true, false, '450', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_chartofaccount (id, glcode, name, purposeid, description, isactiveforposting, parentid, type, classification, functionrequired, budgetcheckrequired, majorcode, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (1232, '3109000', 'Excess of Income over Expenditure', 7, NULL, true, 111, 'L', 4, false, false, '310', 1, '2017-05-08', NULL, 1, 0, 'default'); - -SELECT setval('seq_egf_chartofaccount',(select max(id)+1 from egf_chartofaccount)); diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150203__bank_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150203__bank_data.sql deleted file mode 100644 index 0a114d15e60..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150203__bank_data.sql +++ /dev/null @@ -1,85 +0,0 @@ - -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (1, '1', 'Allahabad UP Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (2, '2', 'Andhra Pradesh Grameena Vikas Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (3, '3', 'Andhra Pragathi Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (4, '4', 'Arunachal Pradesh Rural Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (5, '5', 'Aryavart Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (6, '6', 'Assam Gramin Vikash Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (7, '7', 'Baitarani Gramya Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (8, '8', 'Ballia –Etawah Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (9, '9', 'Bangiya Gramin Vikash Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (10, '10', 'Baroda Gujarat Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (11, '11', 'Baroda Rajasthan Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (12, '12', 'Baroda Uttar Pradesh Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (13, '13', 'Bihar Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (14, '14', 'Cauvery Kalpatharu Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (15, '15', 'Chaitanya Godavari Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (16, '16', 'Chhattisgarh Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (17, '17', 'Chikmagalur-Kodagu Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (18, '18', 'Deccan Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (19, '19', 'Dena Gujarat Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (20, '20', 'Durg-Rajnandgaon Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (21, '21', 'Ellaquai Dehati Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (22, '22', 'Gurgaon Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (23, '23', 'Hadoti Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (24, '24', 'Haryana Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (25, '25', 'Himachal Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (26, '26', 'Jaipur Thar Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (27, '27', 'Jhabua Dhar Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (28, '28', 'Jharkhand Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (29, '29', 'Kalinga Gramya Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (30, '30', 'Karnataka Vikas Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (31, '31', 'Kashi Gomti Samyut Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (32, '32', 'Kerala Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (33, '33', 'Krishna Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (34, '34', 'Kshetriya Kisan Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (35, '35', 'Langpi Dehangi Rural Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (36, '36', 'Madhumalti Building Gupte Marg', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (37, '37', 'Madhya Bharat Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (38, '38', 'Madhya Bihar Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (39, '39', 'Mahakaushal Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (40, '40', 'Maharashtra Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (41, '41', 'Malwa Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (42, '42', 'Manipur Rural Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (43, '43', 'Marwar Ganganagar Bikaner Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (44, '44', 'Meghalaya Rural Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (45, '45', 'Mewar Anchalik Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (46, '46', 'Mizoram Rural Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (47, '47', 'Nagaland Rural Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (48, '48', 'Uttrakhand Gramin Bank[1]', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (49, '49', 'Narmada Malwa Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (50, '50', 'Neelachal Gramya Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (51, '51', 'Pallavan Grama Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (52, '52', 'Pandyan Grama Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (53, '53', 'Parvatiya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (54, '54', 'Paschim Banga Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (55, '55', 'Pragathi Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (56, '56', 'Prathama Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (57, '57', 'Puduvai Bharathiar Grama Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (58, '58', 'Pune District Central Cooperative Bank Ltd.', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (59, '59', 'Punjab Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (60, '60', 'Purvanchal Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (61, '61', 'Rajasthan Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (62, '62', 'Rewa-Sidhi Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (63, '63', 'Rushikulya Gramya Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (64, '64', 'Samastipur Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (65, '65', 'Saptagiri Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (66, '66', 'Sarva UP Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (67, '67', 'Satpura Narmada Kshetriya', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (68, '68', 'Saurashtra Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (69, '69', 'Sharda Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (70, '70', 'Shreyas Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (71, '71', 'Surguja Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (72, '72', 'Sutlej Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (73, '73', 'Tripura Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (74, '74', 'Utkal Gramya Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (75, '75', 'Uttar Banga Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (76, '76', 'Uttar Bihar Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (77, '77', 'Vananchal Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (78, '78', 'Vidharbha Kshetriya Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (79, '79', 'Visveshvaraya Grameena Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_bank (id, code, name, description, active, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (80, '80', 'Wainganga Krishna Gramin Bank', NULL, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); - - - -SELECT setval('seq_egf_bank',(select max(id)+1 from egf_bank)); diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150217__bankbranch_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150217__bankbranch_data.sql deleted file mode 100644 index 15a57e4f972..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150217__bankbranch_data.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO egf_bankbranch (id, bankid, code, name, address, address2, city, state, pincode, phone, fax, contactperson, active, description, micr, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (1, 1, '001', 'Main branch', 'Srikakulam', NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, 0, 'default'); - -SELECT setval('seq_egf_bankbranch',(select max(id)+1 from egf_bankbranch)); diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150224__bankaccount_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150224__bankaccount_data.sql deleted file mode 100644 index b604b41c03d..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150224__bankaccount_data.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO egf_bankaccount (id, branchid, glcodeid, fundid, accountnumber, accounttype, description, active, payto, type, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (1, 1, 1223, 1, '000000000001', 'OTHER SCHEDULED BANKS', NULL, true, NULL, 'RECEIPTS_PAYMENTS', 1, '2017-05-08 00:00:00', 1, '2017-05-08 00:00:00', 0, 'default'); - - -SELECT setval('seq_egf_bankaccount',(select max(id)+1 from egf_bankaccount)); diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150230__accountdetail_type_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150230__accountdetail_type_data.sql deleted file mode 100644 index c0a55accba3..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150230__accountdetail_type_data.sql +++ /dev/null @@ -1,10 +0,0 @@ -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (1, 'Employee', 'Employee', 'eg_employee', true, 'org.egov.eis.entity.Employee', 1, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (2, 'Telephone', 'Telephone', 'accountEntityMaster', true, 'org.egov.masters.model.AccountEntity', 1, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (3, 'DrawingOfficer', 'Drawing Officer', 'EG_DRAWINGOFFICER', true, 'org.egov.eis.entity.DrawingOfficer', 1, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (4, 'contractor', 'contractor', 'egw_contractor', true, 'org.egov.works.models.masters.Contractor', 1, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (5, 'PROJECTCODE', 'PROJECTCODE', 'egw_projectcode', true, 'org.egov.works.models.estimate.ProjectCode', 1, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (11, 'Supplier', 'Supplier', 'Supplier', true, 'org.egov.commons.Relation', 1, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (12, 'DEPOSITCODE', 'DEPOSITCODE', 'egw_depositcode', true, 'org.egov.works.models.masters.DepositCode', 1, '2017-05-08', NULL, NULL, NULL, 'default'); -INSERT INTO egf_accountdetailtype (id, name, description, tablename, active, fully_qualified_name, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (13, 'lawyer', 'Standing Counsel', 'eglc_advocate_master', true, 'org.egov.lcms.masters.entity.AdvocateMaster', 1, '2017-05-08', NULL, '2017-05-08', 0, 'default'); - -SELECT setval('seq_egf_accountdetailtype',(select max(id)+1 from egf_accountdetailtype)); diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150234__fund_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150234__fund_data.sql deleted file mode 100644 index ef825ade82d..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150234__fund_data.sql +++ /dev/null @@ -1,7 +0,0 @@ -INSERT INTO egf_fund (id, name, code, identifier, level, parentid, isparent, active, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (1, 'Municipal Fund', '01', '1', 1, NULL, false, true, NULL, '2017-05-08', NULL, NULL, 0, 'default'); -INSERT INTO egf_fund (id, name, code, identifier, level, parentid, isparent, active, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (2, 'Capital Fund', '02', '2', 1, NULL, false, false, NULL, '2017-05-08', NULL, NULL, 0, 'default'); -INSERT INTO egf_fund (id, name, code, identifier, level, parentid, isparent, active, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (3, 'Elementary Education Fund', '03', '3', 1, NULL, false, false, NULL, '2017-05-08', NULL, NULL, 0, 'default'); -INSERT INTO egf_fund (id, name, code, identifier, level, parentid, isparent, active, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (4, 'Earmarked Funds', '04', '4', 1, NULL, false, false, NULL, '2017-05-08', NULL, NULL, 0, 'default'); - - -SELECT setval('seq_egf_fund',(select max(id)+1 from egf_fund)); diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150239__function_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150239__function_data.sql deleted file mode 100644 index 1ba576cf525..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170629150239__function_data.sql +++ /dev/null @@ -1,131 +0,0 @@ - -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (1, 'GENERAL ADMINISTRATION', '00', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (2, 'PUBLIC WORKS', '20', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (3, 'REVENUE', '90', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (4, 'PLANNING AND REGULATIONS', '10', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (5, 'CIVIC AMENITIES', '50', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (6, 'URBAN FORESTRY', '60', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (7, 'SANITATION AND SOLID WASTE MANAGEMENT', '40', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (8, 'HEALTH', '30', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (9, 'OTHER SERVICES', '80', 0, true, false, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (10, 'GENERAL ADMINISTRATION:Council (Municipal Body)', '0001', 0, true, false, 1, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (11, 'GENERAL ADMINISTRATION:Administration', '0002', 0, true, false, 1, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (12, 'GENERAL ADMINISTRATION:Accounts Central Cell (Finance, Accounts, Audit)', '0003', 0, true, false, 1, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (13, 'GENERAL ADMINISTRATION:Land & Estate (Estate)', '0006', 0, true, false, 1, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (14, 'GENERAL ADMINISTRATION:Stationery Stores (Stores & Purchase)', '0007', 0, true, false, 1, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (15, 'GENERAL ADMINISTRATION:CHIEF ENGINEERS Office', '0009', 0, true, false, 1, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (16, 'PLANNING AND REGULATIONS:Land Development and Planning Permits (City and Town Planning)', '1011', 0, true, false, 4, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (17, 'PLANNING AND REGULATIONS:Building Permits (Building Regulation)', '1012', 0, true, false, 4, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (18, 'PLANNING AND REGULATIONS:Enforcement Cell (Encroachment Removal)', '1014', 0, true, false, 4, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (19, 'PUBLIC WORKS:Roads and Pavement', '2021', 0, true, false, 2, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (20, 'PUBLIC WORKS:Bridges and Flyovers', '2022', 0, true, false, 2, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (21, 'PUBLIC WORKS:Street Lighting', '2024', 0, true, false, 2, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (22, 'PUBLIC WORKS:Storm Water Drains', '2025', 0, true, false, 2, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (23, 'PUBLIC WORKS:Buildings', '2028', 0, true, false, 2, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (24, 'HEALTH:Public Health', '3031', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (25, 'HEALTH:Epidemic / Prevention Control', '3032', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (26, 'HEALTH:Family Welfare (Family Planning)', '3033', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (27, 'HEALTH:Primary Health Care', '3034', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (28, 'HEALTH:Hospital Services', '3035', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (29, 'HEALTH:Burial and Burning Grounds (Burial and Cremations)', '3036', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (30, 'HEALTH:Birth and Death Registration (Vital Statistics)', '3037', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (31, 'HEALTH:Prevention of Food Adulteration', '3038', 0, true, false, 8, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (32, 'SANITATION AND SOLID WASTE MANAGEMENT:Solid Waste Management', '4041', 0, true, false, 7, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (33, 'SANITATION AND SOLID WASTE MANAGEMENT:Public Convenience', '4042', 0, true, false, 7, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (34, 'SANITATION AND SOLID WASTE MANAGEMENT:Veterinary Services', '4043', 0, true, false, 7, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (35, 'SANITATION AND SOLID WASTE MANAGEMENT:Slaughter Houses', '4045', 0, true, false, 7, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (36, 'SANITATION AND SOLID WASTE MANAGEMENT:Lethal Chamber', '4046', 0, true, false, 7, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (37, 'CIVIC AMENITIES:Community / Marriage Centres', '5055', 0, true, false, 5, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (38, 'CIVIC AMENITIES:Municipal Markets', '5058', 0, true, false, 5, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (39, 'CIVIC AMENITIES:Dhobikhana', '5059', 0, true, false, 5, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (40, 'URBAN FORESTRY:Parks, Gardens', '6061', 0, true, false, 6, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (41, 'URBAN FORESTRY:Play Grounds', '6062', 0, true, false, 6, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (42, 'URBAN FORESTRY:Stadium', '6067', 0, true, false, 6, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (43, 'URBAN FORESTRY:Swimming Pool', '6068', 0, true, false, 6, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (44, 'OTHER SERVICES:Education', '8082', 0, true, false, 9, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (45, 'OTHER SERVICES:Relief Centres', '8085', 0, true, false, 9, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (46, 'REVENUE:Revenue (Property Taxes)', '9091', 0, true, false, 3, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (47, 'Public Relation Office', '000202', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (48, 'Legal Cell', '000204', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (49, 'Accounts Central Cell (Finance, Accounts, Audit)', '000300', 1, false, true, 12, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (50, 'Land Development and Planning Permits (City and Town Planning)', '101100', 1, false, true, 16, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (51, 'Building Permits (Building Regulation)', '101200', 1, false, true, 17, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (52, 'Direction (Works Dept)', '202101', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (53, 'Capital Works-Elec', '202402', 1, false, true, 21, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (54, 'Communicable Diseases Hospital', '303201', 1, false, true, 25, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (55, 'Vaccination', '303206', 1, false, true, 25, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (56, 'Meternity Child Welfare', '303401', 1, false, true, 27, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (57, 'Prevention of Food Adulteration', '303800', 1, false, true, 31, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (58, 'Stadium', '606700', 1, false, true, 42, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (59, 'EDP Cell', '000205', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (60, 'Land & Estate (Estate)', '000600', 1, false, true, 13, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (61, 'Central Roller Station', '202104', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (62, 'Direction (Zones)', '202106', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (63, 'Anti Mosquito Operation', '303202', 1, false, true, 25, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (64, 'Urban Malaria Scheme', '303203', 1, false, true, 25, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (65, 'Burial and Burning Grounds (Burial and Cremations)', '303600', 1, false, true, 29, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (66, 'Parks and Gardens', '606100', 1, false, true, 40, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (67, 'Swimming Pool', '606800', 1, false, true, 43, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (68, 'Revenue (Property Taxes)', '909100', 1, false, false, 46, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (69, 'National Fileria Control programme', '303204', 1, false, true, 25, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (70, 'Solid Waste Management (Zones)', '404103', 1, false, true, 32, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (71, 'General Stores', '404106', 1, false, true, 32, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (72, 'Vehicle Maintenance', '404108', 1, false, true, 32, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (73, 'Community / Marriage Centres', '505500', 1, false, true, 37, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (74, 'Non-Plan Secondary School', '808201', 1, false, true, 44, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (75, 'Industrial Training Institute', '808202', 1, false, true, 44, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (76, 'Relief Centres', '808500', 1, false, true, 45, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (77, 'General Department', '000201', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (78, 'Taxation Appeals Committee', '000206', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (79, 'Traffic Engineering', '202105', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (80, 'Electrical Workshop', '202404', 1, false, true, 21, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (81, 'Electrical Stores', '202405', 1, false, true, 21, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (82, 'IPPV', '303402', 1, false, true, 27, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (83, 'T.B. Clinic', '303502', 1, false, true, 28, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (84, 'Slaughter Houses', '404500', 1, false, true, 35, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (85, 'Dhobikhana', '505900', 1, false, true, 39, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (86, 'Play Grounds', '606200', 1, false, true, 41, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (87, 'Primary School Age Group 6-11', '808206', 1, false, true, 44, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (88, 'Council (Municipal Body)', '000100', 1, false, true, 10, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (89, 'Vigilance', '000203', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (90, 'Printing Press', '000207', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (91, 'Enforcement Cell (Encroachment Removal)', '101400', 1, false, true, 18, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (92, 'Central Asphalt Plant', '202103', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (93, 'Sub-Station', '202403', 1, false, true, 21, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (94, 'Storm Water Drains', '202500', 1, false, true, 22, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (95, 'Direction (Heatlh Dept)', '303101', 1, false, true, 24, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (96, 'Medical Stores', '303205', 1, false, true, 25, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (97, 'Sanitation', '303207', 1, false, true, 25, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (99, 'Public Convenience', '404200', 1, false, true, 33, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (100, 'Health Programme (School)', '808204', 1, false, true, 44, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (101, 'CHIEF ENGINEERS Office', '000900', 1, false, false, 15, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (102, 'Capital Works-Works', '202102', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (103, 'Family Welfare (Family Planning)', '303300', 1, false, true, 26, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (104, 'Birth and Death Registration (Vital Statistics)', '303700', 1, false, true, 30, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (105, 'Direction (M.E. Department)', '404101', 1, false, true, 32, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (106, 'Lethal Chamber', '404600', 1, false, true, 36, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (107, 'Municipal Markets', '505800', 1, false, true, 38, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (108, 'Non-Plan Primary & Middle School', '808205', 1, false, true, 44, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (109, 'Primary School Age Group 11-14', '808207', 1, false, true, 44, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (110, 'Roads and Building Maintenance', '202107', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (111, 'Out Reach Services', '303403', 1, false, true, 27, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (112, 'Solid Waste Management Department', '404102', 1, false, true, 32, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (113, 'Veterinary Services(HQ)', '404302', 1, false, true, 34, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (114, 'Community College', '808203', 1, false, true, 44, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (115, 'Stationery Stores (Stores & Purchase)', '000700', 1, false, true, 14, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (116, 'Bus Route Roads', '202108', 1, false, true, 19, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (117, 'Bridges and Flyovers', '202200', 1, false, true, 20, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (118, 'Direction (Electircal Department)', '202401', 1, false, true, 21, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (119, 'Street Lighting Maintenance', '202406', 1, false, true, 21, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (120, 'Buildings', '202800', 1, false, true, 23, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (121, 'Dispensaries', '303501', 1, false, true, 28, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (123, 'General Workshop', '404107', 1, false, true, 32, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (124, 'Veterinary Services(Zones)', '404301', 1, false, true, 34, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (125, 'Revenue(H.Q)', '909101', 1, false, true, 46, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (126, 'Revenue(ZONES)', '909102', 1, false, true, 46, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (127, 'CHIEF ENGINEERS Office', '000208', 1, false, true, 11, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (129, 'Direction(Regional Office)', '101000', 0, false, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (130, 'CHIEF ENGINEERS OFFICE (S.W.D. AND BUILDINGS)', '000210', 0, false, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_function (id, name, code, level, isparent, active, parentid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) VALUES (131, 'CHIEF ENGINEERS OFFICE (SPECIAL PROJECTS)', '000209', 0, false, true, NULL, NULL, NULL, NULL, NULL, 0, 'default'); - -SELECT setval('seq_egf_function',(select max(id)+1 from egf_function)); diff --git a/business-services/egf-master/src/main/resources/db/migration/dev/V20170925112307__financialyear_data.sql b/business-services/egf-master/src/main/resources/db/migration/dev/V20170925112307__financialyear_data.sql deleted file mode 100644 index af77d16d9f2..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/dev/V20170925112307__financialyear_data.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2016-17','01-Apr-2016','31-Mar-2017',true,true,73,current_date,'default'); -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2015-16','01-Apr-2015','31-Mar-2016',true,true,73,current_date,'default'); -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2017-18','01-Apr-2017','31-Mar-2018',true,true,73,current_date,'default'); -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2018-19','01-Apr-2018','31-Mar-2019',true,false,73,current_date,'default'); diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185629__egf_Bank_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185629__egf_Bank_ddl.sql deleted file mode 100644 index 3c804356ecf..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185629__egf_Bank_ddl.sql +++ /dev/null @@ -1,16 +0,0 @@ - -Create table egf_bank( - id bigint, - code varchar(50) NOT NULL, - name varchar(100) NOT NULL, - description varchar(250), - active boolean NOT NULL, - type varchar(50) NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_bank add constraint pk_egf_bank primary key (id); -create sequence seq_egf_bank; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185630__egf_BankBranch_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185630__egf_BankBranch_ddl.sql deleted file mode 100644 index 7fac8fb7a83..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185630__egf_BankBranch_ddl.sql +++ /dev/null @@ -1,26 +0,0 @@ - -Create table egf_bankbranch( - id bigint, - bankid bigint NOT NULL, - code varchar(50) NOT NULL, - name varchar(50) NOT NULL, - address varchar(50) NOT NULL, - address2 varchar(50), - city varchar(50), - state varchar(50), - pincode varchar(50), - phone varchar(15), - fax varchar(15), - contactPerson varchar(50), - active boolean NOT NULL, - description varchar(256), - micr varchar(50), - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_bankbranch add constraint pk_egf_bankbranch primary key (id); -alter table egf_bankbranch add constraint fk_egf_bankbranch_bankid FOREIGN KEY (bankid) REFERENCES egf_bank(id); -create sequence seq_egf_bankbranch; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185633__egf_FinancialYear_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185633__egf_FinancialYear_ddl.sql deleted file mode 100644 index 7e55bb3eab2..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185633__egf_FinancialYear_ddl.sql +++ /dev/null @@ -1,18 +0,0 @@ - -Create table egf_financialyear( - id bigint, - FinancialYear varchar(25), - startingDate date NOT NULL, - endingDate date NOT NULL, - active boolean NOT NULL, - isActiveForPosting boolean NOT NULL, - isClosed boolean, - transferClosingBalance boolean, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_financialyear add constraint pk_egf_financialyear primary key (id); -create sequence seq_egf_financialyear; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185634__egf_FiscalPeriod_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185634__egf_FiscalPeriod_ddl.sql deleted file mode 100644 index aef1fe56711..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185634__egf_FiscalPeriod_ddl.sql +++ /dev/null @@ -1,19 +0,0 @@ - -Create table egf_fiscalperiod( - id bigint, - name varchar(25) NOT NULL, - FinancialYearid bigint NOT NULL, - startingDate date NOT NULL, - endingDate date NOT NULL, - active boolean NOT NULL, - isActiveForPosting boolean NOT NULL, - isClosed boolean, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_fiscalperiod add constraint pk_egf_fiscalperiod primary key (id); -alter table egf_fiscalperiod add constraint fk_egf_fiscalperiod_FinancialYearid FOREIGN KEY (FinancialYearid) REFERENCES egf_financialyear(id); -create sequence seq_egf_fiscalperiod; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185635__egf_Function_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185635__egf_Function_ddl.sql deleted file mode 100644 index 50fc6faa946..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185635__egf_Function_ddl.sql +++ /dev/null @@ -1,18 +0,0 @@ - -Create table egf_function( - id bigint, - name varchar(128) NOT NULL, - code varchar(16) NOT NULL, - level smallint NOT NULL, - active boolean NOT NULL, - isParent boolean NOT NULL, - parentId bigint , - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_function add constraint pk_egf_function primary key (id); -alter table egf_function add constraint fk_egf_function_parentId FOREIGN KEY (parentId) REFERENCES egf_function(id); -create sequence seq_egf_function; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185636__egf_Functionary_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185636__egf_Functionary_ddl.sql deleted file mode 100644 index 0453952e33d..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185636__egf_Functionary_ddl.sql +++ /dev/null @@ -1,14 +0,0 @@ - -Create table egf_functionary( - id bigint, - code varchar(16) NOT NULL, - name varchar(256) NOT NULL, - active boolean NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_functionary add constraint pk_egf_functionary primary key (id); -create sequence seq_egf_functionary; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185637__egf_Fund_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185637__egf_Fund_ddl.sql deleted file mode 100644 index 1b628401c26..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185637__egf_Fund_ddl.sql +++ /dev/null @@ -1,19 +0,0 @@ - -Create table egf_fund( - id bigint, - name varchar(50) NOT NULL, - code varchar(50) NOT NULL, - identifier varchar(1) NOT NULL, - level bigint NOT NULL, - parentid bigint , - isParent boolean, - active boolean NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_fund add constraint pk_egf_fund primary key (id); -alter table egf_fund add constraint fk_egf_fund_parentid FOREIGN KEY (parentid) REFERENCES egf_fund(id); -create sequence seq_egf_fund; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185638__egf_Fundsource_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185638__egf_Fundsource_ddl.sql deleted file mode 100644 index 640c81984f8..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185638__egf_Fundsource_ddl.sql +++ /dev/null @@ -1,19 +0,0 @@ - -Create table egf_fundsource( - id bigint, - code varchar(25) NOT NULL, - name varchar(25) NOT NULL, - type varchar(25), - parentid bigint , - llevel numeric (13,2), - active boolean NOT NULL, - isParent boolean, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_fundsource add constraint pk_egf_fundsource primary key (id); -alter table egf_fundsource add constraint fk_egf_fundsource_parentid FOREIGN KEY (parentid) REFERENCES egf_fundsource(id); -create sequence seq_egf_fundsource; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185639__egf_Scheme_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185639__egf_Scheme_ddl.sql deleted file mode 100644 index bba6ae7a42d..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185639__egf_Scheme_ddl.sql +++ /dev/null @@ -1,20 +0,0 @@ - -Create table egf_scheme( - id bigint, - fundId bigint , - code varchar(25), - name varchar(25), - validFrom date NOT NULL, - validTo date NOT NULL, - active boolean NOT NULL, - description varchar(256), - boundary bigint, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_scheme add constraint pk_egf_scheme primary key (id); -alter table egf_scheme add constraint fk_egf_scheme_fundId FOREIGN KEY (fundId) REFERENCES egf_fund(id); -create sequence seq_egf_scheme; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185640__egf_SubScheme_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185640__egf_SubScheme_ddl.sql deleted file mode 100644 index fcff0ac5b7f..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185640__egf_SubScheme_ddl.sql +++ /dev/null @@ -1,18 +0,0 @@ - -Create table egf_subscheme( - id bigint, - scheme bigint NOT NULL, - code varchar(50) NOT NULL, - name varchar(50) NOT NULL, - validFrom date NOT NULL, - validTo date NOT NULL, - active boolean NOT NULL, - departmentId bigint, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_subscheme add constraint pk_egf_subscheme primary key (id); -create sequence seq_egf_subscheme; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185641__egf_Supplier_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185641__egf_Supplier_ddl.sql deleted file mode 100644 index 9c46493b51e..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185641__egf_Supplier_ddl.sql +++ /dev/null @@ -1,25 +0,0 @@ - -Create table egf_supplier( - id bigint, - code varchar(50) NOT NULL, - name varchar(50) NOT NULL, - address varchar(300), - mobile varchar(10), - email varchar(25), - description varchar(250), - active boolean NOT NULL, - panNo varchar(10), - tinNo varchar(20), - registationNo varchar(25), - bankAccount varchar(25), - ifscCode varchar(12), - bank bigint , - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_supplier add constraint pk_egf_supplier primary key (id); -alter table egf_supplier add constraint fk_egf_supplier_bank FOREIGN KEY (bank) REFERENCES egf_bank(id); -create sequence seq_egf_supplier; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185642__egf_AccountDetailType_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185642__egf_AccountDetailType_ddl.sql deleted file mode 100644 index ee0c42504b9..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185642__egf_AccountDetailType_ddl.sql +++ /dev/null @@ -1,18 +0,0 @@ - -Create table egf_accountdetailtype( - id bigint, - name varchar(50) NOT NULL, - description varchar(50) NOT NULL, - tableName varchar(25), - columnName varchar(25), - attributeName varchar(50), - active boolean NOT NULL, - FULLY_QUALIFIED_NAME varchar(250), - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_accountdetailtype add constraint pk_egf_accountdetailtype primary key (id); -create sequence seq_egf_accountdetailtype; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185643__egf_AccountDetailKey_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185643__egf_AccountDetailKey_ddl.sql deleted file mode 100644 index 42367a6e1fa..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185643__egf_AccountDetailKey_ddl.sql +++ /dev/null @@ -1,16 +0,0 @@ - -Create table egf_accountdetailkey( - id bigint, - groupId smallint, - name varchar(128), - key smallint, - detailTypeId bigint NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_accountdetailkey add constraint pk_egf_accountdetailkey primary key (id); -alter table egf_accountdetailkey add constraint fk_egf_accountdetailkey_detailTypeId FOREIGN KEY (detailTypeId) REFERENCES egf_accountdetailtype(id); -create sequence seq_egf_accountdetailkey; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185644__egf_AccountEntity_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185644__egf_AccountEntity_ddl.sql deleted file mode 100644 index 7c2a560deac..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185644__egf_AccountEntity_ddl.sql +++ /dev/null @@ -1,17 +0,0 @@ - -Create table egf_accountentitymaster( - id bigint, - detailtypeid bigint NOT NULL, - code varchar(25) NOT NULL, - name varchar(350) NOT NULL, - active boolean NOT NULL, - description varchar(256), - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_accountentitymaster add constraint pk_egf_accountentitymaster primary key (id); -alter table egf_accountentitymaster add constraint fk_egf_accountentitymaster_detailtypeid FOREIGN KEY (detailtypeid) REFERENCES egf_accountdetailtype(id); -create sequence seq_egf_accountentitymaster; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185645__egf_AccountCodePurpose_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185645__egf_AccountCodePurpose_ddl.sql deleted file mode 100644 index f093c8a027a..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185645__egf_AccountCodePurpose_ddl.sql +++ /dev/null @@ -1,12 +0,0 @@ - -Create table egf_accountcodepurpose( - id bigint, - name varchar(256) NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_accountcodepurpose add constraint pk_egf_accountcodepurpose primary key (id); -create sequence seq_egf_accountcodepurpose; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185646__egf_ChartOfAccount_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185646__egf_ChartOfAccount_ddl.sql deleted file mode 100644 index c38b2c35377..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185646__egf_ChartOfAccount_ddl.sql +++ /dev/null @@ -1,24 +0,0 @@ - -Create table egf_chartofaccount( - id bigint, - glcode varchar(16) NOT NULL, - name varchar(128) NOT NULL, - purposeId bigint , - desciption varchar(256), - isActiveForPosting boolean NOT NULL, - parentId bigint, - type varchar(1) NOT NULL, - classification bigint NOT NULL, - functionRequired boolean NOT NULL, - budgetCheckRequired boolean NOT NULL, - majorCode varchar(16), - isSubLedger boolean, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_chartofaccount add constraint pk_egf_chartofaccount primary key (id); -alter table egf_chartofaccount add constraint fk_egf_chartofaccount_purposeId FOREIGN KEY (purposeId) REFERENCES egf_accountcodepurpose(id); -create sequence seq_egf_chartofaccount; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185647__egf_ChartOfAccountDetail_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185647__egf_ChartOfAccountDetail_ddl.sql deleted file mode 100644 index 823f0b41edb..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185647__egf_ChartOfAccountDetail_ddl.sql +++ /dev/null @@ -1,15 +0,0 @@ - -Create table egf_chartofaccountdetail( - id bigint, - glcodeid bigint NOT NULL, - detailtypeid bigint NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_chartofaccountdetail add constraint pk_egf_chartofaccountdetail primary key (id); -alter table egf_chartofaccountdetail add constraint fk_egf_chartofaccountdetail_glcodeid FOREIGN KEY (glcodeid) REFERENCES egf_chartofaccount(id); -alter table egf_chartofaccountdetail add constraint fk_egf_chartofaccountdetail_detailtypeid FOREIGN KEY (detailtypeid) REFERENCES egf_accountdetailtype(id); -create sequence seq_egf_chartofaccountdetail; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185648__egf_BudgetGroup_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185648__egf_BudgetGroup_ddl.sql deleted file mode 100644 index 9935570e971..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185648__egf_BudgetGroup_ddl.sql +++ /dev/null @@ -1,22 +0,0 @@ - -Create table EGF_BUDGETGROUP( - id bigint, - name varchar(250), - description varchar(250), - majorcode bigint , - hgfdsa bigint , - mincode bigint , - accountType varchar(19), - budgetingType varchar(6), - active boolean, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table EGF_BUDGETGROUP add constraint pk_EGF_BUDGETGROUP primary key (id); -alter table EGF_BUDGETGROUP add constraint fk_EGF_BUDGETGROUP_majorcode FOREIGN KEY (majorcode) REFERENCES egf_chartofaccount(id); -alter table EGF_BUDGETGROUP add constraint fk_EGF_BUDGETGROUP_hgfdsa FOREIGN KEY (hgfdsa) REFERENCES egf_chartofaccount(id); -alter table EGF_BUDGETGROUP add constraint fk_EGF_BUDGETGROUP_mincode FOREIGN KEY (mincode) REFERENCES egf_chartofaccount(id); -create sequence seq_EGF_BUDGETGROUP; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185649__egf_BankAccount_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170227185649__egf_BankAccount_ddl.sql deleted file mode 100644 index db23c42ebd3..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170227185649__egf_BankAccount_ddl.sql +++ /dev/null @@ -1,23 +0,0 @@ - -Create table egf_bankaccount( - id bigint, - branchid bigint , - glcodeid bigint , - fundid bigint , - accountNumber varchar(25) NOT NULL, - accountType varchar(20), - description varchar(256), - active boolean NOT NULL, - payTo varchar(100), - type varchar(17) NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint -); -alter table egf_bankaccount add constraint pk_egf_bankaccount primary key (id); -alter table egf_bankaccount add constraint fk_egf_bankaccount_branchid FOREIGN KEY (branchid) REFERENCES egf_bankbranch(id); -alter table egf_bankaccount add constraint fk_egf_bankaccount_glcodeid FOREIGN KEY (glcodeid) REFERENCES egf_chartofaccount(id); -alter table egf_bankaccount add constraint fk_egf_bankaccount_fundid FOREIGN KEY (fundid) REFERENCES egf_fund(id); -create sequence seq_egf_bankaccount; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170313145649__egf_masters_add_tenantid.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170313145649__egf_masters_add_tenantid.sql deleted file mode 100644 index a31922235a6..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170313145649__egf_masters_add_tenantid.sql +++ /dev/null @@ -1,39 +0,0 @@ -ALTER TABLE egf_accountcodepurpose ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_accountdetailkey ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_accountdetailtype ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_bank ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_bankaccount ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_bankbranch ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_budgetgroup ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_chartofaccount ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_chartofaccountdetail ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_financialyear ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_fiscalperiod ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_function ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_functionary ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_fund ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_fundsource ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_scheme ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_subscheme ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_supplier ADD COLUMN tenantId CHARACTER VARYING(250) NULL; -ALTER TABLE egf_accountentitymaster ADD COLUMN tenantId CHARACTER VARYING(250) NULL; - ---rollback ALTER TABLE egf_accountcodepurpose DROP COLUMN tenantId; ---rollback ALTER TABLE egf_accountdetailkey DROP COLUMN tenantId; ---rollback ALTER TABLE egf_accountdetailtype DROP COLUMN tenantId; ---rollback ALTER TABLE egf_bank DROP COLUMN tenantId; ---rollback ALTER TABLE egf_bankaccount DROP COLUMN tenantId; ---rollback ALTER TABLE egf_bankbranch DROP COLUMN tenantId; ---rollback ALTER TABLE egf_budgetgroup DROP COLUMN tenantId; ---rollback ALTER TABLE egf_chartofaccount DROP COLUMN tenantId; ---rollback ALTER TABLE egf_chartofaccountdetail DROP COLUMN tenantId; ---rollback ALTER TABLE egf_financialyear DROP COLUMN tenantId; ---rollback ALTER TABLE egf_fiscalperiod DROP COLUMN tenantId; ---rollback ALTER TABLE egf_function DROP COLUMN tenantId; ---rollback ALTER TABLE egf_functionary DROP COLUMN tenantId; ---rollback ALTER TABLE egf_fund DROP COLUMN tenantId; ---rollback ALTER TABLE egf_fundsource DROP COLUMN tenantId; ---rollback ALTER TABLE egf_scheme DROP COLUMN tenantId; ---rollback ALTER TABLE egf_subscheme DROP COLUMN tenantId; ---rollback ALTER TABLE egf_supplier DROP COLUMN tenantId; ---rollback ALTER TABLE egf_accountentitymaster DROP COLUMN tenantId; \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170313185649__egf_bank_drop_type_notnull_constraint.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170313185649__egf_bank_drop_type_notnull_constraint.sql deleted file mode 100644 index 4119fccf74f..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170313185649__egf_bank_drop_type_notnull_constraint.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE egf_bank ALTER COLUMN type DROP NOT NULL; - ---rollback ALTER TABLE egf_bank ALTER COLUMN type set NOT NULL; \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170314145649__egf_masters_chartofaccount_rename_column.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170314145649__egf_masters_chartofaccount_rename_column.sql deleted file mode 100644 index 1b28970847b..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170314145649__egf_masters_chartofaccount_rename_column.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE egf_chartofaccount RENAME COLUMN desciption TO description; - ---rollback ALTER TABLE egf_chartofaccount RENAME COLUMN description TO desciption; \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170328145649__egf_masters_accountdetailtype_drop_column.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170328145649__egf_masters_accountdetailtype_drop_column.sql deleted file mode 100644 index 960839987e2..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170328145649__egf_masters_accountdetailtype_drop_column.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE egf_accountdetailtype DROP COLUMN columnname RESTRICT; -ALTER TABLE egf_accountdetailtype DROP COLUMN attributename RESTRICT; -ALTER TABLE egf_bankaccount ALTER COLUMN accounttype TYPE varchar(150); - ---rollback ALTER TABLE egf_accountdetailtype add COLUMN columnname varchar(50); ---rollback ALTER TABLE egf_accountdetailtype add COLUMN attributename varchar(50); ---rollback ALTER TABLE egf_bankaccount ALTER COLUMN accounttype TYPE varchar(20); \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170418105602__create_composit_primary_key.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170418105602__create_composit_primary_key.sql deleted file mode 100644 index 1841353c3aa..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170418105602__create_composit_primary_key.sql +++ /dev/null @@ -1,22 +0,0 @@ -ALTER TABLE egf_accountcodepurpose DROP CONSTRAINT pk_egf_accountcodepurpose cascade; -ALTER TABLE egf_accountdetailtype DROP CONSTRAINT pk_egf_accountdetailtype cascade; -ALTER TABLE egf_bankaccount DROP CONSTRAINT pk_egf_bankaccount cascade; -ALTER TABLE egf_bankbranch DROP CONSTRAINT pk_egf_bankbranch cascade; -ALTER TABLE egf_bank DROP CONSTRAINT pk_egf_bank cascade; -ALTER TABLE egf_chartofaccount DROP CONSTRAINT pk_egf_chartofaccount cascade; -ALTER TABLE egf_chartofaccountdetail DROP CONSTRAINT pk_egf_chartofaccountdetail cascade; -ALTER TABLE egf_functionary DROP CONSTRAINT pk_egf_functionary cascade; -ALTER TABLE egf_function DROP CONSTRAINT pk_egf_function cascade; -ALTER TABLE egf_fund DROP CONSTRAINT pk_egf_fund cascade; - -ALTER TABLE egf_accountcodepurpose ADD primary key (id, tenantid); -ALTER TABLE egf_accountdetailtype ADD primary key (id, tenantid); -ALTER TABLE egf_bankaccount ADD primary key (id, tenantid); -ALTER TABLE egf_bankbranch ADD primary key (id, tenantid); -ALTER TABLE egf_bank ADD primary key (id, tenantid); -ALTER TABLE egf_chartofaccount ADD primary key (id, tenantid); -ALTER TABLE egf_chartofaccountdetail ADD primary key (id, tenantid); -ALTER TABLE egf_functionary ADD primary key (id, tenantid); -ALTER TABLE egf_function ADD primary key (id, tenantid); -ALTER TABLE egf_fund ADD primary key (id, tenantid); - diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170510172206__egf_accountdetailkey_cleanup.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170510172206__egf_accountdetailkey_cleanup.sql deleted file mode 100644 index b7581589229..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170510172206__egf_accountdetailkey_cleanup.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE egf_accountdetailkey DROP CONSTRAINT pk_egf_accountdetailkey cascade; -ALTER TABLE egf_accountdetailkey ADD primary key (id, tenantid); -ALTER TABLE egf_accountdetailkey alter column key type bigint; -ALTER TABLE egf_accountdetailkey drop column groupid; -ALTER TABLE egf_accountdetailkey drop column name; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170524150531__egf_budgetgroup_rename_maxcode.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170524150531__egf_budgetgroup_rename_maxcode.sql deleted file mode 100644 index f3c193f1d11..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170524150531__egf_budgetgroup_rename_maxcode.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE egf_budgetgroup RENAME hgfdsa TO maxcode; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170524164710__egf_configuration_status_configurationvalues.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170524164710__egf_configuration_status_configurationvalues.sql deleted file mode 100644 index 3a5ca0ede92..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170524164710__egf_configuration_status_configurationvalues.sql +++ /dev/null @@ -1,64 +0,0 @@ -CREATE TABLE egeis_egfStatus ( - id BIGINT NOT NULL, - objectName CHARACTER VARYING(50) NOT NULL, - code CHARACTER VARYING(20) NOT NULL, - description CHARACTER VARYING(250) NOT NULL, - tenantId CHARACTER VARYING(250) NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint, - - CONSTRAINT pk_egeis_egfStatus PRIMARY KEY (id) -); - -CREATE SEQUENCE seq_egeis_egfStatus - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -CREATE TABLE egeis_egfConfiguration ( - id BIGINT NOT NULL, - keyName CHARACTER VARYING(50) NOT NULL, - description CHARACTER VARYING(250), - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint, - tenantId CHARACTER VARYING(250) NOT NULL, - - CONSTRAINT pk_egeis_egfConfiguration PRIMARY KEY (Id) -); - -CREATE SEQUENCE seq_egeis_egfConfiguration - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -CREATE TABLE egeis_egfConfigurationValues ( - id BIGINT NOT NULL, - keyId BIGINT NOT NULL, - value CHARACTER VARYING(1000) NOT NULL, - effectiveFrom DATE NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint, - tenantId CHARACTER VARYING(250) NOT NULL, - - CONSTRAINT pk_egeis_egfConfigurationValues PRIMARY KEY (Id) -); - -CREATE SEQUENCE seq_egeis_egfConfigurationValues - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170525110921__egf_status_objectname_to_moduletype.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170525110921__egf_status_objectname_to_moduletype.sql deleted file mode 100644 index a4f5a8284a7..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170525110921__egf_status_objectname_to_moduletype.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE egeis_egfStatus RENAME objectName TO moduleType; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170529150208__egf_fund_alter_table.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170529150208__egf_fund_alter_table.sql deleted file mode 100644 index 6a4edb01d73..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170529150208__egf_fund_alter_table.sql +++ /dev/null @@ -1 +0,0 @@ -alter table egf_fund alter column identifier DROP NOT NULL ; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170711155751__egf_alter_columnname_type.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170711155751__egf_alter_columnname_type.sql deleted file mode 100644 index db2267d3a8e..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170711155751__egf_alter_columnname_type.sql +++ /dev/null @@ -1,202 +0,0 @@ -ALTER TABLE egf_accountdetailkey RENAME detailtypeid TO accountdetailtypeid; -ALTER TABLE egf_accountdetailtype RENAME fully_qualified_name TO fullyqualifiedname; -ALTER TABLE egf_accountentitymaster RENAME TO egf_accountentity; -ALTER TABLE egf_accountentity RENAME detailtypeid TO accountdetailtypeid; -ALTER TABLE egf_bankaccount RENAME branchid TO bankbranchid; -ALTER TABLE egf_bankaccount RENAME glcodeid TO chartofaccountid; -ALTER TABLE egf_bankaccount RENAME type TO typeid; -ALTER TABLE egf_budgetgroup RENAME accounttype TO accounttypeid; -ALTER TABLE egf_budgetgroup RENAME budgetingtype TO budgetingtypeid; -ALTER TABLE egf_chartofaccount RENAME purposeid TO accountcodepurposeid; -ALTER TABLE egf_chartofaccountdetail RENAME glcodeid TO chartofaccountid; -ALTER TABLE egf_chartofaccountdetail RENAME detailtypeid TO accountdetailtypeid; -ALTER TABLE egf_financialyear RENAME financialyear TO finyearrange; -ALTER TABLE egf_subscheme RENAME scheme TO schemeid; -ALTER TABLE egf_supplier RENAME bankaccount TO bankaccountid; -ALTER TABLE egf_supplier RENAME bank TO bankid; -ALTER TABLE egf_accountcodepurpose ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_accountcodepurpose ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_accountcodepurpose ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_accountdetailkey ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_accountdetailkey ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_accountdetailkey ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_accountdetailkey ALTER COLUMN accountdetailtypeid TYPE varchar(256); -ALTER TABLE egf_accountdetailtype ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_accountdetailtype ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_accountdetailtype ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_accountentity ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_accountentity ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_accountentity ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_accountentity ALTER COLUMN accountdetailtypeid TYPE varchar(256); -ALTER TABLE egf_bankaccount ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_bankaccount ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_bankaccount ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_bankaccount ALTER COLUMN bankbranchid TYPE varchar(256); -ALTER TABLE egf_bankaccount ALTER COLUMN chartofaccountid TYPE varchar(256); -ALTER TABLE egf_bankaccount ALTER COLUMN fundid TYPE varchar(256); -ALTER TABLE egf_bankbranch ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_bankbranch ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_bankbranch ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_budgetgroup ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_budgetgroup ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_budgetgroup ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_budgetgroup ALTER COLUMN accounttypeid TYPE varchar(256); -ALTER TABLE egf_chartofaccountdetail ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_chartofaccountdetail ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_chartofaccountdetail ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_chartofaccountdetail ALTER COLUMN chartofaccountid TYPE varchar(256); -ALTER TABLE egf_chartofaccountdetail ALTER COLUMN accountdetailtypeid TYPE varchar(256); -ALTER TABLE egf_chartofaccount ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_chartofaccount ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_chartofaccount ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_chartofaccount ALTER COLUMN accountcodepurposeid TYPE varchar(256); -ALTER TABLE egf_chartofaccount ALTER COLUMN parentid TYPE varchar(256); -ALTER TABLE egf_fiscalperiod ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_fiscalperiod ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_fiscalperiod ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_fiscalperiod DROP CONSTRAINT fk_egf_fiscalperiod_FinancialYearid; -ALTER TABLE egf_fiscalperiod ALTER COLUMN financialyearid TYPE varchar(256); -ALTER TABLE egf_financialyear ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_financialyear ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_financialyear ALTER COLUMN lastmodifiedby TYPE varchar(256); -alter table egf_fiscalperiod add constraint fk_egf_fiscalperiod_FinancialYearid FOREIGN KEY (FinancialYearid) REFERENCES egf_financialyear(id); -ALTER TABLE egf_functionary ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_functionary ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_functionary ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_function ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_function ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_function ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_function ALTER COLUMN parentid TYPE varchar(256); -ALTER TABLE egf_fund ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_fund ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_fund ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_fund ALTER COLUMN parentid TYPE varchar(256); -ALTER TABLE egf_fundsource ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_fundsource ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_fundsource DROP CONSTRAINT fk_egf_fundsource_parentid; -ALTER TABLE egf_fundsource ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_fundsource ALTER COLUMN parentid TYPE varchar(256); -alter table egf_fundsource add constraint fk_egf_fundsource_parentid FOREIGN KEY (parentid) REFERENCES egf_fundsource(id); -ALTER TABLE egf_scheme ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_scheme ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_scheme ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_scheme ALTER COLUMN fundid TYPE varchar(256); -ALTER TABLE egf_scheme ALTER COLUMN boundary TYPE varchar(256); -ALTER TABLE egf_subscheme ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_subscheme ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_subscheme ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_subscheme ALTER COLUMN schemeid TYPE varchar(256); -ALTER TABLE egf_supplier ALTER COLUMN id TYPE varchar(256); -ALTER TABLE egf_supplier ALTER COLUMN createdby TYPE varchar(256); -ALTER TABLE egf_supplier ALTER COLUMN lastmodifiedby TYPE varchar(256); -ALTER TABLE egf_supplier ALTER COLUMN bankaccountid TYPE varchar(256); -ALTER TABLE egf_supplier ALTER COLUMN bankid TYPE varchar(256); - -alter table egf_bank alter column id TYPE varchar(256); -alter table egf_bank alter column createdby TYPE varchar(256); -alter table egf_bank alter column lastmodifiedby TYPE varchar(256); -alter table egf_bankbranch alter column bankid TYPE varchar(250); -ALTER TABLE egf_bankaccount RENAME COLUMN typeid TO type; -ALTER TABLE egf_budgetgroup RENAME maxcode TO maxcodeid ; -ALTER TABLE egf_budgetgroup alter maxcodeid type varchar(256) ; -ALTER TABLE egf_budgetgroup RENAME mincode TO mincodeid ; -ALTER TABLE egf_budgetgroup alter mincodeid type varchar(256) ; -ALTER TABLE egf_budgetgroup RENAME majorcode TO majorcodeid ; -ALTER TABLE egf_budgetgroup alter majorcodeid type varchar(256) ; -ALTER TABLE egf_accountdetailkey ALTER COLUMN key TYPE varchar(256); - - - ---rollback ALTER TABLE egf_fiscalperiod DROP CONSTRAINT fk_egf_fiscalperiod_FinancialYearid; ---rollback ALTER TABLE egf_fundsource DROP CONSTRAINT fk_egf_fundsource_parentid; ---rollback ALTER TABLE egf_supplier ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccount RENAME accountcodepurposeid TO purposeid; ---rollback ALTER TABLE egf_supplier ALTER COLUMN bankaccountid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_supplier ALTER COLUMN bankid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_supplier ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_supplier ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_subscheme ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_subscheme ALTER COLUMN schemeid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_subscheme ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_subscheme ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_scheme ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_scheme ALTER COLUMN fundid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_scheme ALTER COLUMN boundary TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_scheme ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_scheme ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fundsource ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fundsource ALTER COLUMN parentid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fundsource ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fundsource ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fund ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fund ALTER COLUMN parentid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fund ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fund ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_function ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_function ALTER COLUMN parentid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_function ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_function ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_functionary ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_functionary ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_functionary ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fiscalperiod ALTER COLUMN financialyearid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fiscalperiod ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fiscalperiod ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_fiscalperiod ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_financialyear ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_financialyear ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_financialyear ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccount ALTER COLUMN purposeid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccount ALTER COLUMN parentid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccount ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccount ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccount ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccountdetail ALTER COLUMN chartofaccountid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccountdetail ALTER COLUMN accountdetailtypeid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccountdetail ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccountdetail ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_chartofaccountdetail ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_budgetgroup ALTER COLUMN accounttypeid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_budgetgroup ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_budgetgroup ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_budgetgroup ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankbranch ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankbranch ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankbranch ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankaccount ALTER COLUMN bankbranchid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankaccount ALTER COLUMN chartofaccountid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankaccount ALTER COLUMN fundid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankaccount ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankaccount ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_bankaccount ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountentity ALTER COLUMN accountdetailtypeid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountentity ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountentity ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountentity ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountdetailtype ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountdetailtype ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountdetailtype ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountdetailkey ALTER COLUMN accountdetailtypeid TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountdetailkey ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountdetailkey ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountdetailkey ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountcodepurpose ALTER COLUMN id TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountcodepurpose ALTER COLUMN createdby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_accountcodepurpose ALTER COLUMN lastmodifiedby TYPE bigint USING id::bigint; ---rollback ALTER TABLE egf_supplier RENAME bankaccountid TO bankaccount; ---rollback ALTER TABLE egf_supplier RENAME bankid TO bank; ---rollback ALTER TABLE egf_subscheme RENAME schemeid TO scheme; ---rollback ALTER TABLE egf_financialyear RENAME finyearrange TO financialyear; ---rollback ALTER TABLE egf_chartofaccountdetail RENAME chartofaccountid TO glcodeid; ---rollback ALTER TABLE egf_chartofaccountdetail RENAME accountdetailtypeid TO detailtypeid; ---rollback ALTER TABLE egf_budgetgroup RENAME accounttypeid TO accounttype; ---rollback ALTER TABLE egf_budgetgroup RENAME budgetingtypeid TO budgetingtype; ---rollback ALTER TABLE egf_bankaccount RENAME bankbranchid TO branchid; ---rollback ALTER TABLE egf_bankaccount RENAME chartofaccountid TO glcodeid; ---rollback ALTER TABLE egf_bankaccount RENAME typeid TO type; ---rollback ALTER TABLE egf_accountdetailtype RENAME fullyqualifiedname TO fully_qualified_name; ---rollback ALTER TABLE egf_accountdetailkey RENAME accountdetailtypeid TO detailtypeid; ---rollback ALTER TABLE egf_accountentity RENAME TO egf_accountentitymaster; ---rollback ALTER TABLE egf_accountentitymaster RENAME accountdetailtypeid TO detailtypeid; ---rollback alter table egf_fundsource add constraint fk_egf_fundsource_parentid FOREIGN KEY (parentid) REFERENCES egf_fundsource(id); ---rollback alter table egf_fiscalperiod add constraint fk_egf_fiscalperiod_FinancialYearid FOREIGN KEY (FinancialYearid) REFERENCES egf_financialyear(id); diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170726175703__egf_FinancialStatus_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170726175703__egf_FinancialStatus_ddl.sql deleted file mode 100644 index 0faf5ac05e0..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170726175703__egf_FinancialStatus_ddl.sql +++ /dev/null @@ -1,18 +0,0 @@ - drop table if exists egeis_egfStatus ; - drop sequence if exists seq_egeis_egfStatus ; - - create table egf_financialstatus( - id varchar(50) NOT NULL, - moduleType varchar(50) NOT NULL, - code varchar(20) NOT NULL, - name varchar(20) NOT NULL, - description varchar(250) NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint, - tenantId varchar(250) -); -alter table egf_financialstatus add constraint pk_egf_financialstatus primary key (name,tenantId); -alter table egf_financialstatus add constraint unique_egf_financialstatus unique (code,tenantId); \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170801150208__egf_master_alter_table.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170801150208__egf_master_alter_table.sql deleted file mode 100644 index 6688577c2c1..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170801150208__egf_master_alter_table.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE egf_budgetgroup RENAME accounttypeid TO accounttype; -ALTER TABLE egf_budgetgroup RENAME budgetingtypeid TO budgetingtype; \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170804130050__egf_master_function_alterddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170804130050__egf_master_function_alterddl.sql deleted file mode 100644 index f4fe0c52197..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170804130050__egf_master_function_alterddl.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE egf_function DROP COLUMN isparent; \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170804165325__egf_financialconfiguration_and_values_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170804165325__egf_financialconfiguration_and_values_ddl.sql deleted file mode 100644 index 8712a3a0eea..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170804165325__egf_financialconfiguration_and_values_ddl.sql +++ /dev/null @@ -1,49 +0,0 @@ - drop table if exists egeis_egfConfiguration ; - drop sequence if exists seq_egeis_egfConfiguration ; - drop table if exists egeis_egfConfigurationValues ; - drop sequence if exists seq_egeis_egfConfigurationValues ; - -CREATE TABLE egf_financialconfiguration ( - id CHARACTER VARYING(250) NOT NULL, - keyName CHARACTER VARYING(50) NOT NULL, - description CHARACTER VARYING(250), - module CHARACTER VARYING(50), - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint, - tenantId CHARACTER VARYING(250) NOT NULL, - - CONSTRAINT pk_egf_financialconfiguration PRIMARY KEY (Id) -); - -CREATE SEQUENCE seq_egf_financialconfiguration - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -CREATE TABLE egf_financialconfigurationvalues ( - id CHARACTER VARYING(250) NOT NULL, - keyId CHARACTER VARYING(250) NOT NULL, - value CHARACTER VARYING(1000) NOT NULL, - effectiveFrom DATE NOT NULL, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint, - tenantId CHARACTER VARYING(250) NOT NULL, - - CONSTRAINT pk_egf_financialconfigurationvalues PRIMARY KEY (Id) -); - -CREATE SEQUENCE seq_egf_financialconfigurationvalues - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170804165424__egf_master_fund_alterddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170804165424__egf_master_fund_alterddl.sql deleted file mode 100644 index 95a188ba577..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170804165424__egf_master_fund_alterddl.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE egf_fund DROP COLUMN isparent; \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170809154850__egf_financialconfiguration_and_values_alter_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170809154850__egf_financialconfiguration_and_values_alter_ddl.sql deleted file mode 100644 index c8cb6344706..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170809154850__egf_financialconfiguration_and_values_alter_ddl.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE egf_financialconfiguration RENAME COLUMN keyName TO name; - -ALTER TABLE egf_financialconfigurationvalues RENAME COLUMN keyId TO financialConfigurationId; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170810195820__egf_recovery_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170810195820__egf_recovery_ddl.sql deleted file mode 100644 index a80f0d41848..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170810195820__egf_recovery_ddl.sql +++ /dev/null @@ -1,24 +0,0 @@ - -Create table egf_recovery( - id VARCHAR(256), - chartofaccountid varchar(256) NOT NULL, - type varchar(20), - flat double precision, - active boolean NOT NULL, - remitted varchar(100) not null, - name VARCHAR(50) not null, - code VARCHAR(50) not null, - ifsccode VARCHAR(16), - mode VARCHAR(1), - remittancemode VARCHAR(1), - accountnumber VARCHAR(32), - percentage double precision, - createdby bigint, - createddate timestamp without time zone, - lastmodifiedby bigint, - lastmodifieddate timestamp without time zone, - version bigint default 0, - tenantid VARCHAR(256) not null -); -alter table egf_recovery add constraint pk_egf_recovery primary key (id,tenantid); -create sequence seq_egf_recovery; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170907150253__egf_vouchersubtype_drop_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170907150253__egf_vouchersubtype_drop_ddl.sql deleted file mode 100644 index c1cf77c9816..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170907150253__egf_vouchersubtype_drop_ddl.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE IF EXISTS egf_vouchersubtype; - -DROP SEQUENCE IF EXISTS seq_egf_vouchersubtype; diff --git a/business-services/egf-master/src/main/resources/db/migration/main/V20170920175048__egf_deletetransaction_ddl.sql b/business-services/egf-master/src/main/resources/db/migration/main/V20170920175048__egf_deletetransaction_ddl.sql deleted file mode 100644 index 69440762b9f..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/main/V20170920175048__egf_deletetransaction_ddl.sql +++ /dev/null @@ -1,3 +0,0 @@ -create table egf_deletedtxn (id varchar,tablename varchar,identifier varchar,tenantid varchar,reason varchar,data json, -updateddate date -); \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/qa/V20171106132517__financialyear_data b/business-services/egf-master/src/main/resources/db/migration/qa/V20171106132517__financialyear_data deleted file mode 100644 index 713a0051189..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/qa/V20171106132517__financialyear_data +++ /dev/null @@ -1,6 +0,0 @@ -delete from egf_financialyear; -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2019-20','01-Apr-2019','31-Mar-2020',true,false,1,current_date,'default'); -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2020-21','01-Apr-2020','31-Mar-2021',true,false,1,current_date,'default'); -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2021-22','01-Apr-2021','31-Mar-2022',true,false,1,current_date,'default'); -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2022-23','01-Apr-2022','31-Mar-2023',true,false,1,current_date,'default'); -insert into egf_financialyear (id,finyearrange,startingdate,endingdate,active,isactiveforposting,createdby,createddate,tenantid) values(nextval('seq_egf_financialyear'),'2023-24','01-Apr-2023','31-Mar-2024',true,false,1,current_date,'default'); diff --git a/business-services/egf-master/src/main/resources/db/migration/seed/V20170629150132__accountcode_purpose_data.sql b/business-services/egf-master/src/main/resources/db/migration/seed/V20170629150132__accountcode_purpose_data.sql deleted file mode 100644 index 1a6b0dad5df..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/seed/V20170629150132__accountcode_purpose_data.sql +++ /dev/null @@ -1,36 +0,0 @@ - -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (4, 'Cash In Hand', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (5, 'Cheque In Hand', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (7, 'ExcessIE', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (8, ' Payable to Other Funds', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (10, 'Contractor Deductions', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (11, 'Fixed Assets', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (12, 'Bank Account Codes', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (15, 'Accumulated Depreciation', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (16, 'CWIP Account code', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (17, 'Depreciation Expense Account', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (18, 'Revaluation Reserve Account', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (21, 'Fixed Assets Written off', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (22, 'Inter-Unit Transfer Account', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (26, 'Creditors-Contractor Payable', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (27, 'Creditors-Supplier Payable', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (28, 'Contigency Bill Code', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (29, 'Security Deposit', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (30, 'Bank Charges', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (31, 'Salary Payable', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (34, 'Pension Payable', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (35, 'Supplier Advance Account', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (36, 'Wages Payable', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (37, 'Material Clearing Account', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (38, 'Scrap Suspense Account', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (60, 'Overhead_account codes', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (61, 'DEPOSIT:OTHER WORKS', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (62, 'REPAIRS AND MAINTENANCE', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (95, 'RETENTION_MONEY', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (96, 'LandEstate_Rent_purpose', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (103, 'Pension Payable Code', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (105, 'CONTRACTOR_ADVANCE_ACCOUNTCODE', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (120, 'BPA Deposit CWIP Account Code', NULL, NULL, NULL, NULL, 0, 'default'); -INSERT INTO egf_accountcodepurpose (id, name, createdby, createddate, lastmodifieddate, lastmodifiedby, version, tenantid) VALUES (121, 'Cash In Transit', NULL, NULL, NULL, NULL, 0, 'default'); - -SELECT setval('seq_egf_accountcodepurpose',(select max(id)+1 from egf_accountcodepurpose)); diff --git a/business-services/egf-master/src/main/resources/db/migration/seed/V20170721155751__egf_configuration_fetch_data_from.sql b/business-services/egf-master/src/main/resources/db/migration/seed/V20170721155751__egf_configuration_fetch_data_from.sql deleted file mode 100644 index 56cf963063a..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/seed/V20170721155751__egf_configuration_fetch_data_from.sql +++ /dev/null @@ -1,15 +0,0 @@ -INSERT INTO egeis_egfconfiguration( - id, keyname, description, createdby, createddate, lastmodifiedby, - lastmodifieddate, version, tenantid) - VALUES (NEXTVAL('seq_egeis_egfconfiguration'), 'FETCH_DATA_FROM', 'Data to be fetched from es or db', 1, now(), 1, - now(), 0, 'default'); - - -INSERT INTO egeis_egfconfigurationvalues( - id, keyid, value, effectivefrom, createdby, createddate, lastmodifiedby, - lastmodifieddate, version, tenantid) - VALUES (NEXTVAL('seq_egeis_egfconfigurationvalues'), (select id from egeis_egfconfiguration where keyname='FETCH_DATA_FROM'), 'db', now(), 1, now(), - 1, now(), 0,'default'); - ---rollback delete from egeis_egfconfigurationvalues where keyid = (select id from egeis_egfconfiguration where keyname='FETCH_DATA_FROM'); ---rollback delete from egeis_egfconfiguration where keyname = 'FETCH_DATA_FROM'; \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/seed/V20170726175805__egf_instrument_status.sql b/business-services/egf-master/src/main/resources/db/migration/seed/V20170726175805__egf_instrument_status.sql deleted file mode 100644 index 7070052b722..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/seed/V20170726175805__egf_instrument_status.sql +++ /dev/null @@ -1,29 +0,0 @@ -INSERT INTO egf_financialstatus( - id, moduletype, code, name, description, createdby, createddate, - lastmodifiedby, lastmodifieddate, version, tenantid) - VALUES ('cc6e551b-3a75-4b1e-a9ec-a2293fe03137', 'Instrument', 'New', 'New', 'Status assign when instrument is created', '1', now(), - '1', now(), 0, 'default'); - -INSERT INTO egf_financialstatus( - id, moduletype, code, name, description, createdby, createddate, - lastmodifiedby, lastmodifieddate, version, tenantid) - VALUES ('a167095b-5a73-4e61-b489-af31f053c4e1', 'Instrument', 'Deposited', 'Deposited', 'Status assign when instrument is deposited to bank', '1', now(), - '1', now(), 0, 'default'); - -INSERT INTO egf_financialstatus( - id, moduletype, code, name, description, createdby, createddate, - lastmodifiedby, lastmodifieddate, version, tenantid) - VALUES ('b5880534-2bae-47e0-ae00-4820fc46d579', 'Instrument', 'Reconciled', 'Reconciled', 'Status assign when instrument is reconciled', '1', now(), - '1', now(), 0, 'default'); - -INSERT INTO egf_financialstatus( - id, moduletype, code, name, description, createdby, createddate, - lastmodifiedby, lastmodifieddate, version, tenantid) - VALUES ('b69493dc-c3ab-4927-973a-600c352a2afa', 'Instrument', 'Dishonored', 'Dishonored', 'Status assign when instrument is Dishonored', '1', now(), - '1', now(), 0, 'default'); - -INSERT INTO egf_financialstatus( - id, moduletype, code, name, description, createdby, createddate, - lastmodifiedby, lastmodifieddate, version, tenantid) - VALUES ('2d8a0047-a77f-43cd-bed7-700459bc24a9', 'Instrument', 'Surrendered', 'Surrendered', 'Status assign when instrument is given back', '1', now(), - '1', now(), 0, 'default'); \ No newline at end of file diff --git a/business-services/egf-master/src/main/resources/db/migration/seed/V20170804165728__egf_configurations_for_voucher.sql b/business-services/egf-master/src/main/resources/db/migration/seed/V20170804165728__egf_configurations_for_voucher.sql deleted file mode 100644 index 04e515d9f31..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/seed/V20170804165728__egf_configurations_for_voucher.sql +++ /dev/null @@ -1,42 +0,0 @@ -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('3a7010b3-611a-48e6-8333-f4c197ec4fd1','Bank balance mandatory','Bank balance mandatory check','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('dd2602f1-1ea8-4cbc-b855-9572ea6d872c','Use billdate in create voucher from bill','Use billdate in create voucher from bill api','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('f563956c-eeea-4fad-8d41-25a4aa0c74cc','Pre-approved voucher status','Pre-approved voucher status','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('3e8e8ac6-0b6b-45d5-91c4-57dd67b5dba6','Approved voucher status','Approved voucher status','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('8551d6af-74ad-4852-b845-8b782ae90da1','Default voucher creation status','Default voucher creation status','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('b3decea6-5c9f-46e9-8393-58c5b26d4256','Default transaction mis attrributes','default transaction mis attributes','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('cec345c3-cf64-4a8e-8c31-7ed10e8b52b9','Journal voucher confirm on create','journal voucher create isconfirmed value','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('1eafaf13-f406-46e2-9158-d3085690ed15','If restricted to one function center','If restricted to one function center','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('992ed89c-fdd0-4929-86b5-429d1179cb88','Voucher date from UI','Get voucher date from UI','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('68eb56f9-0752-43f4-ba58-98ba1b519342','Data entry cut off date','Data entry cut off date','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('32fbebc9-0768-4e39-ac65-bbfaf60249c5','Auto generate receipt vouchernumber','Voucher number to be autogenerated for receipt voucher number','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('48b655fa-54f4-4c8d-a1d2-441f12e059e0','Auto generate payment vouchernumber','Voucher number to be autogenerated for payment voucher number','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('12cb8a13-78b2-4fc4-9192-791f9f8841fe','Auto generate contra vouchernumber','Voucher number to be autogenerated for contra voucher number','egf-voucher',1,now(),1,now(),'default'); - -insert into egf_financialconfiguration(id,keyName,description,module,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('393c86ce-f58d-442e-9dc7-47918bdf829b','Auto generate journal vouchernumber','Voucher number to be autogenerated for journal voucher number','egf-voucher',1,now(),1,now(),'default'); - diff --git a/business-services/egf-master/src/main/resources/db/migration/seed/V20170804165736__egf_configuration_values_for_voucher.sql b/business-services/egf-master/src/main/resources/db/migration/seed/V20170804165736__egf_configuration_values_for_voucher.sql deleted file mode 100644 index 49b16db3023..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/seed/V20170804165736__egf_configuration_values_for_voucher.sql +++ /dev/null @@ -1,47 +0,0 @@ -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('db2c257a-e5b5-41e2-a73a-a5b0d86b4467',(select id from egf_financialconfiguration where keyname = 'Pre-approved voucher status'),'5','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('8dd955b9-8676-42a8-b524-c7616288cc58',(select id from egf_financialconfiguration where keyname = 'Approved voucher status'),'0','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('c1cb84f7-7427-4dac-9588-b9480421d97b',(select id from egf_financialconfiguration where keyname = 'Default voucher creation status'),'0','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('fe6f48bc-f6df-4869-8a25-36421dadfb15',(select id from egf_financialconfiguration where keyname = 'Default transaction mis attrributes'),'department|M','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('0d0b4ab5-57f7-44c4-a633-d8d2f73b356e',(select id from egf_financialconfiguration where keyname = 'Default transaction mis attrributes'),'fund|M','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('5493e25b-cf58-4d1a-a715-9298f10b7a42',(select id from egf_financialconfiguration where keyname = 'Default transaction mis attrributes'),'function|M','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('38d7f782-842d-4893-a7d4-b44c60e9dc48',(select id from egf_financialconfiguration where keyname = 'Journal voucher confirm on create'),'0','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('bd435fbf-bc65-4700-bfb1-b114ea5fabd1',(select id from egf_financialconfiguration where keyname = 'Use billdate in create voucher from bill'),'N','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('e4a4daf7-2098-4ee2-94b4-8e3c7da88221',(select id from egf_financialconfiguration where keyname = 'Bank balance mandatory'),'N','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('0a4a5bf6-d655-4cc3-bdc3-e84c1496608e',(select id from egf_financialconfiguration where keyname = 'Voucher date from UI'),'Y','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('cf7ef4f9-cc0e-4d5c-8dc7-702802195001',(select id from egf_financialconfiguration where keyname = 'If restricted to one function center'),'Yes','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('2411d97f-1f23-4134-93a3-24369e21320b',(select id from egf_financialconfiguration where keyname = 'Data entry cut off date'),'30-Jun-2017','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('4fc471b3-8b6c-4704-85ca-e9c7f1821662',(select id from egf_financialconfiguration where keyname = 'Auto generate receipt vouchernumber'),'Y','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('03120edf-eb43-40f2-84c2-bb719ff4a405',(select id from egf_financialconfiguration where keyname = 'Auto generate payment vouchernumber'),'Y','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('3587adf9-3195-4a13-b4fa-61d147e24063',(select id from egf_financialconfiguration where keyname = 'Auto generate contra vouchernumber'),'Y','01/01/2017',1,now(),1,now(),'default'); - -insert into egf_financialconfigurationvalues(id,keyid,value,effectivefrom,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantId) -values('07c8e274-29be-4ec6-8170-e2f6a0011ea7',(select id from egf_financialconfiguration where keyname = 'Auto generate journal vouchernumber'),'Y','01/01/2017',1,now(),1,now(),'default'); diff --git a/business-services/egf-master/src/main/resources/db/migration/seed/V20181010154907__egf_instrument_status_for_punjab.sql b/business-services/egf-master/src/main/resources/db/migration/seed/V20181010154907__egf_instrument_status_for_punjab.sql deleted file mode 100644 index fec42c6f47e..00000000000 --- a/business-services/egf-master/src/main/resources/db/migration/seed/V20181010154907__egf_instrument_status_for_punjab.sql +++ /dev/null @@ -1,61 +0,0 @@ -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate,lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff0acc-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'New', 'New', 'Status assign when instrument is created', '1', now(),'1', now(), 0, 'pb.jalandhar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff1332-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Deposited', 'Deposited', 'Status assign when instrument is deposited to bank', '1', now(), '1', now(), 0, 'pb.jalandhar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff14cc-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Reconciled', 'Reconciled', 'Status assign when instrument is reconciled', '1', now(), '1', now(), 0, 'pb.jalandhar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff160c-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Dishonored', 'Dishonored', 'Status assign when instrument is Dishonored', '1', now(),'1', now(), 0, 'pb.jalandhar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff1738-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Surrendered', 'Surrendered', 'Status assign when instrument is given back', '1', now(), '1', now(), 0, 'pb.jalandhar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate,lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff1864-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'New', 'New', 'Status assign when instrument is created', '1', now(),'1', now(), 0, 'pb.mohali'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff1a1c-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Deposited', 'Deposited', 'Status assign when instrument is deposited to bank', '1', now(), '1', now(), 0, 'pb.mohali'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff1e18-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Reconciled', 'Reconciled', 'Status assign when instrument is reconciled', '1', now(), '1', now(), 0, 'pb.mohali'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff1f62-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Dishonored', 'Dishonored', 'Status assign when instrument is Dishonored', '1', now(),'1', now(), 0, 'pb.mohali'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff20ac-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Surrendered', 'Surrendered', 'Status assign when instrument is given back', '1', now(), '1', now(), 0, 'pb.mohali'); - - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate,lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff21d8-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'New', 'New', 'Status assign when instrument is created', '1', now(),'1', now(), 0, 'pb.nayagaon'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2304-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Deposited', 'Deposited', 'Status assign when instrument is deposited to bank', '1', now(), '1', now(), 0, 'pb.nayagaon'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2430-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Reconciled', 'Reconciled', 'Status assign when instrument is reconciled', '1', now(), '1', now(), 0, 'pb.nayagaon'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2854-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Dishonored', 'Dishonored', 'Status assign when instrument is Dishonored', '1', now(),'1', now(), 0, 'pb.nayagaon'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff29bc-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Surrendered', 'Surrendered', 'Status assign when instrument is given back', '1', now(), '1', now(), 0, 'pb.nayagaon'); - - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate,lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2ae8-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'New', 'New', 'Status assign when instrument is created', '1', now(),'1', now(), 0, 'pb.amritsar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2c14-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Deposited', 'Deposited', 'Status assign when instrument is deposited to bank', '1', now(), '1', now(), 0, 'pb.amritsar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2d40-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Reconciled', 'Reconciled', 'Status assign when instrument is reconciled', '1', now(), '1', now(), 0, 'pb.amritsar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2e6c-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Dishonored', 'Dishonored', 'Status assign when instrument is Dishonored', '1', now(),'1', now(), 0, 'pb.amritsar'); - -INSERT INTO egf_financialstatus(id, moduletype, code, name, description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) -VALUES ('48ff2f98-cc75-11e8-a8d5-f2801f1b9fd1', 'Instrument', 'Surrendered', 'Surrendered', 'Status assign when instrument is given back', '1', now(), '1', now(), 0, 'pb.amritsar'); \ No newline at end of file diff --git a/business-services/egf-master/src/postman/Recovery Negative.postman_collection.json b/business-services/egf-master/src/postman/Recovery Negative.postman_collection.json deleted file mode 100644 index 6f191ffedb4..00000000000 --- a/business-services/egf-master/src/postman/Recovery Negative.postman_collection.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "variables": [], - "info": { - "name": "Recovery Negative", - "_postman_id": "d83af2f9-9f64-1961-46e8-8113e9f2e4f4", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "http://localhost:8280/egf-master/recoverys/_update", - "request": { - "url": "http://localhost:8280/egf-master/recoverys/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "\n{\n \"requestInfo\": {\n \"resMsgId\": \"placeholder\",\n \"status\": \"200\",\n \"apiId\": null,\n \"ver\": null,\n \"ts\": \"01-01-2017 01:01:01\",\n \"key\": null\n },\n \"recoverys\": [\n {\n \"code\":\"final\",\n \"name\":\"final\",\n \"chartOfAccount\":{\n \"glcode\":\"341\",\n \"tenantId\":\"default\"\n },\n \"active\":true,\n \"type\":\"M\",\n \"flat\":\"100\",\n \"remitted\":\"S\",\n \"ifscCode\":\"SBIN0005532U\",\n \"accountNumber\":\"3049223457\",\n \"tenantId\":\"default\",\n \"mode\":\"M\",\n \"remittanceMode\":\"M\"\n }\n \n ]\n}" - }, - "description": "Recovery Update fails because no ID is provided" - }, - "response": [] - }, - { - "name": "http://localhost:8280/egf-master/recoverys/_create", - "request": { - "url": "http://localhost:8280/egf-master/recoverys/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "\n{\n \"requestInfo\": {\n \"resMsgId\": \"placeholder\",\n \"status\": \"200\",\n \"apiId\": null,\n \"ver\": null,\n \"ts\": \"01-01-2017 01:01:01\",\n \"key\": null\n },\n \"recoverys\": [\n {\n \"name\":\"final\",\n \"chartOfAccount\":{\n \"glcode\":\"341\",\n \"tenantId\":\"default\"\n },\n \"active\":true,\n \"type\":\"M\",\n \"flat\":\"100\",\n \"remitted\":\"S\",\n \"ifscCode\":\"SBIN0005532U\",\n \"accountNumber\":\"3049223457\",\n \"tenantId\":\"default\",\n \"mode\":\"M\",\n \"remittanceMode\":\"M\"\n }\n \n ]\n}" - }, - "description": "Recovery Create Failed since mandatory fields not sent in request" - }, - "response": [] - }, - { - "name": "http://localhost:8280/egf-master/recoverys/_search", - "request": { - "url": "http://localhost:8280/egf-master/recoverys/_search", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "description": "Search fails because no tenantId is provided" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/postman/RecoveryPositive.postman_collection.json b/business-services/egf-master/src/postman/RecoveryPositive.postman_collection.json deleted file mode 100644 index bcb6714a4ce..00000000000 --- a/business-services/egf-master/src/postman/RecoveryPositive.postman_collection.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "variables": [], - "info": { - "name": "RecoveryPositive", - "_postman_id": "931c1f4f-c354-4549-f612-92206b7b95c2", - "description": "", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "http://localhost:8280/egf-master/recoverys/_create", - "request": { - "url": "http://localhost:8280/egf-master/recoverys/_create", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "\n{\n \"requestInfo\": {\n \"resMsgId\": \"placeholder\",\n \"status\": \"200\",\n \"apiId\": null,\n \"ver\": null,\n \"ts\": \"01-01-2017 01:01:01\",\n \"key\": null\n },\n \"recoverys\": [\n {\n \"code\":\"final\",\n \"name\":\"final\",\n \"chartOfAccount\":{\n \"glcode\":\"341\",\n \"tenantId\":\"default\"\n },\n \"active\":true,\n \"type\":\"M\",\n \"flat\":\"100\",\n \"remitted\":\"S\",\n \"ifscCode\":\"SBIN0005532\",\n \"accountNumber\":\"3049223457\",\n \"tenantId\":\"default\",\n \"mode\":\"M\",\n \"remittanceMode\":\"M\"\n }\n \n ]\n}" - }, - "description": "Recovery Create" - }, - "response": [] - }, - { - "name": "http://localhost:8280/egf-master/recoverys/_update", - "request": { - "url": "http://localhost:8280/egf-master/recoverys/_update", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "\n{\n \"requestInfo\": {\n \"resMsgId\": \"placeholder\",\n \"status\": \"200\",\n \"apiId\": null,\n \"ver\": null,\n \"ts\": \"01-01-2017 01:01:01\",\n \"key\": null\n },\n \"recoverys\": [\n {\n \t\"id\":\"2\",\n \"code\":\"final\",\n \"name\":\"final\",\n \"chartOfAccount\":{\n \"glcode\":\"341\",\n \"tenantId\":\"default\"\n },\n \"active\":true,\n \"type\":\"M\",\n \"flat\":\"100\",\n \"remitted\":\"S\",\n \"ifscCode\":\"SBIN0005532U\",\n \"accountNumber\":\"3049223457\",\n \"tenantId\":\"default\",\n \"mode\":\"M\",\n \"remittanceMode\":\"M\"\n }\n \n ]\n}" - }, - "description": "Recovery Update" - }, - "response": [] - }, - { - "name": "http://localhost:8280/egf-master/recoverys/_search", - "request": { - "url": "http://localhost:8280/egf-master/recoverys/_search", - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "description": "" - } - ], - "body": { - "mode": "raw", - "raw": "\n{\n \"requestInfo\": {\n \"resMsgId\": \"placeholder\",\n \"status\": \"200\",\n \"apiId\": null,\n \"ver\": null,\n \"ts\": \"01-01-2017 01:01:01\",\n \"key\": null\n }\n}" - }, - "description": "Recovery Search" - }, - "response": [] - } - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/common/utils/RequestJsonReader.java b/business-services/egf-master/src/test/java/org/egov/common/utils/RequestJsonReader.java deleted file mode 100644 index ff9ac47ac26..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/common/utils/RequestJsonReader.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.egov.common.utils; - -import java.io.IOException; - -import org.apache.commons.io.IOUtils; - -public class RequestJsonReader { - - public String readRequest(String fileName) { - try { - String info=IOUtils.toString(this.getClass().getClassLoader() - .getResourceAsStream("common/request_info.json"), "UTF-8"); - - String data= IOUtils.toString(this.getClass().getClassLoader() - .getResourceAsStream(fileName), "UTF-8"); - return "{\n"+info+","+data+"}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public String readResponse(String fileName) { - try { - String info=IOUtils.toString(this.getClass().getClassLoader() - .getResourceAsStream("common/response_info.json"), "UTF-8"); - - String data= IOUtils.toString(this.getClass().getClassLoader() - .getResourceAsStream(fileName), "UTF-8"); - return "{\n"+info+","+data+"}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public String readErrorResponse(String fileName) { - try { - String info=IOUtils.toString(this.getClass().getClassLoader() - .getResourceAsStream("common/error_info.json"), "UTF-8"); - - String data= IOUtils.toString(this.getClass().getClassLoader() - .getResourceAsStream(fileName), "UTF-8"); - return "{\n"+info+","+data+"}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - public String getRequestInfo() { - try { - String info = IOUtils.toString( - this.getClass().getClassLoader().getResourceAsStream("common/request_info.json"), "UTF-8"); - - return "{\n" + info + "}"; - - } catch (IOException e) { - throw new RuntimeException(e); - } - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/FinancialsApplicationTests.java b/business-services/egf-master/src/test/java/org/egov/egf/FinancialsApplicationTests.java deleted file mode 100644 index 34d8b5a3cf4..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/FinancialsApplicationTests.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.egov.egf; - -import org.egov.egf.master.TestConfiguration; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -@SpringBootTest -@Ignore -public class FinancialsApplicationTests { - - @Test - public void contextLoads() { - } - -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/TestConfiguration.java b/business-services/egf-master/src/test/java/org/egov/egf/master/TestConfiguration.java deleted file mode 100644 index 5e67a0423cf..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/TestConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egf.master; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.kafka.core.KafkaTemplate; - -import static org.mockito.Mockito.mock; - -@Configuration -public class TestConfiguration { - - @Bean - @SuppressWarnings("unchecked") - public KafkaTemplate kafkaTemplate() { - return mock(KafkaTemplate.class); - } - -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountCodePurposeRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountCodePurposeRepositoryTest.java deleted file mode 100644 index a27f10bf691..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountCodePurposeRepositoryTest.java +++ /dev/null @@ -1,266 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountCodePurposeEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountCodePurposeJdbcRepository; -import org.egov.egf.master.web.contract.AccountCodePurposeContract; -import org.egov.egf.master.web.contract.AccountCodePurposeSearchContract; -import org.egov.egf.master.web.requests.AccountCodePurposeRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class AccountCodePurposeRepositoryTest { - - private AccountCodePurposeRepository accountCodePurposeRepositoryWithKafka; - private AccountCodePurposeRepository accountCodePurposeRepositoryWithOutKafka; - - @InjectMocks - private AccountCodePurposeRepository accountCodePurposeRepository; - - @Mock - private AccountCodePurposeJdbcRepository accountCodePurposeJdbcRepository; - - @Mock - private MastersQueueRepository accountCodePurposeQueueRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Mock - private AccountCodePurposeESRepository accountCodePurposeESRepository; - - @Captor - private ArgumentCaptor> captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - accountCodePurposeRepositoryWithKafka = new AccountCodePurposeRepository(accountCodePurposeJdbcRepository, - accountCodePurposeQueueRepository, financialConfigurationService, accountCodePurposeESRepository, - "yes"); - accountCodePurposeRepositoryWithOutKafka = new AccountCodePurposeRepository(accountCodePurposeJdbcRepository, - accountCodePurposeQueueRepository, financialConfigurationService, accountCodePurposeESRepository, "no"); - - } - - @Test - public void testFindById() { - AccountCodePurposeEntity accountCodePurposeEntity = getAccountCodePurposeEntity(); - AccountCodePurpose expectedResult = accountCodePurposeEntity.toDomain(); - when(accountCodePurposeJdbcRepository.findById(any(AccountCodePurposeEntity.class))) - .thenReturn(accountCodePurposeEntity); - AccountCodePurpose actualResult = accountCodePurposeRepository.findById(getAccountCodePurposeDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSave() { - List expectedResult = getAccountCodePurposes(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountCodePurposeRepositoryWithKafka.save(expectedResult, requestInfo); - verify(accountCodePurposeQueueRepository).add(captor.capture()); - } - - @Test - public void testSave1() { - List expectedResult = getAccountCodePurposes(); - AccountCodePurposeEntity entity = new AccountCodePurposeEntity().toEntity(expectedResult.get(0)); - when(accountCodePurposeJdbcRepository.create(any(AccountCodePurposeEntity.class))).thenReturn(entity); - accountCodePurposeRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(accountCodePurposeQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSavee() { - AccountCodePurposeEntity accountCodePurposeEntity = getAccountCodePurposeEntity(); - AccountCodePurpose expectedResult = accountCodePurposeEntity.toDomain(); - when(accountCodePurposeJdbcRepository.create(any(AccountCodePurposeEntity.class))) - .thenReturn(accountCodePurposeEntity); - AccountCodePurpose actualResult = accountCodePurposeRepository.save(getAccountCodePurposeDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testUpdate() { - List expectedResult = getAccountCodePurposes(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountCodePurposeRepositoryWithKafka.update(expectedResult, requestInfo); - verify(accountCodePurposeQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdate1() { - List expectedResult = getAccountCodePurposes(); - AccountCodePurposeEntity entity = new AccountCodePurposeEntity().toEntity(expectedResult.get(0)); - when(accountCodePurposeJdbcRepository.update(any(AccountCodePurposeEntity.class))).thenReturn(entity); - accountCodePurposeRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(accountCodePurposeQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdatee() { - AccountCodePurposeEntity accountCodePurposeEntity = getAccountCodePurposeEntity(); - AccountCodePurpose expectedResult = accountCodePurposeEntity.toDomain(); - when(accountCodePurposeJdbcRepository.update(any(AccountCodePurposeEntity.class))) - .thenReturn(accountCodePurposeEntity); - AccountCodePurpose actualResult = accountCodePurposeRepository.update(getAccountCodePurposeDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(accountCodePurposeQueueRepository).add(Mockito.any()); - AccountCodePurposeRequest request = new AccountCodePurposeRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountCodePurposes(new ArrayList()); - request.getAccountCodePurposes().add(getAccountCodePurposeContract()); - accountCodePurposeRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountcodepurpose_create", request); - Mockito.verify(accountCodePurposeQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(accountCodePurposeQueueRepository).add(Mockito.any()); - AccountCodePurposeRequest request = new AccountCodePurposeRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setAccountCodePurposes(new ArrayList()); - request.getAccountCodePurposes().add(getAccountCodePurposeContract()); - accountCodePurposeRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountcodepurpose_update", request); - Mockito.verify(accountCodePurposeQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(accountCodePurposeQueueRepository).add(Mockito.any()); - AccountCodePurposeRequest request = new AccountCodePurposeRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountCodePurposes(new ArrayList()); - request.getAccountCodePurposes().add(getAccountCodePurposeContract()); - accountCodePurposeRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("accountcodepurpose_persisted", request); - Mockito.verify(accountCodePurposeQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(accountCodePurposeJdbcRepository.search(any(AccountCodePurposeSearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountCodePurposeRepository - .search(getAccountCodePurposeSearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(accountCodePurposeESRepository.search(any(AccountCodePurposeSearchContract.class))) - .thenReturn(expectedResult); - Pagination actualResult = accountCodePurposeRepository - .search(getAccountCodePurposeSearch()); - assertEquals(expectedResult, actualResult); - } - - private AccountCodePurposeContract getAccountCodePurposeContract() { - return AccountCodePurposeContract.builder().name("name").build(); - } - - private AccountCodePurposeEntity getAccountCodePurposeEntity() { - AccountCodePurposeEntity entity = new AccountCodePurposeEntity(); - AccountCodePurpose accountCodePurpose = getAccountCodePurposeDomain(); - entity.setName(accountCodePurpose.getName()); - entity.setTenantId(accountCodePurpose.getTenantId()); - return entity; - } - - private AccountCodePurpose getAccountCodePurposeDomain() { - AccountCodePurpose accountCodePurpose = new AccountCodePurpose(); - accountCodePurpose.setId("1"); - accountCodePurpose.setName("name"); - accountCodePurpose.setTenantId("default"); - return accountCodePurpose; - } - - public List getAccountCodePurposeDomains() { - List accountCodePurposes = new ArrayList<>(); - accountCodePurposes.add(getAccountCodePurposeDomain()); - return accountCodePurposes; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private AccountCodePurposeSearch getAccountCodePurposeSearch() { - AccountCodePurposeSearch accountCodePurposeSearch = new AccountCodePurposeSearch(); - accountCodePurposeSearch.setPageSize(500); - accountCodePurposeSearch.setOffset(0); - accountCodePurposeSearch.setSortBy("name desc"); - return accountCodePurposeSearch; - } - - private List getAccountCodePurposes() { - List accountCodePurposes = new ArrayList(); - AccountCodePurpose accountCodePurpose = AccountCodePurpose.builder().id("1").name("name").build(); - accountCodePurpose.setTenantId("default"); - accountCodePurposes.add(accountCodePurpose); - return accountCodePurposes; - } - - private AccountCodePurposeSearchContract getAccountCodePurposeSearchContract() { - AccountCodePurposeSearchContract accountCodePurposeSearchContract = new AccountCodePurposeSearchContract(); - accountCodePurposeSearchContract.setPageSize(0); - accountCodePurposeSearchContract.setOffset(0); - accountCodePurposeSearchContract.setSortBy("name desc"); - return accountCodePurposeSearchContract; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountDetailKeyRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountDetailKeyRepositoryTest.java deleted file mode 100644 index 9e197b52319..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountDetailKeyRepositoryTest.java +++ /dev/null @@ -1,282 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountDetailKeyEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountDetailKeyJdbcRepository; -import org.egov.egf.master.web.contract.AccountDetailKeyContract; -import org.egov.egf.master.web.contract.AccountDetailKeySearchContract; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.requests.AccountDetailKeyRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class AccountDetailKeyRepositoryTest { - - private AccountDetailKeyRepository accountDetailKeyRepositoryWithKafka; - private AccountDetailKeyRepository accountDetailKeyRepositoryWithOutKafka; - - @InjectMocks - private AccountDetailKeyRepository accountDetailKeyRepository; - - @Mock - private AccountDetailKeyJdbcRepository accountDetailKeyJdbcRepository; - - @Mock - private MastersQueueRepository accountDetailKeyQueueRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Mock - private AccountDetailKeyESRepository accountDetailKeyESRepository; - - @Captor - private ArgumentCaptor> captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - accountDetailKeyRepositoryWithKafka = new AccountDetailKeyRepository(accountDetailKeyJdbcRepository, - accountDetailKeyQueueRepository, financialConfigurationService, accountDetailKeyESRepository, "yes"); - accountDetailKeyRepositoryWithOutKafka = new AccountDetailKeyRepository(accountDetailKeyJdbcRepository, - accountDetailKeyQueueRepository, financialConfigurationService, accountDetailKeyESRepository, "no"); - - } - - @Test - public void testFindById() { - AccountDetailKeyEntity accountDetailKeyEntity = getAccountDetailKeyEntity(); - AccountDetailKey expectedResult = accountDetailKeyEntity.toDomain(); - when(accountDetailKeyJdbcRepository.findById(any(AccountDetailKeyEntity.class))) - .thenReturn(accountDetailKeyEntity); - AccountDetailKey actualResult = accountDetailKeyRepository.findById(getAccountDetailKeyDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSaveWithKafka() { - List expectedResult = getAccountDetailKies(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountDetailKeyRepositoryWithKafka.save(expectedResult, requestInfo); - verify(accountDetailKeyQueueRepository).add(captor.capture()); - } - - @Test - public void testSaveWithOutKafka() { - List expectedResult = getAccountDetailKies(); - AccountDetailKeyEntity entity = new AccountDetailKeyEntity().toEntity(expectedResult.get(0)); - when(accountDetailKeyJdbcRepository.create(any(AccountDetailKeyEntity.class))).thenReturn(entity); - accountDetailKeyRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(accountDetailKeyQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSave() { - AccountDetailKeyEntity accountDetailKeyEntity = getAccountDetailKeyEntity(); - AccountDetailKey expectedResult = accountDetailKeyEntity.toDomain(); - when(accountDetailKeyJdbcRepository.create(any(AccountDetailKeyEntity.class))) - .thenReturn(accountDetailKeyEntity); - AccountDetailKey actualResult = accountDetailKeyRepository.save(getAccountDetailKeyDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testUpdateWithKafka() { - List expectedResult = getAccountDetailKies(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountDetailKeyRepositoryWithKafka.update(expectedResult, requestInfo); - verify(accountDetailKeyQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdateWithOutKafka() { - List expectedResult = getAccountDetailKies(); - AccountDetailKeyEntity entity = new AccountDetailKeyEntity().toEntity(expectedResult.get(0)); - when(accountDetailKeyJdbcRepository.update(any(AccountDetailKeyEntity.class))).thenReturn(entity); - accountDetailKeyRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(accountDetailKeyQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdate() { - AccountDetailKeyEntity accountDetailKeyEntity = getAccountDetailKeyEntity(); - AccountDetailKey expectedResult = accountDetailKeyEntity.toDomain(); - when(accountDetailKeyJdbcRepository.update(any(AccountDetailKeyEntity.class))) - .thenReturn(accountDetailKeyEntity); - AccountDetailKey actualResult = accountDetailKeyRepository.update(getAccountDetailKeyDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(accountDetailKeyQueueRepository).add(Mockito.any()); - AccountDetailKeyRequest request = new AccountDetailKeyRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountDetailKeys(new ArrayList()); - request.getAccountDetailKeys().add(getAccountDetailKeyContract()); - accountDetailKeyRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountdetailkey_create", request); - Mockito.verify(accountDetailKeyQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(accountDetailKeyQueueRepository).add(Mockito.any()); - AccountDetailKeyRequest request = new AccountDetailKeyRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setAccountDetailKeys(new ArrayList()); - request.getAccountDetailKeys().add(getAccountDetailKeyContract()); - accountDetailKeyRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountdetailkey_update", request); - Mockito.verify(accountDetailKeyQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(accountDetailKeyQueueRepository).add(Mockito.any()); - AccountDetailKeyRequest request = new AccountDetailKeyRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountDetailKeys(new ArrayList()); - request.getAccountDetailKeys().add(getAccountDetailKeyContract()); - accountDetailKeyRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("accountdetailkey_persisted", request); - Mockito.verify(accountDetailKeyQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(accountDetailKeyJdbcRepository.search(any(AccountDetailKeySearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountDetailKeyRepository.search(getAccountDetailKeySearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(accountDetailKeyESRepository.search(any(AccountDetailKeySearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = accountDetailKeyRepository.search(getAccountDetailKeySearch()); - assertEquals(expectedResult, actualResult); - } - - private AccountDetailKeyContract getAccountDetailKeyContract() { - return AccountDetailKeyContract.builder().id("1").key("1").accountDetailType(getAccountDetailTypeContract()) - .build(); - } - - private AccountDetailKeyEntity getAccountDetailKeyEntity() { - AccountDetailKeyEntity entity = new AccountDetailKeyEntity(); - AccountDetailKey accountDetailKey = getAccountDetailKeyDomain(); - entity.setKey(accountDetailKey.getKey()); - entity.setAccountDetailTypeId(accountDetailKey.getAccountDetailType().getId()); - entity.setTenantId(accountDetailKey.getTenantId()); - return entity; - } - - private AccountDetailKey getAccountDetailKeyDomain() { - AccountDetailKey accountDetailKey = new AccountDetailKey(); - accountDetailKey.setId("1"); - accountDetailKey.setKey("1"); - accountDetailKey.setAccountDetailType(getAccountDetailType()); - accountDetailKey.setTenantId("default"); - return accountDetailKey; - } - - public List getAccountDetailKeyDomains() { - List accountDetailKies = new ArrayList<>(); - accountDetailKies.add(getAccountDetailKeyDomain()); - return accountDetailKies; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private AccountDetailKeySearch getAccountDetailKeySearch() { - AccountDetailKeySearch accountDetailKeySearch = new AccountDetailKeySearch(); - accountDetailKeySearch.setPageSize(500); - accountDetailKeySearch.setOffset(0); - accountDetailKeySearch.setSortBy("name desc"); - return accountDetailKeySearch; - } - - private List getAccountDetailKies() { - List accountDetailKies = new ArrayList(); - AccountDetailKey accountDetailKey = AccountDetailKey.builder().id("1").key("1") - .accountDetailType(getAccountDetailType()).build(); - accountDetailKey.setTenantId("default"); - accountDetailKies.add(accountDetailKey); - return accountDetailKies; - } - - private AccountDetailKeySearchContract getAccountDetailKeySearchContract() { - AccountDetailKeySearchContract accountDetailKeySearchContract = new AccountDetailKeySearchContract(); - accountDetailKeySearchContract.setPageSize(0); - accountDetailKeySearchContract.setOffset(0); - accountDetailKeySearchContract.setSortBy("name desc"); - return accountDetailKeySearchContract; - } - - private AccountDetailTypeContract getAccountDetailTypeContract() { - AccountDetailTypeContract accountDetailType = AccountDetailTypeContract.builder().id("1").name("name") - .tableName("contractor").fullyQualifiedName("abc/acb").active(true).build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - - private AccountDetailType getAccountDetailType() { - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("contractor") - .fullyQualifiedName("abc/acb").active(true).build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountDetailTypeRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountDetailTypeRepositoryTest.java deleted file mode 100644 index 618b5355b56..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountDetailTypeRepositoryTest.java +++ /dev/null @@ -1,271 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountDetailTypeEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountDetailTypeJdbcRepository; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.contract.AccountDetailTypeSearchContract; -import org.egov.egf.master.web.requests.AccountDetailTypeRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class AccountDetailTypeRepositoryTest { - - private AccountDetailTypeRepository accountDetailTypeRepositoryWithKafka; - private AccountDetailTypeRepository accountDetailTypeRepositoryWithOutKafka; - - @InjectMocks - private AccountDetailTypeRepository accountDetailTypeRepository; - - @Mock - private AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository; - - @Mock - private MastersQueueRepository accountDetailTypeQueueRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Mock - private AccountDetailTypeESRepository accountDetailTypeESRepository; - - @Captor - private ArgumentCaptor> captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - accountDetailTypeRepositoryWithKafka = new AccountDetailTypeRepository(accountDetailTypeJdbcRepository, - accountDetailTypeQueueRepository, financialConfigurationService, accountDetailTypeESRepository, "yes"); - accountDetailTypeRepositoryWithOutKafka = new AccountDetailTypeRepository(accountDetailTypeJdbcRepository, - accountDetailTypeQueueRepository, financialConfigurationService, accountDetailTypeESRepository, "no"); - - } - - @Test - public void testFindById() { - AccountDetailTypeEntity accountDetailTypeEntity = getAccountDetailTypeEntity(); - AccountDetailType expectedResult = accountDetailTypeEntity.toDomain(); - when(accountDetailTypeJdbcRepository.findById(any(AccountDetailTypeEntity.class))) - .thenReturn(accountDetailTypeEntity); - AccountDetailType actualResult = accountDetailTypeRepository.findById(getAccountDetailTypeDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testSaveWithKafka() { - List expectedResult = getAccountDetailTypes(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountDetailTypeRepositoryWithKafka.save(expectedResult, requestInfo); - verify(accountDetailTypeQueueRepository).add(captor.capture()); - } - - @Test - public void testSaveWithOutKafka() { - List expectedResult = getAccountDetailTypes(); - AccountDetailTypeEntity entity = new AccountDetailTypeEntity().toEntity(expectedResult.get(0)); - when(accountDetailTypeJdbcRepository.create(any(AccountDetailTypeEntity.class))).thenReturn(entity); - accountDetailTypeRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(accountDetailTypeQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSave() { - AccountDetailTypeEntity accountDetailTypeEntity = getAccountDetailTypeEntity(); - AccountDetailType expectedResult = accountDetailTypeEntity.toDomain(); - when(accountDetailTypeJdbcRepository.create(any(AccountDetailTypeEntity.class))) - .thenReturn(accountDetailTypeEntity); - AccountDetailType actualResult = accountDetailTypeRepository.save(getAccountDetailTypeDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testUpdateWithKafka() { - List expectedResult = getAccountDetailTypes(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountDetailTypeRepositoryWithKafka.update(expectedResult, requestInfo); - verify(accountDetailTypeQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdateWithOutKafka() { - List expectedResult = getAccountDetailTypes(); - AccountDetailTypeEntity entity = new AccountDetailTypeEntity().toEntity(expectedResult.get(0)); - when(accountDetailTypeJdbcRepository.update(any(AccountDetailTypeEntity.class))).thenReturn(entity); - accountDetailTypeRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(accountDetailTypeQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdate() { - AccountDetailTypeEntity accountDetailTypeEntity = getAccountDetailTypeEntity(); - AccountDetailType expectedResult = accountDetailTypeEntity.toDomain(); - when(accountDetailTypeJdbcRepository.update(any(AccountDetailTypeEntity.class))) - .thenReturn(accountDetailTypeEntity); - AccountDetailType actualResult = accountDetailTypeRepository.update(getAccountDetailTypeDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(accountDetailTypeQueueRepository).add(Mockito.any()); - AccountDetailTypeRequest request = new AccountDetailTypeRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountDetailTypes(new ArrayList()); - request.getAccountDetailTypes().add(getAccountDetailTypeContract()); - accountDetailTypeRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountdetailtype_create", request); - Mockito.verify(accountDetailTypeQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(accountDetailTypeQueueRepository).add(Mockito.any()); - AccountDetailTypeRequest request = new AccountDetailTypeRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setAccountDetailTypes(new ArrayList()); - request.getAccountDetailTypes().add(getAccountDetailTypeContract()); - accountDetailTypeRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountdetailtype_update", request); - Mockito.verify(accountDetailTypeQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(accountDetailTypeQueueRepository).add(Mockito.any()); - AccountDetailTypeRequest request = new AccountDetailTypeRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountDetailTypes(new ArrayList()); - request.getAccountDetailTypes().add(getAccountDetailTypeContract()); - accountDetailTypeRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("accountdetailtype_persisted", request); - Mockito.verify(accountDetailTypeQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(accountDetailTypeJdbcRepository.search(any(AccountDetailTypeSearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountDetailTypeRepository.search(getAccountDetailTypeSearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(accountDetailTypeESRepository.search(any(AccountDetailTypeSearchContract.class))) - .thenReturn(expectedResult); - Pagination actualResult = accountDetailTypeRepository.search(getAccountDetailTypeSearch()); - assertEquals(expectedResult, actualResult); - } - - private AccountDetailTypeContract getAccountDetailTypeContract() { - return AccountDetailTypeContract.builder().tableName("contractor").fullyQualifiedName("abc/contractor") - .name("name").active(true).build(); - } - - private AccountDetailTypeEntity getAccountDetailTypeEntity() { - AccountDetailTypeEntity entity = new AccountDetailTypeEntity(); - AccountDetailType accountDetailType = getAccountDetailTypeDomain(); - entity.setTablename(accountDetailType.getTableName()); - entity.setName(accountDetailType.getName()); - entity.setActive(accountDetailType.getActive()); - entity.setFullyQualifiedName(accountDetailType.getFullyQualifiedName()); - entity.setTenantId(accountDetailType.getTenantId()); - return entity; - } - - private AccountDetailType getAccountDetailTypeDomain() { - AccountDetailType accountDetailType = new AccountDetailType(); - accountDetailType.setId("1"); - accountDetailType.setTableName("contractor"); - accountDetailType.setName("name"); - accountDetailType.setActive(true); - accountDetailType.setFullyQualifiedName("abc/contractor"); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - - public List getAccountDetailTypeDomains() { - List accountDetailTypes = new ArrayList<>(); - accountDetailTypes.add(getAccountDetailTypeDomain()); - return accountDetailTypes; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private AccountDetailTypeSearch getAccountDetailTypeSearch() { - AccountDetailTypeSearch accountDetailTypeSearch = new AccountDetailTypeSearch(); - accountDetailTypeSearch.setPageSize(500); - accountDetailTypeSearch.setOffset(0); - accountDetailTypeSearch.setSortBy("name desc"); - return accountDetailTypeSearch; - } - - private List getAccountDetailTypes() { - List accountDetailTypes = new ArrayList(); - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("contractor") - .fullyQualifiedName("abc/contractor").active(true).build(); - accountDetailType.setTenantId("default"); - accountDetailTypes.add(accountDetailType); - return accountDetailTypes; - } - - private AccountDetailTypeSearchContract getAccountDetailTypeSearchContract() { - AccountDetailTypeSearchContract accountDetailTypeSearchContract = new AccountDetailTypeSearchContract(); - accountDetailTypeSearchContract.setPageSize(0); - accountDetailTypeSearchContract.setOffset(0); - accountDetailTypeSearchContract.setSortBy("name desc"); - return accountDetailTypeSearchContract; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountEntityRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountEntityRepositoryTest.java deleted file mode 100644 index 13a9e97b1b5..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/AccountEntityRepositoryTest.java +++ /dev/null @@ -1,270 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.AccountEntityEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.AccountEntityJdbcRepository; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.contract.AccountEntityContract; -import org.egov.egf.master.web.contract.AccountEntitySearchContract; -import org.egov.egf.master.web.requests.AccountEntityRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.*; -import org.mockito.runners.MockitoJUnitRunner; - -import java.util.*; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class AccountEntityRepositoryTest { - - private AccountEntityRepository accountEntityRepositoryWithKafka; - private AccountEntityRepository accountEntityRepositoryWithOutKafka; - - @InjectMocks - private AccountEntityRepository accountEntityRepository; - - @Mock - private AccountEntityJdbcRepository accountEntityJdbcRepository; - - @Mock - private MastersQueueRepository accountEntityQueueRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Mock - private AccountEntityESRepository accountEntityESRepository; - - @Captor - private ArgumentCaptor> captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - accountEntityRepositoryWithKafka = new AccountEntityRepository(accountEntityJdbcRepository, accountEntityQueueRepository, - financialConfigurationService, accountEntityESRepository, "yes"); - accountEntityRepositoryWithOutKafka = new AccountEntityRepository(accountEntityJdbcRepository, accountEntityQueueRepository, - financialConfigurationService, accountEntityESRepository, "no"); - - } - - @Test - public void testFindById() { - AccountEntityEntity accountEntityEntity = getAccountEntityEntity(); - AccountEntity expectedResult = accountEntityEntity.toDomain(); - when(accountEntityJdbcRepository.findById(any(AccountEntityEntity.class))).thenReturn(accountEntityEntity); - AccountEntity actualResult = accountEntityRepository.findById(getAccountEntityDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSaveWithKafka() { - List expectedResult = getAccountEntitys(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountEntityRepositoryWithKafka.save(expectedResult, requestInfo); - verify(accountEntityQueueRepository).add(captor.capture()); - } - - @Test - public void testSaveWithOutKafka() { - List expectedResult = getAccountEntitys(); - AccountEntityEntity entity = new AccountEntityEntity().toEntity(expectedResult.get(0)); - when(accountEntityJdbcRepository.create(any(AccountEntityEntity.class))).thenReturn(entity); - accountEntityRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(accountEntityQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSave() { - AccountEntityEntity accountEntityEntity = getAccountEntityEntity(); - AccountEntity expectedResult = accountEntityEntity.toDomain(); - when(accountEntityJdbcRepository.create(any(AccountEntityEntity.class))).thenReturn(accountEntityEntity); - AccountEntity actualResult = accountEntityRepository.save(getAccountEntityDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testUpdateWithKafka() { - List expectedResult = getAccountEntitys(); - requestInfo.setAction(Constants.ACTION_CREATE); - accountEntityRepositoryWithKafka.update(expectedResult, requestInfo); - verify(accountEntityQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdateWithOutKafka() { - List expectedResult = getAccountEntitys(); - AccountEntityEntity entity = new AccountEntityEntity().toEntity(expectedResult.get(0)); - when(accountEntityJdbcRepository.update(any(AccountEntityEntity.class))).thenReturn(entity); - accountEntityRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(accountEntityQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdate() { - AccountEntityEntity accountEntityEntity = getAccountEntityEntity(); - AccountEntity expectedResult = accountEntityEntity.toDomain(); - when(accountEntityJdbcRepository.update(any(AccountEntityEntity.class))).thenReturn(accountEntityEntity); - AccountEntity actualResult = accountEntityRepository.update(getAccountEntityDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(accountEntityQueueRepository).add(Mockito.any()); - AccountEntityRequest request = new AccountEntityRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountEntities(new ArrayList()); - request.getAccountEntities().add(getAccountEntityContract()); - accountEntityRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountentity_create", request); - Mockito.verify(accountEntityQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(accountEntityQueueRepository).add(Mockito.any()); - AccountEntityRequest request = new AccountEntityRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setAccountEntities(new ArrayList()); - request.getAccountEntities().add(getAccountEntityContract()); - accountEntityRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("accountentity_update", request); - Mockito.verify(accountEntityQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(accountEntityQueueRepository).add(Mockito.any()); - AccountEntityRequest request = new AccountEntityRequest(); - request.setRequestInfo(getRequestInfo()); - request.setAccountEntities(new ArrayList()); - request.getAccountEntities().add(getAccountEntityContract()); - accountEntityRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("accountentity_persisted", request); - Mockito.verify(accountEntityQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(accountEntityJdbcRepository.search(any(AccountEntitySearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountEntityRepository.search(getAccountEntitySearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(accountEntityESRepository.search(any(AccountEntitySearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = accountEntityRepository.search(getAccountEntitySearch()); - assertEquals(expectedResult, actualResult); - } - - private AccountEntityContract getAccountEntityContract() { - AccountDetailTypeContract accountDetailTypeContract = AccountDetailTypeContract.builder().id("1"). - name("name").tableName("table") - .fullyQualifiedName("abc/table").build(); - return AccountEntityContract.builder().code("code").name("name").active(true).accountDetailType(accountDetailTypeContract).build(); - } - - private AccountEntityEntity getAccountEntityEntity() { - AccountEntityEntity entity = new AccountEntityEntity(); - AccountEntity accountEntity = getAccountEntityDomain(); - entity.setCode(accountEntity.getCode()); - entity.setName(accountEntity.getName()); - entity.setActive(accountEntity.getActive()); - entity.setAccountDetailTypeId(accountEntity.getAccountDetailType().getId()); - entity.setTenantId(accountEntity.getTenantId()); - return entity; - } - - private AccountEntity getAccountEntityDomain() { - AccountEntity accountEntity = new AccountEntity(); - accountEntity.setId("1"); - accountEntity.setCode("code"); - accountEntity.setName("name"); - accountEntity.setActive(true); - accountEntity.setAccountDetailType(getAccountDetaialType()); - accountEntity.setTenantId("default"); - return accountEntity; - } - - public List getAccountEntityDomains() { - List accountEntities = new ArrayList<>(); - accountEntities.add(getAccountEntityDomain()); - return accountEntities; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private AccountEntitySearch getAccountEntitySearch() { - AccountEntitySearch accountEntitySearch = new AccountEntitySearch(); - accountEntitySearch.setPageSize(500); - accountEntitySearch.setOffset(0); - accountEntitySearch.setSortBy("name desc"); - return accountEntitySearch; - } - - private List getAccountEntitys() { - List accountEntities = new ArrayList<>(); - AccountEntity accountEntity = AccountEntity.builder().id("1").name("name").code("code").accountDetailType(getAccountDetaialType()).active(true).build(); - accountEntity.setTenantId("default"); - accountEntities.add(accountEntity); - return accountEntities; - } - - private AccountEntitySearchContract getAccountEntitySearchContract() { - AccountEntitySearchContract accountEntitySearchContract = new AccountEntitySearchContract(); - accountEntitySearchContract.setPageSize(0); - accountEntitySearchContract.setOffset(0); - accountEntitySearchContract.setSortBy("name desc"); - return accountEntitySearchContract; - } - - private AccountDetailType getAccountDetaialType() { - - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("table") - .fullyQualifiedName("abc/table").build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankAccountRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankAccountRepositoryTest.java deleted file mode 100644 index 4b8d75e3884..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankAccountRepositoryTest.java +++ /dev/null @@ -1,252 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.enums.BankAccountType; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.BankAccountEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.BankAccountJdbcRepository; -import org.egov.egf.master.web.contract.BankAccountContract; -import org.egov.egf.master.web.contract.BankAccountSearchContract; -import org.egov.egf.master.web.contract.enums.BankAccountTypeContract; -import org.egov.egf.master.web.requests.BankAccountRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class BankAccountRepositoryTest { - - @Mock - private BankAccountJdbcRepository bankAccountJdbcRepository; - - @Mock - private MastersQueueRepository bankAccountQueueRepository; - - @InjectMocks - private BankAccountRepository bankAccountRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - private RequestInfo requestInfo = new RequestInfo(); - @Captor - private ArgumentCaptor> captor; - - private BankAccountRepository bankAccountRepositoryWithKafka; - - private BankAccountRepository bankAccountRepositoryWithOutKafka; - - @Mock - private BankAccountESRepository bankAccountESRepository; - - @Before - public void setup() { - bankAccountRepositoryWithKafka = new BankAccountRepository(bankAccountJdbcRepository, - bankAccountQueueRepository, financialConfigurationService, bankAccountESRepository, "yes"); - bankAccountRepositoryWithOutKafka = new BankAccountRepository(bankAccountJdbcRepository, - bankAccountQueueRepository, financialConfigurationService, bankAccountESRepository, "no"); - - } - - @Test - public void testFindById() { - BankAccountEntity bankAccountEntity = getBankAccountEntity(); - BankAccount expectedResult = bankAccountEntity.toDomain(); - when(bankAccountJdbcRepository.findById(any(BankAccountEntity.class))).thenReturn(bankAccountEntity); - BankAccount actualResult = bankAccountRepository.findById(getBankAccountDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testSaveWithKafka() { - List expectedResult = new ArrayList<>(); - expectedResult.add(getBankAccountDomain()); - requestInfo.setAction(Constants.ACTION_CREATE); - bankAccountRepositoryWithKafka.save(expectedResult, requestInfo); - verify(bankAccountQueueRepository).add(captor.capture()); - } - - @Test - public void testSaveWithOutKafka() { - List expectedResult = new ArrayList<>(); - expectedResult.add(getBankAccountDomain()); - BankAccountEntity entity = new BankAccountEntity().toEntity(expectedResult.get(0)); - when(bankAccountJdbcRepository.create(any(BankAccountEntity.class))).thenReturn(entity); - bankAccountRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(bankAccountQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSave() { - BankAccountEntity bankAccountEntity = getBankAccountEntity(); - BankAccount expectedResult = bankAccountEntity.toDomain(); - when(bankAccountJdbcRepository.create(any(BankAccountEntity.class))).thenReturn(bankAccountEntity); - BankAccount actualResult = bankAccountRepository.save(getBankAccountDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testUpdateWithKafka() { - List expectedResult = new ArrayList<>(); - expectedResult.add(getBankAccountDomain()); - requestInfo.setAction(Constants.ACTION_CREATE); - bankAccountRepositoryWithKafka.update(expectedResult, requestInfo); - verify(bankAccountQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdateWithOutKafka() { - List expectedResult = new ArrayList<>(); - expectedResult.add(getBankAccountDomain()); - BankAccountEntity entity = new BankAccountEntity().toEntity(expectedResult.get(0)); - when(bankAccountJdbcRepository.update(any(BankAccountEntity.class))).thenReturn(entity); - bankAccountRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(bankAccountQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdate() { - BankAccountEntity bankAccountEntity = getBankAccountEntity(); - BankAccount expectedResult = bankAccountEntity.toDomain(); - when(bankAccountJdbcRepository.update(any(BankAccountEntity.class))).thenReturn(bankAccountEntity); - BankAccount actualResult = bankAccountRepository.update(bankAccountEntity.toDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(bankAccountQueueRepository).add(Mockito.any()); - BankAccountRequest request = new BankAccountRequest(); - request.setRequestInfo(getRequestInfo()); - request.setBankAccounts(new ArrayList()); - request.getBankAccounts().add(getBankAccountContract()); - bankAccountRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("bankaccount_create", request); - Mockito.verify(bankAccountQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(bankAccountQueueRepository).add(Mockito.any()); - BankAccountRequest request = new BankAccountRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setBankAccounts(new ArrayList()); - request.getBankAccounts().add(getBankAccountContract()); - bankAccountRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("bankaccount_update", request); - Mockito.verify(bankAccountQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(bankAccountQueueRepository).add(Mockito.any()); - BankAccountRequest request = new BankAccountRequest(); - request.setRequestInfo(getRequestInfo()); - request.setBankAccounts(new ArrayList()); - request.getBankAccounts().add(getBankAccountContract()); - bankAccountRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("bankaccount_persisted", request); - Mockito.verify(bankAccountQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(bankAccountJdbcRepository.search(any(BankAccountSearch.class))).thenReturn(expectedResult); - Pagination actualResult = bankAccountRepository.search(getBankAccountSearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(bankAccountESRepository.search(any(BankAccountSearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = bankAccountRepository.search(getBankAccountSearch()); - assertEquals(expectedResult, actualResult); - } - - private BankAccountEntity getBankAccountEntity() { - BankAccountEntity bankAccountEntity = new BankAccountEntity(); - BankAccount bankAccount = getBankAccountDomain(); - bankAccountEntity.setId(bankAccount.getId()); - bankAccountEntity.setDescription(bankAccount.getDescription()); - bankAccountEntity.setActive(bankAccount.getActive()); - bankAccountEntity.setTenantId(bankAccount.getTenantId()); - bankAccountEntity.setType(bankAccount.getType().toString()); - return bankAccountEntity; - } - - private BankAccount getBankAccountDomain() { - BankAccount bankAccount = new BankAccount(); - bankAccount.setId("1"); - bankAccount.setDescription("description"); - bankAccount.setActive(true); - bankAccount.setTenantId("default"); - bankAccount.setType(BankAccountType.PAYMENTS); - return bankAccount; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private BankAccountContract getBankAccountContract() { - BankAccountContract bankAccountContract = BankAccountContract.builder().id("1").description("description") - .active(true).type(BankAccountTypeContract.PAYMENTS).build(); - bankAccountContract.setTenantId("default"); - return bankAccountContract; - } - - private BankAccountSearch getBankAccountSearch() { - BankAccountSearch bankAccountSearch = new BankAccountSearch(); - bankAccountSearch.setPageSize(500); - bankAccountSearch.setOffset(0); - bankAccountSearch.setSortBy("name desc"); - return bankAccountSearch; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankBranchRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankBranchRepositoryTest.java deleted file mode 100644 index e2ead1b28bb..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankBranchRepositoryTest.java +++ /dev/null @@ -1,259 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.BankBranchEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.BankBranchJdbcRepository; -import org.egov.egf.master.web.contract.BankBranchContract; -import org.egov.egf.master.web.contract.BankBranchSearchContract; -import org.egov.egf.master.web.requests.BankBranchRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class BankBranchRepositoryTest { - - @Mock - private BankBranchJdbcRepository bankBranchJdbcRepository; - - @Mock - private MastersQueueRepository bankBranchQueueRepository; - - @InjectMocks - private BankBranchRepository bankBranchRepository; - - private BankBranchRepository bankBranchRepositoryWithKafka; - - private BankBranchRepository bankBranchRepositoryWithOutKafka; - - @Mock - private FinancialConfigurationService financialConfigurationService; - @Mock - private BankBranchESRepository bankBranchESRepository; - - private RequestInfo requestInfo = new RequestInfo(); - @Captor - private ArgumentCaptor> captor; - - @Before - public void setup() { - bankBranchRepositoryWithKafka = new BankBranchRepository(bankBranchJdbcRepository, bankBranchQueueRepository, - financialConfigurationService, bankBranchESRepository, "yes"); - bankBranchRepositoryWithOutKafka = new BankBranchRepository(bankBranchJdbcRepository, bankBranchQueueRepository, - financialConfigurationService, bankBranchESRepository, "no"); - - } - - @Test - public void testFindById() { - BankBranchEntity bankBranchEntity = getBankBranchEntity(); - BankBranch expectedResult = bankBranchEntity.toDomain(); - when(bankBranchJdbcRepository.findById(any(BankBranchEntity.class))).thenReturn(bankBranchEntity); - BankBranch actualResult = bankBranchRepository.findById(getBankBranchDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testSaveWithKafka() { - List expectedResult = getBankBranches(); - requestInfo.setAction(Constants.ACTION_CREATE); - bankBranchRepositoryWithKafka.save(expectedResult, requestInfo); - verify(bankBranchQueueRepository).add(captor.capture()); - } - - @Test - public void testSaveWithOutKafka() { - List expectedResult = getBankBranches(); - BankBranchEntity entity = new BankBranchEntity().toEntity(expectedResult.get(0)); - when(bankBranchJdbcRepository.create(any(BankBranchEntity.class))).thenReturn(entity); - bankBranchRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(bankBranchQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSave() { - BankBranchEntity bankBranchEntity = getBankBranchEntity(); - BankBranch expectedResult = bankBranchEntity.toDomain(); - when(bankBranchJdbcRepository.create(any(BankBranchEntity.class))).thenReturn(bankBranchEntity); - BankBranch actualResult = bankBranchRepository.save(getBankBranchDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testUpdateWithKafka() { - List expectedResult = getBankBranches(); - requestInfo.setAction(Constants.ACTION_CREATE); - bankBranchRepositoryWithKafka.update(expectedResult, requestInfo); - verify(bankBranchQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdateWithOutKafka() { - List expectedResult = getBankBranches(); - BankBranchEntity entity = new BankBranchEntity().toEntity(expectedResult.get(0)); - when(bankBranchJdbcRepository.update(any(BankBranchEntity.class))).thenReturn(entity); - bankBranchRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(bankBranchQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdate() { - BankBranchEntity bankBranchEntity = getBankBranchEntity(); - BankBranch expectedResult = bankBranchEntity.toDomain(); - when(bankBranchJdbcRepository.update(any(BankBranchEntity.class))).thenReturn(bankBranchEntity); - BankBranch actualResult = bankBranchRepository.update(bankBranchEntity.toDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(bankBranchQueueRepository).add(Mockito.any()); - BankBranchRequest request = new BankBranchRequest(); - request.setRequestInfo(getRequestInfo()); - request.setBankBranches(new ArrayList()); - request.getBankBranches().add(getBankBranchContract()); - bankBranchRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("bankbranch_create", request); - Mockito.verify(bankBranchQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(bankBranchQueueRepository).add(Mockito.any()); - BankBranchRequest request = new BankBranchRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setBankBranches(new ArrayList()); - request.getBankBranches().add(getBankBranchContract()); - bankBranchRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("bankbranch_update", request); - Mockito.verify(bankBranchQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(bankBranchQueueRepository).add(Mockito.any()); - BankBranchRequest request = new BankBranchRequest(); - request.setRequestInfo(getRequestInfo()); - request.setBankBranches(new ArrayList()); - request.getBankBranches().add(getBankBranchContract()); - bankBranchRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("bankbranch_persisted", request); - Mockito.verify(bankBranchQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(bankBranchJdbcRepository.search(any(BankBranchSearch.class))).thenReturn(expectedResult); - Pagination actualResult = bankBranchRepository.search(getBankBranchSearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(bankBranchESRepository.search(any(BankBranchSearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = bankBranchRepository.search(getBankBranchSearch()); - assertEquals(expectedResult, actualResult); - } - - private BankBranchContract getBankBranchContract() { - return BankBranchContract.builder().code("code").name("name").active(true).build(); - } - - private BankBranchEntity getBankBranchEntity() { - BankBranchEntity entity = new BankBranchEntity(); - BankBranch bankBranch = getBankBranchDomain(); - entity.setId(bankBranch.getId()); - entity.setCode(bankBranch.getCode()); - entity.setName(bankBranch.getName()); - entity.setActive(bankBranch.getActive()); - entity.setDescription(bankBranch.getDescription()); - entity.setTenantId(bankBranch.getTenantId()); - return entity; - } - - private BankBranch getBankBranchDomain() { - BankBranch bankBranch = new BankBranch(); - bankBranch.setId("1"); - bankBranch.setCode("code"); - bankBranch.setName("name"); - bankBranch.setActive(true); - bankBranch.setDescription("description"); - bankBranch.setTenantId("default"); - return bankBranch; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private BankBranchSearch getBankBranchSearch() { - BankBranchSearch bankBranchSearch = new BankBranchSearch(); - bankBranchSearch.setPageSize(500); - bankBranchSearch.setOffset(0); - bankBranchSearch.setSortBy("name desc"); - return bankBranchSearch; - } - - private List getBankBranches() { - List bankBranches = new ArrayList(); - BankBranch bankBranch = BankBranch.builder().id("1").name("name").code("code").active(true).build(); - bankBranch.setTenantId("default"); - bankBranches.add(bankBranch); - return bankBranches; - } - - private BankBranchSearchContract getBankBranchSearchContract() { - BankBranchSearchContract bankBranchSearchContract = new BankBranchSearchContract(); - bankBranchSearchContract.setPageSize(0); - bankBranchSearchContract.setOffset(0); - bankBranchSearchContract.setSortBy("name desc"); - return bankBranchSearchContract; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankRepositoryTest.java deleted file mode 100644 index 90a7a621b4a..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/BankRepositoryTest.java +++ /dev/null @@ -1,261 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.BankEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.BankJdbcRepository; -import org.egov.egf.master.web.contract.BankContract; -import org.egov.egf.master.web.contract.BankSearchContract; -import org.egov.egf.master.web.requests.BankRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class BankRepositoryTest { - - @Mock - private BankJdbcRepository bankJdbcRepository; - - @Mock - private MastersQueueRepository bankQueueRepository; - - @InjectMocks - private BankRepository bankRepository; - - private BankRepository bankRepositoryWithKafka; - - private BankRepository bankRepositoryWithOutKafka; - - @Mock - private BankESRepository bankESRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - private RequestInfo requestInfo = new RequestInfo(); - - @Captor - private ArgumentCaptor> captor; - - @Before - public void setup() { - bankRepositoryWithKafka = new BankRepository(bankJdbcRepository, bankQueueRepository, - financialConfigurationService, bankESRepository, "yes"); - bankRepositoryWithOutKafka = new BankRepository(bankJdbcRepository, bankQueueRepository, - financialConfigurationService, bankESRepository, "no"); - - } - - @Test - public void testFindById() { - BankEntity bankEntity = getBankEntity(); - Bank expectedResult = bankEntity.toDomain(); - when(bankJdbcRepository.findById(any(BankEntity.class))).thenReturn(bankEntity); - Bank actualResult = bankRepository.findById(getBankDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testSaveWithKafka() { - List expectedResult = getBanks(); - requestInfo.setAction(Constants.ACTION_CREATE); - bankRepositoryWithKafka.save(expectedResult, requestInfo); - verify(bankQueueRepository).add(captor.capture()); - } - - @Test - public void testSaveWithOutKafka() { - List expectedResult = getBanks(); - BankEntity entity = new BankEntity().toEntity(expectedResult.get(0)); - when(bankJdbcRepository.create(any(BankEntity.class))).thenReturn(entity); - bankRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(bankQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSave() { - BankEntity bankEntity = getBankEntity(); - Bank expectedResult = bankEntity.toDomain(); - when(bankJdbcRepository.create(any(BankEntity.class))).thenReturn(bankEntity); - Bank actualResult = bankRepository.save(getBankDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testUpdateWithKafka() { - List expectedResult = getBanks(); - requestInfo.setAction(Constants.ACTION_CREATE); - bankRepositoryWithKafka.update(expectedResult, requestInfo); - verify(bankQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdateWithOutKafka() { - List expectedResult = getBanks(); - BankEntity entity = new BankEntity().toEntity(expectedResult.get(0)); - when(bankJdbcRepository.update(any(BankEntity.class))).thenReturn(entity); - bankRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(bankQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdate() { - BankEntity bankEntity = getBankEntity(); - Bank expectedResult = bankEntity.toDomain(); - when(bankJdbcRepository.update(any(BankEntity.class))).thenReturn(bankEntity); - Bank actualResult = bankRepository.update(bankEntity.toDomain()); - assertEquals(expectedResult.getId(), actualResult.getId()); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(bankQueueRepository).add(Mockito.any()); - BankRequest request = new BankRequest(); - request.setRequestInfo(getRequestInfo()); - request.setBanks(new ArrayList()); - request.getBanks().add(getBankContract()); - bankRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("bank_create", request); - Mockito.verify(bankQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(bankQueueRepository).add(Mockito.any()); - BankRequest request = new BankRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setBanks(new ArrayList()); - request.getBanks().add(getBankContract()); - bankRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("bank_update", request); - Mockito.verify(bankQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(bankQueueRepository).add(Mockito.any()); - BankRequest request = new BankRequest(); - request.setRequestInfo(getRequestInfo()); - request.setBanks(new ArrayList()); - request.getBanks().add(getBankContract()); - bankRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("bank_persisted", request); - Mockito.verify(bankQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(bankJdbcRepository.search(any(BankSearch.class))).thenReturn(expectedResult); - Pagination actualResult = bankRepository.search(getBankSearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(bankESRepository.search(any(BankSearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = bankRepository.search(getBankSearch()); - assertEquals(expectedResult, actualResult); - } - - private BankContract getBankContract() { - return BankContract.builder().code("code").name("name").active(true).build(); - } - - private BankEntity getBankEntity() { - BankEntity entity = new BankEntity(); - Bank bank = getBankDomain(); - entity.setId(bank.getId()); - entity.setCode(bank.getCode()); - entity.setName(bank.getName()); - entity.setActive(bank.getActive()); - entity.setDescription(bank.getDescription()); - entity.setTenantId(bank.getTenantId()); - return entity; - } - - private Bank getBankDomain() { - Bank bank = new Bank(); - bank.setId("1"); - bank.setCode("code"); - bank.setName("name"); - bank.setActive(true); - bank.setDescription("description"); - bank.setTenantId("default"); - return bank; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private BankSearch getBankSearch() { - BankSearch bankSearch = new BankSearch(); - bankSearch.setPageSize(500); - bankSearch.setOffset(0); - bankSearch.setSortBy("name desc"); - return bankSearch; - } - - private List getBanks() { - List banks = new ArrayList(); - Bank bank = Bank.builder().id("1").name("name").code("code").active(true).build(); - bank.setTenantId("default"); - banks.add(bank); - return banks; - } - - private BankSearchContract getBankSearchContract() { - BankSearchContract bankSearchContract = new BankSearchContract(); - bankSearchContract.setPageSize(0); - bankSearchContract.setOffset(0); - bankSearchContract.setSortBy("name desc"); - return bankSearchContract; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailRepositoryTest.java deleted file mode 100644 index 27407912d08..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/ChartOfAccountDetailRepositoryTest.java +++ /dev/null @@ -1,187 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.domain.repository.ChartOfAccountDetailRepository; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.ChartOfAccountDetailEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.ChartOfAccountDetailJdbcRepository; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.contract.ChartOfAccountDetailContract; -import org.egov.egf.master.web.requests.ChartOfAccountDetailRequest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class ChartOfAccountDetailRepositoryTest { - - @Mock - private ChartOfAccountDetailJdbcRepository chartofAccountDetailJdbcRepository; - - @Mock - private MastersQueueRepository chartofAccountDetailQueueRepository; - - @InjectMocks - private ChartOfAccountDetailRepository chartOfAccountDetailRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Test - public void testFindById() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = getChartOfAccountDetailEntity(); - ChartOfAccountDetail expectedResult = chartOfAccountDetailEntity.toDomain(); - when(chartofAccountDetailJdbcRepository.findById(any(ChartOfAccountDetailEntity.class))) - .thenReturn(chartOfAccountDetailEntity); - ChartOfAccountDetail actualResult = chartOfAccountDetailRepository.findById(getChartOfAccountDetailDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSave() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = getChartOfAccountDetailEntity(); - ChartOfAccountDetail expectedResult = chartOfAccountDetailEntity.toDomain(); - when(chartofAccountDetailJdbcRepository.create(any(ChartOfAccountDetailEntity.class))) - .thenReturn(chartOfAccountDetailEntity); - ChartOfAccountDetail actualResult = chartOfAccountDetailRepository.save(getChartOfAccountDetailDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testUpdate() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = getChartOfAccountDetailEntity(); - ChartOfAccountDetail expectedResult = chartOfAccountDetailEntity.toDomain(); - when(chartofAccountDetailJdbcRepository.update(any(ChartOfAccountDetailEntity.class))) - .thenReturn(chartOfAccountDetailEntity); - ChartOfAccountDetail actualResult = chartOfAccountDetailRepository.update(getChartOfAccountDetailDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testAdd() { - Mockito.doNothing().when(chartofAccountDetailQueueRepository).add(Mockito.any()); - ChartOfAccountDetailRequest request = new ChartOfAccountDetailRequest(); - List coadcs = new ArrayList<>(); - coadcs.add(getChartOfAccountDetailContract()); - request.setRequestInfo(getRequestInfo()); - request.setChartOfAccountDetails(coadcs); - chartOfAccountDetailRepository.add(request); - Map message = new HashMap<>(); - message.put("chartofaccountdetail_create", request); - verify(chartofAccountDetailQueueRepository).add(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(chartofAccountDetailJdbcRepository.search(any(ChartOfAccountDetailSearch.class))).thenReturn(expectedResult); - Pagination actualResult = chartOfAccountDetailRepository.search(getChartOfAccountDetailSearch()); - assertEquals(expectedResult, actualResult); - } - - private ChartOfAccountDetailEntity getChartOfAccountDetailEntity() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = new ChartOfAccountDetailEntity(); - chartOfAccountDetailEntity.setId("1"); - chartOfAccountDetailEntity.setChartOfAccountId(getChartOfAccount().getId()); - chartOfAccountDetailEntity.setAccountDetailTypeId(getAccountDetailType().getId()); - return chartOfAccountDetailEntity; - } - - private ChartOfAccountDetail getChartOfAccountDetailDomain() { - ChartOfAccountDetail chartOfAccountDetail = ChartOfAccountDetail.builder().id("1").build(); - chartOfAccountDetail.setChartOfAccount(getChartOfAccount()); - chartOfAccountDetail.setAccountDetailType(getAccountDetailType()); - return chartOfAccountDetail; - } - - private ChartOfAccount getChartOfAccount() { - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("1") - .glcode("glcode").name("name") - .description("description").isActiveForPosting(true) - .type('A').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private ChartOfAccountContract getChartOfAccountContract() { - ChartOfAccountContract chartOfAccountContract = ChartOfAccountContract.builder().id("1") - .glcode("glcode").name("name") - .description("description").isActiveForPosting(true) - .type('A').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccountContract.setTenantId("default"); - return chartOfAccountContract; - } - - private AccountDetailType getAccountDetailType() { - AccountDetailType accountDetailType = AccountDetailType.builder().id("1") - .name("name").description("description").active(true).build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - - private AccountDetailTypeContract getAccountDetailTypeContract() { - AccountDetailTypeContract accountDetailTypeContract = AccountDetailTypeContract.builder().id("1") - .name("name").description("description").active(true).build(); - accountDetailTypeContract.setTenantId("default"); - return accountDetailTypeContract; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private ChartOfAccountDetailContract getChartOfAccountDetailContract() { - ChartOfAccountDetailContract chartOfAccountDetailContract = ChartOfAccountDetailContract.builder().id("1").build(); - chartOfAccountDetailContract.setChartOfAccount(getChartOfAccountContract()); - chartOfAccountDetailContract.setAccountDetailType(getAccountDetailTypeContract()); - return chartOfAccountDetailContract; - } - - private ChartOfAccountDetailSearch getChartOfAccountDetailSearch() { - ChartOfAccountDetailSearch chartOfAccountDetailSearch = new ChartOfAccountDetailSearch(); - chartOfAccountDetailSearch.setPageSize(500); - chartOfAccountDetailSearch.setOffset(0); - chartOfAccountDetailSearch.setSortBy("name desc"); - return chartOfAccountDetailSearch; - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/ChartOfAccountRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/ChartOfAccountRepositoryTest.java deleted file mode 100644 index 48515ce62fb..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/ChartOfAccountRepositoryTest.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.ChartOfAccountEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.ChartOfAccountJdbcRepository; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.requests.ChartOfAccountRequest; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class ChartOfAccountRepositoryTest { - - @Mock - private ChartOfAccountJdbcRepository chartofAccountJdbcRepository; - - @Mock - private MastersQueueRepository chartofAccountQueueRepository; - - @InjectMocks - private ChartOfAccountRepository chartOfAccountRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Test - public void testFindById() { - ChartOfAccountEntity chartOfAccountEntity = getChartOfAccountEntity(); - ChartOfAccount expectedResult = chartOfAccountEntity.toDomain(); - when(chartofAccountJdbcRepository.findById(any(ChartOfAccountEntity.class))).thenReturn(chartOfAccountEntity); - ChartOfAccount actualResult = chartOfAccountRepository.findById(getChartOfAccountDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSave() { - ChartOfAccountEntity chartOfAccountEntity = getChartOfAccountEntity(); - ChartOfAccount expectedResult = chartOfAccountEntity.toDomain(); - when(chartofAccountJdbcRepository.create(any(ChartOfAccountEntity.class))).thenReturn(chartOfAccountEntity); - ChartOfAccount actualResult = chartOfAccountRepository.save(getChartOfAccountDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testUpdate() { - ChartOfAccountEntity chartOfAccountEntity = getChartOfAccountEntity(); - ChartOfAccount expectedResult = chartOfAccountEntity.toDomain(); - when(chartofAccountJdbcRepository.update(any(ChartOfAccountEntity.class))).thenReturn(chartOfAccountEntity); - ChartOfAccount actualResult = chartOfAccountRepository.update(getChartOfAccountDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testAdd() { - Mockito.doNothing().when(chartofAccountQueueRepository).add(Mockito.any()); - ChartOfAccountRequest request = new ChartOfAccountRequest(); - request.setRequestInfo(getRequestInfo()); - request.setChartOfAccounts(new ArrayList()); - request.getChartOfAccounts().add(getChartOfAccountContract()); - chartOfAccountRepository.add(request); - Map message = new HashMap<>(); - message.put("chartofaccount_create", request); - Mockito.verify(chartofAccountQueueRepository).add(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(chartofAccountJdbcRepository.search(any(ChartOfAccountSearch.class))).thenReturn(expectedResult); - Pagination actualResult = chartOfAccountRepository.search(getChartOfAccountSearch()); - assertEquals(expectedResult, actualResult); - } - - private ChartOfAccountEntity getChartOfAccountEntity() { - ChartOfAccountEntity chartOfAccountEntity = new ChartOfAccountEntity(); - ChartOfAccount chartOfAccount = getChartOfAccountDomain(); - chartOfAccountEntity.setGlcode(chartOfAccount.getGlcode()); - chartOfAccountEntity.setName(chartOfAccount.getName()); - chartOfAccountEntity.setDescription(chartOfAccount.getDescription()); - chartOfAccountEntity.setIsActiveForPosting(chartOfAccount.getIsActiveForPosting()); - chartOfAccountEntity.setType(chartOfAccount.getType()); - chartOfAccountEntity.setClassification(chartOfAccount.getClassification()); - chartOfAccountEntity.setFunctionRequired(chartOfAccount.getFunctionRequired()); - chartOfAccountEntity.setBudgetCheckRequired(chartOfAccount.getBudgetCheckRequired()); - return chartOfAccountEntity; - } - - private ChartOfAccount getChartOfAccountDomain() { - ChartOfAccount chartOfAccount = ChartOfAccount.builder() - .glcode("GLCode").name("AadharBank") - .description("DefaultDescription").isActiveForPosting(true) - .type('B').classification((long) 123456).functionRequired(true) - .budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private ChartOfAccountContract getChartOfAccountContract() { - - return ChartOfAccountContract.builder() - .glcode("GLCode").name("AadharBank") - .description("DefaultDescription").isActiveForPosting(true) - .type('B').classification((long) 123456).functionRequired(true) - .budgetCheckRequired(true).build(); - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private ChartOfAccountSearch getChartOfAccountSearch() { - ChartOfAccountSearch chartOfAccountSearch = new ChartOfAccountSearch(); - chartOfAccountSearch.setPageSize(500); - chartOfAccountSearch.setOffset(0); - chartOfAccountSearch.setSortBy("name desc"); - return chartOfAccountSearch; - - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/FunctionRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/FunctionRepositoryTest.java deleted file mode 100644 index ee36c1f8c78..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/FunctionRepositoryTest.java +++ /dev/null @@ -1,265 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FunctionEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FunctionJdbcRepository; -import org.egov.egf.master.web.contract.FunctionContract; -import org.egov.egf.master.web.contract.FunctionSearchContract; -import org.egov.egf.master.web.requests.FunctionRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class FunctionRepositoryTest { - - private FunctionRepository functionRepositoryWithKafka; - private FunctionRepository functionRepositoryWithOutKafka; - - @InjectMocks - private FunctionRepository functionRepository; - - @Mock - private FunctionJdbcRepository functionJdbcRepository; - - @Mock - private MastersQueueRepository functionQueueRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Mock - private FunctionESRepository functionESRepository; - - @Captor - private ArgumentCaptor> captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - functionRepositoryWithKafka = new FunctionRepository(functionJdbcRepository, functionQueueRepository, - financialConfigurationService, functionESRepository, "yes"); - functionRepositoryWithOutKafka = new FunctionRepository(functionJdbcRepository, functionQueueRepository, - financialConfigurationService, functionESRepository, "no"); - - } - - @Test - public void testFindById() { - FunctionEntity functionEntity = getFunctionEntity(); - Function expectedResult = functionEntity.toDomain(); - when(functionJdbcRepository.findById(any(FunctionEntity.class))).thenReturn(functionEntity); - Function actualResult = functionRepository.findById(getFunctionDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSave() { - List expectedResult = getFunctions(); - requestInfo.setAction(Constants.ACTION_CREATE); - functionRepositoryWithKafka.save(expectedResult, requestInfo); - verify(functionQueueRepository).add(captor.capture()); - } - - @Test - public void testSave1() { - List expectedResult = getFunctions(); - FunctionEntity entity = new FunctionEntity().toEntity(expectedResult.get(0)); - when(functionJdbcRepository.create(any(FunctionEntity.class))).thenReturn(entity); - functionRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(functionQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSavee() { - FunctionEntity functionEntity = getFunctionEntity(); - Function expectedResult = functionEntity.toDomain(); - when(functionJdbcRepository.create(any(FunctionEntity.class))).thenReturn(functionEntity); - Function actualResult = functionRepository.save(getFunctionDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testUpdate() { - List expectedResult = getFunctions(); - requestInfo.setAction(Constants.ACTION_CREATE); - functionRepositoryWithKafka.update(expectedResult, requestInfo); - verify(functionQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdate1() { - List expectedResult = getFunctions(); - FunctionEntity entity = new FunctionEntity().toEntity(expectedResult.get(0)); - when(functionJdbcRepository.update(any(FunctionEntity.class))).thenReturn(entity); - functionRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(functionQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdatee() { - FunctionEntity functionEntity = getFunctionEntity(); - Function expectedResult = functionEntity.toDomain(); - when(functionJdbcRepository.update(any(FunctionEntity.class))).thenReturn(functionEntity); - Function actualResult = functionRepository.update(getFunctionDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testAddToQue() { - Mockito.doNothing().when(functionQueueRepository).add(Mockito.any()); - FunctionRequest request = new FunctionRequest(); - request.setRequestInfo(getRequestInfo()); - request.setFunctions(new ArrayList()); - request.getFunctions().add(getFunctionContract()); - functionRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("function_create", request); - Mockito.verify(functionQueueRepository).add(message); - } - - @Test - public void testAddToQue1() { - Mockito.doNothing().when(functionQueueRepository).add(Mockito.any()); - FunctionRequest request = new FunctionRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setFunctions(new ArrayList()); - request.getFunctions().add(getFunctionContract()); - functionRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("function_update", request); - Mockito.verify(functionQueueRepository).add(message); - } - - @Test - public void testAddToSearchQueue() { - Mockito.lenient().doNothing().when(functionQueueRepository).add(Mockito.any()); - FunctionRequest request = new FunctionRequest(); - request.setRequestInfo(getRequestInfo()); - request.setFunctions(new ArrayList()); - request.getFunctions().add(getFunctionContract()); - functionRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("function_persisted", request); - Mockito.verify(functionQueueRepository).addToSearch(message); - } - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(functionJdbcRepository.search(any(FunctionSearch.class))).thenReturn(expectedResult); - Pagination actualResult = functionRepository.search(getFunctionSearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(functionESRepository.search(any(FunctionSearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = functionRepository.search(getFunctionSearch()); - assertEquals(expectedResult, actualResult); - } - - private FunctionContract getFunctionContract() { - return FunctionContract.builder().code("code").name("name").active(true).level(1).build(); - } - - private FunctionEntity getFunctionEntity() { - FunctionEntity entity = new FunctionEntity(); - Function function = getFunctionDomain(); - entity.setCode(function.getCode()); - entity.setName(function.getName()); - entity.setActive(function.getActive()); - entity.setLevel(function.getLevel()); - entity.setTenantId(function.getTenantId()); - return entity; - } - - private Function getFunctionDomain() { - Function function = new Function(); - function.setId("1"); - function.setCode("code"); - function.setName("name"); - function.setActive(true); - function.setLevel(1); - function.setTenantId("default"); - return function; - } - - public List getFunctionDomains() { - List functions = new ArrayList<>(); - functions.add(getFunctionDomain()); - return functions; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private FunctionSearch getFunctionSearch() { - FunctionSearch functionSearch = new FunctionSearch(); - functionSearch.setPageSize(500); - functionSearch.setOffset(0); - functionSearch.setSortBy("name desc"); - return functionSearch; - } - - private List getFunctions() { - List functions = new ArrayList(); - Function function = Function.builder().id("1").name("name").code("code").level(1).active(true).build(); - function.setTenantId("default"); - functions.add(function); - return functions; - } - - private FunctionSearchContract getFunctionSearchContract() { - FunctionSearchContract functionSearchContract = new FunctionSearchContract(); - functionSearchContract.setPageSize(0); - functionSearchContract.setOffset(0); - functionSearchContract.setSortBy("name desc"); - return functionSearchContract; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/FundRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/FundRepositoryTest.java deleted file mode 100644 index 556d44f8041..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/FundRepositoryTest.java +++ /dev/null @@ -1,265 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.FundEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.FundJdbcRepository; -import org.egov.egf.master.web.contract.FundContract; -import org.egov.egf.master.web.contract.FundSearchContract; -import org.egov.egf.master.web.requests.FundRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; - -@RunWith(MockitoJUnitRunner.class) -public class FundRepositoryTest { - - private FundRepository fundRepositoryWithKafka; - private FundRepository fundRepositoryWithOutKafka; - - @InjectMocks - private FundRepository fundRepository; - - @Mock - private FundJdbcRepository fundJdbcRepository; - - @Mock - private MastersQueueRepository fundQueueRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Mock - private FundESRepository fundESRepository; - - @Captor - private ArgumentCaptor> captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - fundRepositoryWithKafka = new FundRepository(fundJdbcRepository, fundQueueRepository, financialConfigurationService, - fundESRepository, "yes"); - fundRepositoryWithOutKafka = new FundRepository(fundJdbcRepository, fundQueueRepository, financialConfigurationService, - fundESRepository, "no"); - - } - - @Test - public void testFindById() { - FundEntity fundEntity = getFundEntity(); - Fund expectedResult = fundEntity.toDomain(); - when(fundJdbcRepository.findById(any(FundEntity.class))).thenReturn(fundEntity); - Fund actualResult = fundRepository.findById(getFundDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSave() { - List expectedResult = getFunds(); - requestInfo.setAction(Constants.ACTION_CREATE); - fundRepositoryWithKafka.save(expectedResult, requestInfo); - verify(fundQueueRepository).add(captor.capture()); - } - - @Test - public void testSave1() { - List expectedResult = getFunds(); - FundEntity entity = new FundEntity().toEntity(expectedResult.get(0)); - when(fundJdbcRepository.create(any(FundEntity.class))).thenReturn(entity); - fundRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(fundQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testSavee() { - FundEntity fundEntity = getFundEntity(); - Fund expectedResult = fundEntity.toDomain(); - when(fundJdbcRepository.create(any(FundEntity.class))).thenReturn(fundEntity); - Fund actualResult = fundRepository.save(getFundDomain()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testUpdate() { - List expectedResult = getFunds(); - requestInfo.setAction(Constants.ACTION_CREATE); - fundRepositoryWithKafka.update(expectedResult, requestInfo); - verify(fundQueueRepository).add(captor.capture()); - } - - @Test - public void testUpdate1() { - List expectedResult = getFunds(); - FundEntity entity = new FundEntity().toEntity(expectedResult.get(0)); - when(fundJdbcRepository.update(any(FundEntity.class))).thenReturn(entity); - fundRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(fundQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void testUpdatee() { - FundEntity fundEntity = getFundEntity(); - Fund expectedResult = fundEntity.toDomain(); - when(fundJdbcRepository.update(any(FundEntity.class))).thenReturn(fundEntity); - Fund actualResult = fundRepository.update(getFundDomain()); - assertEquals(expectedResult, actualResult); - } - - /* @Test - public void testAddToQue() { - Mockito.doNothing().when(fundQueueRepository).add(Mockito.any()); - FundRequest request = new FundRequest(); - request.setRequestInfo(getRequestInfo()); - request.setFunds(new ArrayList()); - request.getFunds().add(getFundContract()); - // fundRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("fund_create", request); - Mockito.verify(fundQueueRepository).add(message); - }*/ - -/* @Test - public void testAddToQue1() { - Mockito.doNothing().when(fundQueueRepository).add(Mockito.any()); - FundRequest request = new FundRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setFunds(new ArrayList()); - request.getFunds().add(getFundContract()); - fundRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("fund_update", request); - Mockito.verify(fundQueueRepository).add(message); - } -*/ - /* @Test - public void testAddToSearchQueue() { - Mockito.doNothing().when(fundQueueRepository).add(Mockito.any()); - FundRequest request = new FundRequest(); - request.setRequestInfo(getRequestInfo()); - request.setFunds(new ArrayList()); - request.getFunds().add(getFundContract()); - fundRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("fund_persisted", request); - Mockito.verify(fundQueueRepository).addToSearch(message); - }*/ - - @Test - public void testSearch() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(fundJdbcRepository.search(any(FundSearch.class))).thenReturn(expectedResult); - Pagination actualResult = fundRepository.search(getFundSearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void testSearch1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(fundESRepository.search(any(FundSearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = fundRepository.search(getFundSearch()); - assertEquals(expectedResult, actualResult); - } - - private FundContract getFundContract() { - return FundContract.builder().code("code").name("name").active(true).level(1234l).build(); - } - - private FundEntity getFundEntity() { - FundEntity entity = new FundEntity(); - Fund fund = getFundDomain(); - entity.setCode(fund.getCode()); - entity.setName(fund.getName()); - entity.setActive(fund.getActive()); - entity.setLevel(fund.getLevel()); - entity.setTenantId(fund.getTenantId()); - return entity; - } - - private Fund getFundDomain() { - Fund fund = new Fund(); - fund.setId("1"); - fund.setCode("code"); - fund.setName("name"); - fund.setActive(true); - fund.setLevel(1234l); - fund.setTenantId("default"); - return fund; - } - - public List getFundDomains() { - List funds = new ArrayList<>(); - funds.add(getFundDomain()); - return funds; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private FundSearch getFundSearch() { - FundSearch fundSearch = new FundSearch(); - fundSearch.setPageSize(500); - fundSearch.setOffset(0); - fundSearch.setSortBy("name desc"); - return fundSearch; - } - - private List getFunds() { - List funds = new ArrayList(); - Fund fund = Fund.builder().id("1").name("name").code("code").identifier('I').level(1234l).active(true).build(); - fund.setTenantId("default"); - funds.add(fund); - return funds; - } - - private FundSearchContract getFundSearchContract() { - FundSearchContract fundSearchContract = new FundSearchContract(); - fundSearchContract.setPageSize(0); - fundSearchContract.setOffset(0); - fundSearchContract.setSortBy("name desc"); - return fundSearchContract; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/RecoveryRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/RecoveryRepositoryTest.java deleted file mode 100644 index 583c352c543..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/repository/RecoveryRepositoryTest.java +++ /dev/null @@ -1,278 +0,0 @@ -package org.egov.egf.master.domain.repository; - -import org.egov.common.constants.Constants; -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.contract.request.User; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.domain.service.FinancialConfigurationService; -import org.egov.egf.master.persistence.entity.RecoveryEntity; -import org.egov.egf.master.persistence.queue.MastersQueueRepository; -import org.egov.egf.master.persistence.repository.RecoveryJdbcRepository; -import org.egov.egf.master.web.contract.RecoveryContract; -import org.egov.egf.master.web.contract.RecoverySearchContract; -import org.egov.egf.master.web.requests.RecoveryRequest; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.*; -import org.mockito.runners.MockitoJUnitRunner; - -import java.util.*; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class RecoveryRepositoryTest { - - private RecoveryRepository recoveryRepositoryWithKafka; - private RecoveryRepository recoveryRepositoryWithOutKafka; - - @InjectMocks - private RecoveryRepository recoveryRepository; - - @Mock - private RecoveryJdbcRepository recoveryJdbcRepository; - - @Mock - private MastersQueueRepository recoveryQueueRepository; - - @Mock - private FinancialConfigurationService financialConfigurationService; - - @Mock - private RecoveryESRepository recoveryESRepository; - - @Captor - private ArgumentCaptor> captor; - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - recoveryRepositoryWithKafka = new RecoveryRepository(recoveryQueueRepository, financialConfigurationService, "yes", recoveryJdbcRepository, - recoveryESRepository); - recoveryRepositoryWithOutKafka = new RecoveryRepository(recoveryQueueRepository, financialConfigurationService, "no", recoveryJdbcRepository, - recoveryESRepository); - - } - - @Test - public void test_findbyid() { - RecoveryEntity recoveryEntity = getRecoveryEntity(); - Recovery expectedResult = recoveryEntity.toDomain(); - when(recoveryJdbcRepository.findById(any(RecoveryEntity.class))).thenReturn(recoveryEntity); - Recovery actualResult = recoveryRepository.findById(getRecoveryDomain()); - assertEquals(expectedResult.getCode(), actualResult.getCode()); - } - - @Test - public void test_save() { - List expectedResult = getRecoverys(); - requestInfo.setAction(Constants.ACTION_CREATE); - recoveryRepositoryWithKafka.save(expectedResult, requestInfo); - verify(recoveryQueueRepository).add(captor.capture()); - } - - @Test - public void test_save1() { - List expectedResult = getRecoverys(); - RecoveryEntity entity = new RecoveryEntity().toEntity(expectedResult.get(0)); - when(recoveryJdbcRepository.create(any(RecoveryEntity.class))).thenReturn(entity); - recoveryRepositoryWithOutKafka.save(expectedResult, requestInfo); - verify(recoveryQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void test_savee() { - RecoveryEntity recoveryEntity = getRecoveryEntity(); - Recovery expectedResult = recoveryEntity.toDomain(); - when(recoveryJdbcRepository.create(any(RecoveryEntity.class))).thenReturn(recoveryEntity); - Recovery actualResult = recoveryRepository.save(getRecoveryDomain()); - assertEquals(expectedResult.getCode(), actualResult.getCode()); - } - - @Test - public void test_update() { - List expectedResult = getRecoverys(); - requestInfo.setAction(Constants.ACTION_CREATE); - recoveryRepositoryWithKafka.update(expectedResult, requestInfo); - verify(recoveryQueueRepository).add(captor.capture()); - } - - @Test - public void test_update1() { - List expectedResult = getRecoverys(); - RecoveryEntity entity = new RecoveryEntity().toEntity(expectedResult.get(0)); - when(recoveryJdbcRepository.update(any(RecoveryEntity.class))).thenReturn(entity); - recoveryRepositoryWithOutKafka.update(expectedResult, requestInfo); - verify(recoveryQueueRepository).addToSearch(any(Map.class)); - } - - @Test - public void test_updatee() { - RecoveryEntity recoveryEntity = getRecoveryEntity(); - Recovery expectedResult = recoveryEntity.toDomain(); - when(recoveryJdbcRepository.update(any(RecoveryEntity.class))).thenReturn(recoveryEntity); - Recovery actualResult = recoveryRepository.update(getRecoveryDomain()); - assertEquals(expectedResult.getCode(), actualResult.getCode()); - } - - @Test - public void test_addtoque() { - Mockito.doNothing().when(recoveryQueueRepository).add(Mockito.any()); - RecoveryRequest request = new RecoveryRequest(); - request.setRequestInfo(getRequestInfo()); - request.setRecoverys(new ArrayList()); - request.getRecoverys().add(getRecoveryContract()); - recoveryRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("recovery_create", request); - Mockito.verify(recoveryQueueRepository).add(message); - } - - @Test - public void test_addtoque1() { - Mockito.doNothing().when(recoveryQueueRepository).add(Mockito.any()); - RecoveryRequest request = new RecoveryRequest(); - request.setRequestInfo(getRequestInfo()); - request.getRequestInfo().setAction(Constants.ACTION_UPDATE); - request.setRecoverys(new ArrayList()); - request.getRecoverys().add(getRecoveryContract()); - recoveryRepository.addToQue(request); - Map message = new HashMap<>(); - message.put("recovery_update", request); - Mockito.verify(recoveryQueueRepository).add(message); - } - - @Test - public void test_addtosearchqueue() { - Mockito.lenient().doNothing().when(recoveryQueueRepository).add(Mockito.any()); - RecoveryRequest request = new RecoveryRequest(); - request.setRequestInfo(getRequestInfo()); - request.setRecoverys(new ArrayList()); - request.getRecoverys().add(getRecoveryContract()); - recoveryRepository.addToSearchQueue(request); - Map message = new HashMap<>(); - message.put("recovery_persisted", request); - Mockito.verify(recoveryQueueRepository).addToSearch(message); - } - - @Test - public void test_search() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("db"); - when(recoveryJdbcRepository.search(any(RecoverySearch.class))).thenReturn(expectedResult); - Pagination actualResult = recoveryRepository.search(getRecoverySearch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public void test_search1() { - Pagination expectedResult = new Pagination<>(); - expectedResult.setPageSize(500); - expectedResult.setOffset(0); - when(financialConfigurationService.fetchDataFrom()).thenReturn("es"); - when(recoveryESRepository.search(any(RecoverySearchContract.class))).thenReturn(expectedResult); - Pagination actualResult = recoveryRepository.search(getRecoverySearch()); - assertEquals(expectedResult, actualResult); - } - - private RecoveryContract getRecoveryContract() { - return RecoveryContract.builder().id("1").name("name").code("code").type("M").accountNumber("30492234547").active(true). - remittanceMode('M').remitted("ritesh").build(); - } - - private RecoveryEntity getRecoveryEntity() { - RecoveryEntity entity = new RecoveryEntity(); - Recovery recovery = getRecoveryDomain(); - entity.setId(recovery.getId()); - entity.setCode(recovery.getCode()); - entity.setName(recovery.getName()); - entity.setActive(recovery.getActive()); - entity.setType(recovery.getType()); - entity.setAccountNumber(recovery.getAccountNumber()); - entity.setRemittanceMode(recovery.getRemittanceMode()); - entity.setRemitted(recovery.getRemitted()); - entity.setTenantId(recovery.getTenantId()); - return entity; - } - - private Recovery getRecoveryDomain() { - Recovery recovery = new Recovery(); - recovery.setId("1"); - recovery.setCode("code"); - recovery.setName("name"); - recovery.setActive(true); - recovery.setType("M"); - recovery.setAccountNumber("30492234547"); - recovery.setRemittanceMode('M'); - recovery.setRemitted("ritesh"); - recovery.setTenantId("default"); - return recovery; - } - - public List getRecoveryDomains() { - List recoverys = new ArrayList<>(); - recoverys.add(getRecoveryDomain()); - return recoverys; - } - - private RequestInfo getRequestInfo() { - RequestInfo info = new RequestInfo(); - User user = new User(); - user.setId(1l); - info.setAction(Constants.ACTION_CREATE); - info.setDid("did"); - info.setApiId("apiId"); - info.setKey("key"); - info.setMsgId("msgId"); - info.setTs(new Date()); - info.setUserInfo(user); - info.setAuthToken("null"); - return info; - } - - private RecoverySearch getRecoverySearch() { - RecoverySearch recoverySearch = new RecoverySearch(); - recoverySearch.setPageSize(500); - recoverySearch.setOffset(0); - recoverySearch.setSortBy("name desc"); - return recoverySearch; - } - - private List getRecoverys() { - List recoverys = new ArrayList(); - Recovery recovery = Recovery.builder().id("1").name("name").code("code").type("M").accountNumber("30492234547").active(true). - remittanceMode('M').remitted("ritesh").build(); - recovery.setTenantId("default"); - recovery.setChartOfAccount(getChartOfAccount()); - recoverys.add(recovery); - return recoverys; - } - - private RecoverySearchContract getRecoverySearchContract() { - RecoverySearchContract recoverySearchContract = new RecoverySearchContract(); - recoverySearchContract.setPageSize(0); - recoverySearchContract.setOffset(0); - recoverySearchContract.setSortBy("name desc"); - return recoverySearchContract; - } - - private ChartOfAccount getChartOfAccount() { - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("1") - .glcode("glcode").name("name") - .description("description").isActiveForPosting(true) - .type('A').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountCodePurposeServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountCodePurposeServiceTest.java deleted file mode 100644 index 9efc4a8a8ef..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountCodePurposeServiceTest.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.domain.repository.AccountCodePurposeRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class AccountCodePurposeServiceTest { - - @InjectMocks - private AccountCodePurposeService accountCodePurposeService; - - @Mock - private SmartValidator validator; - - @Mock - private AccountCodePurposeRepository accountCodePurposeRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - private List accountCodePurposes = new ArrayList<>(); - - @Before - public void setup() { - } - - @Test - public final void testCreate() { - accountCodePurposes.add(getAccountCodePurpose()); - when(accountCodePurposeRepository.uniqueCheck(any(String.class), any(AccountCodePurpose.class))) - .thenReturn(true); - accountCodePurposeService.create(accountCodePurposes, errors, requestInfo); - } - - @Test - public final void testUpdate() { - accountCodePurposes.add(getAccountCodePurpose()); - when(accountCodePurposeRepository.uniqueCheck(any(String.class), any(AccountCodePurpose.class))) - .thenReturn(true); - accountCodePurposeService.update(accountCodePurposes, errors, requestInfo); - } - - @Test - public final void testCreateInvalid() { - AccountCodePurpose accountCodePurpose = AccountCodePurpose.builder().id("a").name("name").build(); - when(accountCodePurposeRepository.uniqueCheck(any(String.class), any(AccountCodePurpose.class))) - .thenReturn(true); - accountCodePurposes.add(accountCodePurpose); - accountCodePurposeService.create(accountCodePurposes, errors, requestInfo); - } - - @Test - public final void test_save() { - AccountCodePurpose expextedResult = getAccountCodePurposes().get(0); - when(accountCodePurposeRepository.save(any(AccountCodePurpose.class))).thenReturn(expextedResult); - AccountCodePurpose actualResult = accountCodePurposeService.save(getAccountCodePurposes().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getAccountCodePurposeSearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(accountCodePurposeRepository.search(any(AccountCodePurposeSearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountCodePurposeService.search(getAccountCodePurposeSearch(), - errors); - assertEquals(expectedResult, actualResult); - - } - - @Test - public final void test_update() { - AccountCodePurpose expextedResult = getAccountCodePurposes().get(0); - when(accountCodePurposeRepository.update(any(AccountCodePurpose.class))).thenReturn(expextedResult); - AccountCodePurpose actualResult = accountCodePurposeService.update(getAccountCodePurposes().get(0)); - assertEquals(expextedResult, actualResult); - } - - private List getAccountCodePurposes() { - List accountCodePurposes = new ArrayList(); - AccountCodePurpose accountCodePurpose = AccountCodePurpose.builder().id("1").name("name").build(); - accountCodePurpose.setTenantId("default"); - accountCodePurposes.add(accountCodePurpose); - return accountCodePurposes; - } - - private AccountCodePurposeSearch getAccountCodePurposeSearch() { - AccountCodePurposeSearch accountCodePurposeSearch = new AccountCodePurposeSearch(); - accountCodePurposeSearch.setPageSize(0); - accountCodePurposeSearch.setOffset(0); - accountCodePurposeSearch.setSortBy("Sort"); - accountCodePurposeSearch.setTenantId("default"); - return accountCodePurposeSearch; - } - - private AccountCodePurpose getAccountCodePurpose() { - AccountCodePurpose accountCodePurpose = AccountCodePurpose.builder().id("1").name("name").build(); - accountCodePurpose.setTenantId("default"); - return accountCodePurpose; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountDetailKeyServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountDetailKeyServiceTest.java deleted file mode 100644 index f7792078cf9..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountDetailKeyServiceTest.java +++ /dev/null @@ -1,158 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.repository.AccountDetailKeyRepository; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class AccountDetailKeyServiceTest { - - @InjectMocks - private AccountDetailKeyService accountDetailKeyService; - - @Mock - private SmartValidator validator; - - @Mock - private AccountDetailKeyRepository accountDetailKeyRepository; - - @Mock - private AccountDetailTypeRepository accountDetailTypeRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - private List accountDetailKies = new ArrayList<>(); - - @Before - public void setup() { - } - - @Test - public final void testCreate() { - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); - when(accountDetailKeyRepository.uniqueCheck(any(String.class), any(AccountDetailKey.class))).thenReturn(true); - accountDetailKeyService.create(getAccountDetailKeys(), errors, requestInfo); - } - - @Test - public final void testUpdate() { - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); - when(accountDetailKeyRepository.uniqueCheck(any(String.class), any(AccountDetailKey.class))).thenReturn(true); - accountDetailKeyService.update(getAccountDetailKeys(), errors, requestInfo); - } - - @Test - public final void testCreateInvalid() { - AccountDetailKey accountDetailKey1 = AccountDetailKey.builder().id("a").key("1").accountDetailType(null) - .build(); - accountDetailKies.add(accountDetailKey1); - when(accountDetailKeyRepository.uniqueCheck(any(String.class), any(AccountDetailKey.class))).thenReturn(true); - accountDetailKeyService.create(accountDetailKies, errors, requestInfo); - } - - @Test - public final void test_save() { - AccountDetailKey expextedResult = getAccountDetailKeys().get(0); - when(accountDetailKeyRepository.save(any(AccountDetailKey.class))).thenReturn(expextedResult); - AccountDetailKey actualResult = accountDetailKeyService.save(getAccountDetailKeys().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getAccountDetailKeySearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(accountDetailKeyRepository.search(any(AccountDetailKeySearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountDetailKeyService.search(getAccountDetailKeySearch(), errors); - assertEquals(expectedResult, actualResult); - - } - - @Test - public final void test_update() { - AccountDetailKey expextedResult = getAccountDetailKeys().get(0); - when(accountDetailKeyRepository.update(any(AccountDetailKey.class))).thenReturn(expextedResult); - AccountDetailKey actualResult = accountDetailKeyService.update(getAccountDetailKeys().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_fetch_related_data() { - List expextedResult = new ArrayList<>(); - expextedResult.add(getAccountDetailType()); - List accountDetailKies = new ArrayList<>(); - accountDetailKies.add(getAccountDetailKey()); - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); - List actualResult = accountDetailKeyService.fetchRelated(accountDetailKies); - assertEquals(expextedResult.get(0).getId(), actualResult.get(0).getAccountDetailType().getId()); - assertEquals(expextedResult.get(0).getName(), actualResult.get(0).getAccountDetailType().getName()); - } - - @Test(expected = InvalidDataException.class) - public final void test_fetch_related_data_when_parentid_is_wrong() { - List expextedResult = new ArrayList<>(); - expextedResult.add(getAccountDetailType()); - List accountDetailKies = new ArrayList<>(); - accountDetailKies.add(getAccountDetailKey()); - when(accountDetailKeyRepository.findById(any(AccountDetailKey.class))).thenReturn(null); - accountDetailKeyService.fetchRelated(accountDetailKies); - } - - private List getAccountDetailKeys() { - List accountDetailKies = new ArrayList(); - AccountDetailKey accountDetailKey = AccountDetailKey.builder().id("1").key("1") - .accountDetailType(getAccountDetailType()).build(); - accountDetailKey.setTenantId("default"); - accountDetailKies.add(accountDetailKey); - return accountDetailKies; - } - - private AccountDetailKeySearch getAccountDetailKeySearch() { - AccountDetailKeySearch accountDetailKeySearch = new AccountDetailKeySearch(); - accountDetailKeySearch.setPageSize(0); - accountDetailKeySearch.setOffset(0); - accountDetailKeySearch.setSortBy("Sort"); - accountDetailKeySearch.setTenantId("default"); - return accountDetailKeySearch; - } - - private AccountDetailKey getAccountDetailKey() { - AccountDetailKey accountDetailKey = AccountDetailKey.builder().id("1").key("1") - .accountDetailType(getAccountDetailType()).build(); - accountDetailKey.setTenantId("default"); - return accountDetailKey; - } - - private AccountDetailType getAccountDetailType() { - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("contractor") - .fullyQualifiedName("abc/acb").active(true).build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountDetailTypeServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountDetailTypeServiceTest.java deleted file mode 100644 index 3f7516637fd..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountDetailTypeServiceTest.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class AccountDetailTypeServiceTest { - - @InjectMocks - private AccountDetailTypeService accountDetailTypeService; - - @Mock - private SmartValidator validator; - - @Mock - private AccountDetailTypeRepository accountDetailTypeRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - private List accountDetailTypes = new ArrayList<>(); - - @Before - public void setup() { - } - - @Test - public final void testCreate() { - when(accountDetailTypeRepository.uniqueCheck(any(String.class), any(AccountDetailType.class))).thenReturn(true); - accountDetailTypeService.create(getAccountDetailTypes(), errors, requestInfo); - } - - @Test - public final void testUpdate() { - when(accountDetailTypeRepository.uniqueCheck(any(String.class), any(AccountDetailType.class))).thenReturn(true); - accountDetailTypeService.update(getAccountDetailTypes(), errors, requestInfo); - } - - @Test - public final void testCreateInvalid() { - AccountDetailType accountDetailType1 = AccountDetailType.builder().id("a").tableName("contractor") - .fullyQualifiedName("abc/contractor").active(true).build(); - accountDetailTypes.add(accountDetailType1); - when(accountDetailTypeRepository.uniqueCheck(any(String.class), any(AccountDetailType.class))).thenReturn(true); - accountDetailTypeService.create(accountDetailTypes, errors, requestInfo); - } - - @Test - public final void test_save() { - AccountDetailType expextedResult = getAccountDetailTypes().get(0); - when(accountDetailTypeRepository.save(any(AccountDetailType.class))).thenReturn(expextedResult); - AccountDetailType actualResult = accountDetailTypeService.save(getAccountDetailTypes().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getAccountDetailTypeSearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(accountDetailTypeRepository.search(any(AccountDetailTypeSearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountDetailTypeService.search(getAccountDetailTypeSearch(), - errors); - assertEquals(expectedResult, actualResult); - - } - - @Test - public final void test_update() { - AccountDetailType expextedResult = getAccountDetailTypes().get(0); - when(accountDetailTypeRepository.update(any(AccountDetailType.class))).thenReturn(expextedResult); - AccountDetailType actualResult = accountDetailTypeService.update(getAccountDetailTypes().get(0)); - assertEquals(expextedResult, actualResult); - } - - private List getAccountDetailTypes() { - List accountDetailTypes = new ArrayList(); - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("contractor") - .fullyQualifiedName("abc/contractor").active(true).build(); - accountDetailType.setTenantId("default"); - accountDetailTypes.add(accountDetailType); - return accountDetailTypes; - } - - private AccountDetailTypeSearch getAccountDetailTypeSearch() { - AccountDetailTypeSearch accountDetailTypeSearch = new AccountDetailTypeSearch(); - accountDetailTypeSearch.setPageSize(0); - accountDetailTypeSearch.setOffset(0); - accountDetailTypeSearch.setSortBy("Sort"); - accountDetailTypeSearch.setTenantId("default"); - return accountDetailTypeSearch; - } - - private AccountDetailType getAccountDetailType() { - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").active(true) - .tableName("contractor").fullyQualifiedName("abc/contractor").build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountEntityServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountEntityServiceTest.java deleted file mode 100644 index 2d8cdb0ee77..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/AccountEntityServiceTest.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.egov.egf.master.domain.service; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.egov.egf.master.domain.repository.AccountEntityRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class AccountEntityServiceTest { - - @InjectMocks - private AccountEntityService accountEntityService; - - @Mock - private SmartValidator validator; - - @Mock - private AccountDetailTypeRepository accountDetailTypeRepository; - - @Mock - private AccountEntityRepository accountEntityRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - private List accountEntities = new ArrayList<>(); - - @Before - public void setup() { - } - - @Test - public final void testCreate() { - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetaialType()); - when(accountEntityRepository.uniqueCheck(any(String.class), any(AccountEntity.class))).thenReturn(true); - accountEntityService.create(getAccountEntitys(), errors, requestInfo); - } - - @Test - public final void testUpdate() { - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetaialType()); - when(accountEntityRepository.uniqueCheck(any(String.class), any(AccountEntity.class))).thenReturn(true); - accountEntityService.update(getAccountEntitys(), errors, requestInfo); - } - - @Test - public final void testCreateInvalid() { - AccountEntity accountEntity1 = AccountEntity.builder().id("a").code("code").active(true).accountDetailType(null).build(); - accountEntities.add(accountEntity1); - when(accountEntityRepository.uniqueCheck(any(String.class), any(AccountEntity.class))).thenReturn(true); - accountEntityService.create(accountEntities, errors, requestInfo); - } - - @Test - public final void test_save() { - AccountEntity expextedResult = getAccountEntitys().get(0); - when(accountEntityRepository.save(any(AccountEntity.class))).thenReturn(expextedResult); - AccountEntity actualResult = accountEntityService.save(getAccountEntitys().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getAccountEntitySearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(accountEntityRepository.search(any(AccountEntitySearch.class))).thenReturn(expectedResult); - Pagination actualResult = accountEntityService.search(getAccountEntitySearch(), errors); - assertEquals(expectedResult, actualResult); - - } - - @Test - public final void test_update() { - AccountEntity expextedResult = getAccountEntitys().get(0); - when(accountEntityRepository.update(any(AccountEntity.class))).thenReturn(expextedResult); - AccountEntity actualResult = accountEntityService.update(getAccountEntitys().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_fetch_related_data() { - List expextedResult = new ArrayList<>(); - expextedResult.add(getAccountDetaialType()); - List accountEntities = new ArrayList<>(); - accountEntities.add(getAccountEntity()); - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetaialType()); - List actualResult = accountEntityService.fetchRelated(accountEntities); - assertEquals(expextedResult.get(0).getId(), actualResult.get(0).getAccountDetailType().getId()); - assertEquals(expextedResult.get(0).getName(), actualResult.get(0).getAccountDetailType().getName()); - } - - @Test(expected = InvalidDataException.class) - public final void test_fetch_related_data_when_parentid_is_wrong() { - List expextedResult = new ArrayList<>(); - expextedResult.add(getAccountDetaialType()); - List accountEntities = new ArrayList<>(); - accountEntities.add(getAccountEntity()); - when(accountEntityRepository.findById(any(AccountEntity.class))).thenReturn(null); - accountEntityService.fetchRelated(accountEntities); - } - - private List getAccountEntitys() { - List accountEntities = new ArrayList(); - AccountEntity accountEntity = AccountEntity.builder().id("1").name("name").code("code").accountDetailType(getAccountDetaialType()).active(true).build(); - accountEntity.setTenantId("default"); - accountEntities.add(accountEntity); - return accountEntities; - } - - private AccountEntitySearch getAccountEntitySearch() { - AccountEntitySearch accountEntitySearch = new AccountEntitySearch(); - accountEntitySearch.setPageSize(0); - accountEntitySearch.setOffset(0); - accountEntitySearch.setSortBy("Sort"); - accountEntitySearch.setTenantId("default"); - return accountEntitySearch; - } - - private AccountEntity getAccountEntity() { - AccountEntity accountEntity = AccountEntity.builder().id("1").name("accountEntity").code("001").active(true) - .accountDetailType(getAccountDetaialType()).build(); - accountEntity.setTenantId("default"); - return accountEntity; - } - - private AccountDetailType getAccountDetaialType() { - - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("table") - .fullyQualifiedName("abc/table").build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankAccountServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankAccountServiceTest.java deleted file mode 100644 index 9464ac15d4e..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankAccountServiceTest.java +++ /dev/null @@ -1,211 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.CustomBindException; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.repository.BankAccountRepository; -import org.egov.egf.master.domain.repository.BankBranchRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.domain.repository.FundRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class BankAccountServiceTest { - - @InjectMocks - private BankAccountService bankAccountService; - - @Mock - private SmartValidator validator; - - @Mock - private BankAccountRepository bankAccountRepository; - - @Mock - private BankBranchRepository bankBranchRepository; - - @Mock - private ChartOfAccountRepository chartOfAccountRepository; - - @Mock - private FundRepository fundRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - private List bankAccounts = new ArrayList<>(); - - private RequestInfo requestInfo = new RequestInfo(); - - @Before - public void setup() { - - } - - @Test - public final void testCreate() { - bankAccounts.add(getBankAccount()); - when(bankBranchRepository.findById(any(BankBranch.class))).thenReturn(getBankBranch()); - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(fundRepository.findById(any(Fund.class))).thenReturn(getFund()); - when(bankAccountRepository.uniqueCheck(anyString(), any(BankAccount.class))).thenReturn(true); - bankAccountService.create(bankAccounts, errors, requestInfo); - } - - @Test - public final void testUpdate() { - bankAccounts.add(getBankAccount()); - when(bankBranchRepository.findById(any(BankBranch.class))).thenReturn(getBankBranch()); - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(fundRepository.findById(any(Fund.class))).thenReturn(getFund()); - when(bankAccountRepository.uniqueCheck(anyString(), any(BankAccount.class))).thenReturn(true); - bankAccountService.update(bankAccounts, errors, requestInfo); - } - - @Test - public final void test_save() { - BankAccount expextedResult = getBankAccount(); - when(bankAccountRepository.save(any(BankAccount.class))).thenReturn(getBankAccount()); - BankAccount actualResult = bankAccountService.save(getBankAccount()); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getBankAccount()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(bankAccountRepository.search(any(BankAccountSearch.class))).thenReturn(expectedResult); - Pagination actualResult = bankAccountService.search(getBankAccountSearch(), errors); - assertEquals(expectedResult, actualResult); - } - - @Test(expected = InvalidDataException.class) - public final void testSearchInvalid() { - List search = new ArrayList<>(); - search.add(getBankAccount()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(bankAccountRepository.search(any(BankAccountSearch.class))).thenReturn(expectedResult); - BankAccountSearch b = getBankAccountSearch(); - b.setTenantId(null); - Pagination actualResult = bankAccountService.search(b, errors); - } - - @Test - public final void testSave() { - BankAccount expectedResult = getBankAccount(); - when(bankAccountRepository.save(any(BankAccount.class))).thenReturn(expectedResult); - final BankAccount actualResult = bankAccountService.save(getBankAccount()); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void test_Update() { - BankAccount expectedResult = getBankAccount(); - when(bankAccountRepository.update(any(BankAccount.class))).thenReturn(expectedResult); - final BankAccount actualResult = bankAccountService.update(getBankAccount()); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void test_fetch_related_data() { - List expextedResult = new ArrayList<>(); - List bankAccounts = new ArrayList<>(); - expextedResult.add(getBankAccount()); - bankAccounts.add(getBankAccount()); - when(bankBranchRepository.findById(any(BankBranch.class))).thenReturn(getBankBranch()); - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(fundRepository.findById(any(Fund.class))).thenReturn(getFund()); - List actualResult = bankAccountService.fetchRelated(bankAccounts); - assertEquals(expextedResult.get(0).getBankBranch().getId(), actualResult.get(0).getBankBranch().getId()); - assertEquals(expextedResult.get(0).getFund().getId(), actualResult.get(0).getFund().getId()); - assertEquals(expextedResult.get(0).getChartOfAccount().getId(), - actualResult.get(0).getChartOfAccount().getId()); - } - - @Test(expected = CustomBindException.class) - public final void testCreateInvalid() { - bankAccounts.add(getBankAccount()); - when(bankBranchRepository.findById(any(BankBranch.class))).thenReturn(getBankBranch()); - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(fundRepository.findById(any(Fund.class))).thenReturn(getFund()); - when(bankAccountRepository.uniqueCheck(anyString(), any(BankAccount.class))).thenReturn(false); - bankAccountService.create(bankAccounts, errors, requestInfo); - } - - private Bank getBank() { - Bank bank = Bank.builder().id("1").code("code").description("description").build(); - bank.setTenantId("default"); - return bank; - } - - private BankBranch getBankBranch() { - BankBranch bankBranch = BankBranch.builder().code("code").build(); - bankBranch.setTenantId("default"); - bankBranch.setBank(getBank()); - return bankBranch; - } - - private ChartOfAccount getChartOfAccount() { - ChartOfAccount parent = ChartOfAccount.builder().id("parent").build(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder().glcode("glcode").name("name") - .description("description").isActiveForPosting(true).type('B').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setAccountCodePurpose(getAccountCodePurpose()); - chartOfAccount.setParentId(parent); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private AccountCodePurpose getAccountCodePurpose() { - AccountCodePurpose acp = AccountCodePurpose.builder().id("id").name("name").build(); - acp.setTenantId("default"); - return acp; - } - - private Fund getFund() { - return Fund.builder().id("1").code("code").build(); - } - - private BankAccount getBankAccount() { - return BankAccount.builder().id("1").chartOfAccount(getChartOfAccount()).fund(getFund()) - .bankBranch(getBankBranch()).build(); - } - - private BankAccountSearch getBankAccountSearch() { - BankAccountSearch bankAccountSearch = new BankAccountSearch(); - bankAccountSearch.setTenantId("default"); - bankAccountSearch.setPageSize(0); - bankAccountSearch.setOffset(0); - bankAccountSearch.setSortBy("Sort"); - return bankAccountSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankBranchServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankBranchServiceTest.java deleted file mode 100644 index 6cfd9edff52..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankBranchServiceTest.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.domain.repository.BankBranchRepository; -import org.egov.egf.master.domain.repository.BankRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class BankBranchServiceTest { - - @InjectMocks - private BankBranchService bankBranchService; - - @Mock - private SmartValidator validator; - - @Mock - private BankBranchRepository bankBranchRepository; - - @Mock - private BankRepository bankRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - private RequestInfo requestInfo = new RequestInfo(); - - private List bankBranches = new ArrayList<>(); - - @Before - public void setup() { - - } - - @Test - public final void testCreate() { - bankBranches.add(getBankBranch()); - when(bankRepository.findById(any(Bank.class))).thenReturn(getBank()); - when(bankBranchRepository.uniqueCheck(any(String.class), any(BankBranch.class))).thenReturn(true); - bankBranchService.create(bankBranches, errors, requestInfo); - } - - @Test - public final void testUpdate() { - bankBranches.add(getBankBranch()); - when(bankRepository.findById(any(Bank.class))).thenReturn(getBank()); - when(bankBranchRepository.uniqueCheck(any(String.class), any(BankBranch.class))).thenReturn(true); - bankBranchService.update(bankBranches, errors, requestInfo); - } - - @Test - public final void testCreateInvalid() { - BankBranch bankBranch = BankBranch.builder().id("a").code("code").name("name").active(true).build(); - when(bankBranchRepository.uniqueCheck(any(String.class), any(BankBranch.class))).thenReturn(true); - bankBranches.add(bankBranch); - bankBranchService.create(bankBranches, errors, requestInfo); - } - - @Test - public final void test_save() { - BankBranch expextedResult = getBankBranch(); - when(bankBranchRepository.save(any(BankBranch.class))).thenReturn(getBankBranch()); - BankBranch actualResult = bankBranchService.save(getBankBranch()); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getBankBranch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(bankBranchRepository.search(any(BankBranchSearch.class))).thenReturn(expectedResult); - Pagination actualResult = bankBranchService.search(getBankBranchSearch(), errors); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void testSave() { - BankBranch expectedResult = getBankBranch(); - when(bankBranchRepository.save(any(BankBranch.class))).thenReturn(expectedResult); - final BankBranch actualResult = bankBranchService.save(getBankBranch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void test_Update() { - BankBranch expectedResult = getBankBranch(); - when(bankBranchRepository.update(any(BankBranch.class))).thenReturn(expectedResult); - final BankBranch actualResult = bankBranchService.update(getBankBranch()); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void test_fetch_related_data() { - List expextedResult = new ArrayList<>(); - List bankBranches = new ArrayList<>(); - expextedResult.add(getBankBranch()); - bankBranches.add(getBankBranch()); - when(bankRepository.findById(any(Bank.class))).thenReturn(getBank()); - List actualResult = bankBranchService.fetchRelated(bankBranches); - assertEquals(expextedResult.get(0).getBank().getId(), actualResult.get(0).getBank().getId()); - } - - private BankBranch getBankBranch() { - return BankBranch.builder().id("1").code("code").name("name").bank(getBank()).description("description") - .build(); - } - - private Bank getBank() { - return Bank.builder().id("1").code("code").description("description").build(); - } - - private BankBranchSearch getBankBranchSearch() { - BankBranchSearch bankBranchSearch = new BankBranchSearch(); - bankBranchSearch.setPageSize(0); - bankBranchSearch.setOffset(0); - bankBranchSearch.setSortBy("Sort"); - bankBranchSearch.setTenantId("default"); - return bankBranchSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankServiceTest.java deleted file mode 100644 index 20b84e2eda8..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/BankServiceTest.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.domain.repository.BankRepository; -import org.egov.egf.master.domain.repository.FundRepository; -import org.egov.egf.master.persistence.repository.BankJdbcRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class BankServiceTest { - - @InjectMocks - private BankService bankService; - - @Mock - private SmartValidator validator; - - @Mock - private BankRepository bankRepository; - - @Mock - private BankJdbcRepository bankJdbcRepository; - - @Mock - private FundRepository fundRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - - private List banks = new ArrayList<>(); - - @Before - public void setup() { - - } - - @Test - public final void testCreate() { - banks.add(getBank()); - when(bankRepository.uniqueCheck(any(String.class), any(Bank.class))).thenReturn(true); - bankService.create(banks, errors, requestInfo); - } - - @Test - public final void testUpdate() { - banks.add(getBank()); - when(bankRepository.uniqueCheck(any(String.class), any(Bank.class))).thenReturn(true); - bankService.update(banks, errors, requestInfo); - } - - @Test - public final void testCreateInvalid() { - Bank bank = Bank.builder().id("a").code("code").name("name").active(true).build(); - banks.add(bank); - when(bankRepository.uniqueCheck(any(String.class), any(Bank.class))).thenReturn(true); - bankService.create(banks, errors, requestInfo); - } - - @Test - public final void test_save() { - banks.add(getBank()); - Bank expextedResult = banks.get(0); - when(bankRepository.save(any(Bank.class))).thenReturn(expextedResult); - Bank actualResult = bankService.save(banks.get(0)); - assertEquals(expextedResult, actualResult); - } - @Test - public final void testFetchRelated() { - banks.add(getBank()); - bankService.fetchRelated(banks); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getBank()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(bankRepository.search(any(BankSearch.class))).thenReturn(expectedResult); - Pagination actualResult = bankService.search(getBankSearch(), errors); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void testSave() { - Bank expectedResult = getBank(); - when(bankRepository.save(any(Bank.class))).thenReturn(expectedResult); - final Bank actualResult = bankService.save(getBank()); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void test_Update() { - Bank expectedResult = getBank(); - when(bankRepository.update(any(Bank.class))).thenReturn(expectedResult); - final Bank actualResult = bankService.update(getBank()); - assertEquals(expectedResult, actualResult); - } - - private Bank getBank() { - return Bank.builder().id("12212heuu").code("codeeeeee").name("nameeeee").description("description").build(); - } - - private BankSearch getBankSearch() { - BankSearch bankSearch = new BankSearch(); - bankSearch.setPageSize(0); - bankSearch.setOffset(0); - bankSearch.setSortBy("Sort"); - bankSearch.setTenantId("default"); - return bankSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/ChartOfAccountDetailServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/ChartOfAccountDetailServiceTest.java deleted file mode 100644 index 7f7922208f8..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/ChartOfAccountDetailServiceTest.java +++ /dev/null @@ -1,175 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.domain.repository.AccountDetailTypeRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountDetailRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.web.contract.AccountDetailTypeContract; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.egov.egf.master.web.contract.ChartOfAccountDetailContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class ChartOfAccountDetailServiceTest { - - @InjectMocks - ChartOfAccountDetailService chartOfAccountDetailService; - - @Mock - private SmartValidator validator; - - @Mock - private ChartOfAccountRepository chartOfAccountRepository; - - @Mock - private ChartOfAccountDetailRepository chartOfAccountDetailRepository; - - @Mock - private AccountDetailTypeRepository accountDetailTypeRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - private List chartOfAccountDetails = new ArrayList<>(); - - @Before - public void setup() { - - } - - @Test - public final void testFetchRelated() { - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); - chartOfAccountDetails.add(getChartOfAccountDetail()); - chartOfAccountDetailService.fetchRelated(chartOfAccountDetails); - } - - @Test - public final void testAdd(){ - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); - chartOfAccountDetails.add(getChartOfAccountDetail()); - chartOfAccountDetailService.add(chartOfAccountDetails, errors); - } - - @Test - public final void testUpdate(){ - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(accountDetailTypeRepository.findById(any(AccountDetailType.class))).thenReturn(getAccountDetailType()); - chartOfAccountDetails.add(getChartOfAccountDetail()); - chartOfAccountDetailService.update(chartOfAccountDetails, errors); - } - -/* @Test - public final void testAddToQue(){ - CommonRequest request = new CommonRequest<>(); - List coadcs = new ArrayList<>(); - ChartOfAccountDetailContract coadc = getChartOfAccountDetailContract(); - coadcs.add(coadc); - request.setData(coadcs); - chartOfAccountDetailService.addToQue(request); - verify(chartOfAccountDetailRepository).add(request); - }*/ - - @Test - public final void testSearch(){ - List search = new ArrayList<>(); - search.add(getChartOfAccountDetailSearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(chartOfAccountDetailRepository.search(any(ChartOfAccountDetailSearch.class))).thenReturn(expectedResult); - Pagination actualResult = chartOfAccountDetailService.search(getChartOfAccountDetailSearch(), errors); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void testSave(){ - ChartOfAccountDetail expectedResult = getChartOfAccountDetail(); - when(chartOfAccountDetailRepository.save(any(ChartOfAccountDetail.class))).thenReturn(expectedResult); - final ChartOfAccountDetail actualResult = chartOfAccountDetailService.save(getChartOfAccountDetail()); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void test_Update(){ - ChartOfAccountDetail expectedResult = getChartOfAccountDetail(); - when(chartOfAccountDetailRepository.update(any(ChartOfAccountDetail.class))).thenReturn(expectedResult); - final ChartOfAccountDetail actualResult = chartOfAccountDetailService.update(getChartOfAccountDetail()); - assertEquals(expectedResult, actualResult); - } - - private ChartOfAccountDetail getChartOfAccountDetail() { - ChartOfAccountDetail chartOfAccountDetail = ChartOfAccountDetail.builder().id("1").build(); - chartOfAccountDetail.setChartOfAccount(getChartOfAccount()); - chartOfAccountDetail.setAccountDetailType(getAccountDetailType()); - return chartOfAccountDetail; - } - - private ChartOfAccount getChartOfAccount(){ - ChartOfAccount chartOfAccount = ChartOfAccount.builder() - .glcode("glcode").name("name") - .description("description").isActiveForPosting(true) - .type('A').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private AccountDetailType getAccountDetailType(){ - AccountDetailType accountDetailType = AccountDetailType.builder() - .name("name").description("description").active(true).build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - - private ChartOfAccountDetailContract getChartOfAccountDetailContract(){ - ChartOfAccountDetailContract chartOfAccountDetailContract = ChartOfAccountDetailContract.builder().id("1").build(); - chartOfAccountDetailContract.setChartOfAccount(getChartofAccountContract()); - chartOfAccountDetailContract.setAccountDetailType(getAccountDetailTypeContract()); - return chartOfAccountDetailContract; - } - - private ChartOfAccountContract getChartofAccountContract(){ - ChartOfAccountContract chartOfAccountContract = ChartOfAccountContract.builder().glcode("glcode").name("name").type('A').isActiveForPosting(true).isActiveForPosting(true).build(); - return chartOfAccountContract; - } - - private AccountDetailTypeContract getAccountDetailTypeContract(){ - AccountDetailTypeContract accountDetailTypeContract = AccountDetailTypeContract.builder() - .name("name").description("description").active(true).build(); - accountDetailTypeContract.setTenantId("default"); - return accountDetailTypeContract; - } - - private ChartOfAccountDetailSearch getChartOfAccountDetailSearch(){ - ChartOfAccountDetailSearch chartOfAccountDetailSearch = new ChartOfAccountDetailSearch(); - chartOfAccountDetailSearch.setPageSize(0); - chartOfAccountDetailSearch.setOffset(0); - chartOfAccountDetailSearch.setSortBy("Sort"); - chartOfAccountDetailSearch.setTenantId("default"); - return chartOfAccountDetailSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/ChartOfAccountServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/ChartOfAccountServiceTest.java deleted file mode 100644 index a1449dd6445..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/ChartOfAccountServiceTest.java +++ /dev/null @@ -1,177 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.repository.AccountCodePurposeRepository; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.web.contract.ChartOfAccountContract; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class ChartOfAccountServiceTest { - - @InjectMocks - ChartOfAccountService chartOfAccountService; - - @Mock - private SmartValidator validator; - - @Mock - private ChartOfAccountRepository chartOfAccountRepository; - - @Mock - private AccountCodePurposeRepository accountCodePurposeRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - - private List chartOfAccounts = new ArrayList<>(); - - @Before - public void setup() { - - } - - @Test - public final void testFetchRelated() { - when(accountCodePurposeRepository.findById(any(AccountCodePurpose.class))).thenReturn(getAccountCodePurpose()); - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - chartOfAccounts.add(getChartOfAccount()); - chartOfAccountService.fetchRelated(chartOfAccounts); - - } - - @Test - public final void testAdd() { - when(accountCodePurposeRepository.findById(any(AccountCodePurpose.class))).thenReturn(getAccountCodePurpose()); - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - when(chartOfAccountRepository.uniqueCheck(any(String.class), any(ChartOfAccount.class))).thenReturn(true); - chartOfAccounts.add(getChartOfAccount()); - chartOfAccountService.add(chartOfAccounts, errors); - } - - @Test - public final void testUpdate() { - when(accountCodePurposeRepository.findById(any(AccountCodePurpose.class))).thenReturn(getAccountCodePurpose()); - when(chartOfAccountRepository.findById(any(ChartOfAccount.class))).thenReturn(getChartOfAccount()); - chartOfAccounts.add(getChartOfAccount()); - when(chartOfAccountRepository.uniqueCheck(any(String.class), any(ChartOfAccount.class))).thenReturn(true); - chartOfAccountService.update(chartOfAccounts, errors); - } - - @Test - public final void testSave() { - ChartOfAccount expectedResult = getChartOfAccount(); - when(chartOfAccountRepository.save(any(ChartOfAccount.class))).thenReturn(expectedResult); - final ChartOfAccount actualResult = chartOfAccountService.save(getChartOfAccount()); - assertEquals(expectedResult, actualResult); - } - - @Test - public final void test_Update(){ - ChartOfAccount expectedResult = getChartOfAccount(); - when(chartOfAccountRepository.update(any(ChartOfAccount.class))).thenReturn(expectedResult); - final ChartOfAccount actualResult = chartOfAccountService.update(getChartOfAccount()); - assertEquals(expectedResult, actualResult); - } - -/* @Test - public final void testAddToQue(){ - CommonRequest request = new CommonRequest<>(); - List coas = new ArrayList<>(); - ChartOfAccountContract coa = getChartOfAccountContract(); - coas.add(coa); - request.setData(coas); - chartOfAccountService.addToQue(request); - verify(chartOfAccountRepository).add(request); - }*/ - - @Test - public final void testSearch(){ - List search = new ArrayList<>(); - search.add(getChartOfAccountSearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(chartOfAccountRepository.search(any(ChartOfAccountSearch.class))).thenReturn(expectedResult); - Pagination actualResult = chartOfAccountService.search(getChartOfAccountSearch(), errors); - assertEquals(expectedResult, actualResult); - } - - private ChartOfAccount getChartOfAccount() { - ChartOfAccount parent = ChartOfAccount.builder().id("parent").build(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("1") - .glcode("GLCode").name("AadharBank") - .description("DefaultDescription").isActiveForPosting(true) - .type('B').classification((long) 123456).functionRequired(true) - .budgetCheckRequired(true).build(); - chartOfAccount.setAccountCodePurpose(getAccountCodePurpose()); - chartOfAccount.setParentId(parent); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private AccountCodePurpose getAccountCodePurpose() { - AccountCodePurpose acp = AccountCodePurpose.builder().id("id") - .name("name").build(); - acp.setTenantId("default"); - return acp; - } - - private ChartOfAccountContract getChartOfAccountContract(){ - ChartOfAccountContract coac = ChartOfAccountContract.builder().glcode("glcode").name("name").description("description").budgetCheckRequired(true).isActiveForPosting(true).build(); - //coac.setParentId(getChartOfAccountContract().getParentId()); - return coac; - } - - private List getChartOfAccounts() { - List chartOfAccounts = new ArrayList(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder() - .glcode("GLCode").name("AadharBank") - .description("DefaultDescription").isActiveForPosting(true) - .type('B').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - chartOfAccounts.add(chartOfAccount); - return chartOfAccounts; - } - - private Pagination getPagination(){ - Pagination pgn = new Pagination<>(); - pgn.setCurrentPage(0); - pgn.setOffset(0); - pgn.setPageSize(500); - pgn.setTotalPages(1); - pgn.setTotalResults(1); - pgn.setPagedData(getChartOfAccounts()); - return pgn; - } - - private ChartOfAccountSearch getChartOfAccountSearch(){ - ChartOfAccountSearch chartOfAccountSearch = new ChartOfAccountSearch(); - chartOfAccountSearch.setPageSize(0); - chartOfAccountSearch.setOffset(0); - chartOfAccountSearch.setSortBy("Sort"); - chartOfAccountSearch.setTenantId("default"); - return chartOfAccountSearch; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/FunctionServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/FunctionServiceTest.java deleted file mode 100644 index 8c7292845eb..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/FunctionServiceTest.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.common.util.ApplicationThreadLocals; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.domain.repository.FunctionRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class FunctionServiceTest { - - @InjectMocks - private FunctionService functionService; - - @Mock - private SmartValidator validator; - - @Mock - private FunctionRepository functionRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - private List functions = new ArrayList<>(); - - @Before - public void setup() { - } - - @Test - public final void testCreate() { - when(functionRepository.findById(any(Function.class))).thenReturn(getParentFunction()); - when(functionRepository.uniqueCheck(any(String.class), any(Function.class))).thenReturn(true); - functionService.create(getFunctions(), errors, requestInfo); - } - - @Test - public final void testUpdate() { - when(functionRepository.findById(any(Function.class))).thenReturn(getParentFunction()); - when(functionRepository.uniqueCheck(any(String.class), any(Function.class))).thenReturn(true); - functionService.update(getFunctions(), errors, requestInfo); - } - - @Test - public final void testCreateInvalid() { - Function function1 = Function.builder().id("a").code("code").active(true).parentId(null).level(1).build(); - functions.add(function1); - when(functionRepository.uniqueCheck(any(String.class), any(Function.class))).thenReturn(true); - functionService.create(functions, errors, requestInfo); - } - - @Test - public final void test_save() { - Function expextedResult = getFunctions().get(0); - when(functionRepository.save(any(Function.class))).thenReturn(expextedResult); - Function actualResult = functionService.save(getFunctions().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getFunctionSearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(functionRepository.search(any(FunctionSearch.class))).thenReturn(expectedResult); - Pagination actualResult = functionService.search(getFunctionSearch(), errors); - assertEquals(expectedResult, actualResult); - - } - - @Test - public final void test_update() { - Function expextedResult = getFunctions().get(0); - when(functionRepository.update(any(Function.class))).thenReturn(expextedResult); - Function actualResult = functionService.update(getFunctions().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_fetch_related_data() { - List expextedResult = new ArrayList<>(); - expextedResult.add(getParentFunction()); - List functions = new ArrayList<>(); - functions.add(getFunction()); - when(functionRepository.findById(any(Function.class))).thenReturn(getParentFunction()); - List actualResult = functionService.fetchRelated(functions); - assertEquals(expextedResult.get(0).getId(), actualResult.get(0).getParentId().getId()); - assertEquals(expextedResult.get(0).getName(), actualResult.get(0).getParentId().getName()); - } - - @Test(expected = InvalidDataException.class) - public final void test_fetch_related_data_when_parentid_is_wrong() { - List expextedResult = new ArrayList<>(); - expextedResult.add(getParentFunction()); - List functions = new ArrayList<>(); - functions.add(getFunction()); - ApplicationThreadLocals.setTenantId("default"); - when(functionRepository.findById(any(Function.class))).thenReturn(null); - functionService.fetchRelated(functions); - } - - private List getFunctions() { - List functions = new ArrayList(); - Function function = Function.builder().id("1").name("name").code("code").level(1).parentId(getParentFunction()).active(true).build(); - function.setTenantId("default"); - functions.add(function); - return functions; - } - - private FunctionSearch getFunctionSearch() { - FunctionSearch functionSearch = new FunctionSearch(); - functionSearch.setPageSize(0); - functionSearch.setOffset(0); - functionSearch.setSortBy("Sort"); - functionSearch.setTenantId("default"); - return functionSearch; - } - - private Function getFunction() { - Function function = Function.builder().id("1").name("function").code("001").active(true) - .parentId(getParentFunction()).level(1).build(); - function.setTenantId("default"); - return function; - } - - private Function getParentFunction() { - Function function = Function.builder().id("2").name("functionParent").code("002").active(true).parentId(null) - .level(1).build(); - return function; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/FundServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/FundServiceTest.java deleted file mode 100644 index 4ca21293a19..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/FundServiceTest.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.domain.repository.FundRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class FundServiceTest { - - @InjectMocks - private FundService fundService; - - @Mock - private SmartValidator validator; - - @Mock - private FundRepository fundRepository; - - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - private List funds = new ArrayList<>(); - - @Before - public void setup() { - } - - /*@Test - public final void testCreate() { - when(fundRepository.findById(any(Fund.class))).thenReturn(getParentFund()); - fundService.create(getFunds(), errors, requestInfo); - }*/ -/* - @Test - public final void testUpdate() { - when(fundRepository.findById(any(Fund.class))).thenReturn(getParentFund()); - fundService.update(getFunds(), errors, requestInfo); - }*/ - -/* @Test - public final void testCreateInvalid() { - Fund fund1 = Fund.builder().id("a").code("code").identifier('I').active(true).parent(null).level(1234l).build(); - funds.add(fund1); - fundService.create(funds, errors, requestInfo); - } -*/ - @Test - public final void test_save() { - Fund expextedResult = getFunds().get(0); - when(fundRepository.save(any(Fund.class))).thenReturn(expextedResult); - Fund actualResult = fundService.save(getFunds().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void testSearch() { - List search = new ArrayList<>(); - search.add(getFundSearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(fundRepository.search(any(FundSearch.class))).thenReturn(expectedResult); - Pagination actualResult = fundService.search(getFundSearch(), errors); - assertEquals(expectedResult, actualResult); - - } - - @Test - public final void test_update() { - Fund expextedResult = getFunds().get(0); - when(fundRepository.update(any(Fund.class))).thenReturn(expextedResult); - Fund actualResult = fundService.update(getFunds().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_fetch_related_data() { - List expextedResult = new ArrayList<>(); - expextedResult.add(getParentFund()); - when(fundRepository.findById(any(Fund.class))).thenReturn(getParentFund()); - List actualResult = fundService.fetchRelated(getFunds()); - assertEquals(expextedResult.get(0).getId(), actualResult.get(0).getParent().getId()); - assertEquals(expextedResult.get(0).getName(), actualResult.get(0).getParent().getName()); - } - - private List getFunds() { - List funds = new ArrayList(); - Fund fund = Fund.builder().id("1").name("name").code("code").identifier('I').parent(getParentFund()) - .level(1234l).active(true).build(); - fund.setTenantId("default"); - funds.add(fund); - return funds; - } - - private Fund getParentFund() { - return Fund.builder().id("2").name("nameP").code("codeP").identifier('P').parent(null).level(1234l).active(true) - .build(); - } - - private FundSearch getFundSearch() { - FundSearch fundSearch = new FundSearch(); - fundSearch.setPageSize(0); - fundSearch.setOffset(0); - fundSearch.setSortBy("Sort"); - fundSearch.setTenantId("default"); - return fundSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/RecoveryServiceTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/RecoveryServiceTest.java deleted file mode 100644 index 03a094c62f2..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/domain/service/RecoveryServiceTest.java +++ /dev/null @@ -1,154 +0,0 @@ -package org.egov.egf.master.domain.service; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.domain.repository.ChartOfAccountRepository; -import org.egov.egf.master.domain.repository.RecoveryRepository; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.validation.BeanPropertyBindingResult; -import org.springframework.validation.BindingResult; -import org.springframework.validation.SmartValidator; - -@Import(TestConfiguration.class) -@RunWith(SpringRunner.class) -public class RecoveryServiceTest { - - @InjectMocks - private RecoveryService recoveryService; - - @Mock - private SmartValidator validator; - - @Mock - private RecoveryRepository recoveryRepository; - - @Mock - private ChartOfAccountRepository chartOfAccountRepository; - private BindingResult errors = new BeanPropertyBindingResult(null, null); - private RequestInfo requestInfo = new RequestInfo(); - private List recoverys = new ArrayList<>(); - - @Before - public void setup() { - } - - @Test - public final void test_create() { - when(chartOfAccountRepository.search(any(ChartOfAccountSearch.class))).thenReturn(getPagination()); - when(recoveryRepository.uniqueCheck(any(String.class), any(Recovery.class))).thenReturn(true); - recoveryService.create(getRecoverys(), errors, requestInfo); - } - - @Test - public final void test_update() { - when(chartOfAccountRepository.search(any(ChartOfAccountSearch.class))).thenReturn(getPagination()); - when(recoveryRepository.uniqueCheck(any(String.class), any(Recovery.class))).thenReturn(true); - recoveryService.update(getRecoverys(), errors, requestInfo); - } - - @Test - public final void test_createinvalid() { - Recovery recovery1 = Recovery.builder().name("name").code("code").type("M").mode('M').remittanceMode('M').active(true).build(); - recoverys.add(recovery1); - when(recoveryRepository.uniqueCheck(any(String.class), any(Recovery.class))).thenReturn(true); - recoveryService.create(recoverys, errors, requestInfo); - } - - @Test - public final void test_save() { - Recovery expextedResult = getRecoverys().get(0); - when(recoveryRepository.save(any(Recovery.class))).thenReturn(expextedResult); - Recovery actualResult = recoveryService.save(getRecoverys().get(0)); - assertEquals(expextedResult, actualResult); - } - - @Test - public final void test_search() { - List search = new ArrayList<>(); - search.add(getRecoverySearch()); - Pagination expectedResult = new Pagination<>(); - expectedResult.setPagedData(search); - when(recoveryRepository.search(any(RecoverySearch.class))).thenReturn(expectedResult); - Pagination actualResult = recoveryService.search(getRecoverySearch(), errors); - assertEquals(expectedResult, actualResult); - - } - - @Test - public final void test_updatee() { - Recovery expextedResult = getRecoverys().get(0); - when(recoveryRepository.update(any(Recovery.class))).thenReturn(expextedResult); - Recovery actualResult = recoveryService.update(getRecoverys().get(0)); - assertEquals(expextedResult, actualResult); - } - - private List getRecoverys() { - List recoverys = new ArrayList(); - Recovery recovery = Recovery.builder().name("name").code("code").type("M").mode('M').remittanceMode('M').active(true).build(); - recovery.setTenantId("default"); - recovery.setChartOfAccount(getCOAccount()); - recovery.setRemitted("S"); - recovery.setIfscCode("SBIN0005532"); - recovery.setAccountNumber("3049223457"); - recovery.setId("1"); - recoverys.add(recovery); - return recoverys; - } - - private ChartOfAccount getCOAccount() { - ChartOfAccount chartOfAccount = new ChartOfAccount(); - chartOfAccount.setGlcode("341"); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private RecoverySearch getRecoverySearch() { - RecoverySearch recoverySearch = new RecoverySearch(); - recoverySearch.setPageSize(0); - recoverySearch.setOffset(0); - recoverySearch.setSortBy("Sort"); - recoverySearch.setTenantId("default"); - return recoverySearch; - } - - private Pagination getPagination(){ - Pagination pgn = new Pagination<>(); - pgn.setCurrentPage(0); - pgn.setOffset(0); - pgn.setPageSize(500); - pgn.setTotalPages(1); - pgn.setTotalResults(1); - pgn.setPagedData(getChartOfAccounts()); - return pgn; - } - - private List getChartOfAccounts() { - List chartOfAccounts = new ArrayList(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder() - .glcode("GLCode").name("AadharBank") - .description("DefaultDescription").isActiveForPosting(true) - .type('B').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - chartOfAccounts.add(chartOfAccount); - return chartOfAccounts; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountCodePurposeJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountCodePurposeJdbcRepositoryTest.java deleted file mode 100644 index 8ec8a2dec77..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountCodePurposeJdbcRepositoryTest.java +++ /dev/null @@ -1,186 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.persistence.entity.AccountCodePurposeEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class AccountCodePurposeJdbcRepositoryTest { - - private AccountCodePurposeJdbcRepository accountCodePurposeJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - accountCodePurposeJdbcRepository = new AccountCodePurposeJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql" }) - public void test_create() { - - AccountCodePurposeEntity accountCodePurpose = AccountCodePurposeEntity.builder().id("1").name("name").build(); - accountCodePurpose.setTenantId("default"); - AccountCodePurposeEntity actualResult = accountCodePurposeJdbcRepository.create(accountCodePurpose); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountCodePurpose", - new AccountCodePurposeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql" }) - public void test_create_with_tenantId_null() { - - AccountCodePurposeEntity accountCodePurpose = AccountCodePurposeEntity.builder().name("name").build(); - accountCodePurposeJdbcRepository.create(accountCodePurpose); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql", "/sql/insertAccountCodePurposeData.sql" }) - public void test_update() { - - AccountCodePurposeEntity accountCodePurpose = AccountCodePurposeEntity.builder().id("1").name("nameU").build(); - accountCodePurpose.setTenantId("default"); - AccountCodePurposeEntity actualResult = accountCodePurposeJdbcRepository.update(accountCodePurpose); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountCodePurpose", - new AccountCodePurposeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql", "/sql/insertAccountCodePurposeData.sql" }) - public void test_search() { - - Pagination page = (Pagination) accountCodePurposeJdbcRepository - .search(getAccountCodePurposeSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql", "/sql/insertAccountCodePurposeData.sql" }) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) accountCodePurposeJdbcRepository - .search(new AccountCodePurposeSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql", "/sql/insertAccountCodePurposeData.sql" }) - public void test_find_by_id() { - - AccountCodePurposeEntity accountCodePurposeEntity = AccountCodePurposeEntity.builder().id("1").build(); - accountCodePurposeEntity.setTenantId("default"); - AccountCodePurposeEntity result = accountCodePurposeJdbcRepository.findById(accountCodePurposeEntity); - assertThat(result.getId()).isEqualTo("1"); - assertThat(result.getName()).isEqualTo("name"); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql", "/sql/insertAccountCodePurposeData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - AccountCodePurposeEntity accountCodePurposeEntity = AccountCodePurposeEntity.builder().id("5").build(); - accountCodePurposeEntity.setTenantId("default"); - AccountCodePurposeEntity result = accountCodePurposeJdbcRepository.findById(accountCodePurposeEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql", "/sql/insertAccountCodePurposeData.sql" }) - public void test_search_invalid_sort_option() { - - AccountCodePurposeSearch search = getAccountCodePurposeSearch(); - search.setSortBy("desc"); - accountCodePurposeJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountCodePurpose.sql", "/sql/insertAccountCodePurposeData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - AccountCodePurposeSearch search = getAccountCodePurposeSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) accountCodePurposeJdbcRepository - .search(getAccountCodePurposeSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - - } - - class AccountCodePurposeResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private AccountCodePurposeSearch getAccountCodePurposeSearch() { - AccountCodePurposeSearch accountCodePurposeSearch = new AccountCodePurposeSearch(); - accountCodePurposeSearch.setId("1"); - accountCodePurposeSearch.setName("name"); - accountCodePurposeSearch.setPageSize(500); - accountCodePurposeSearch.setOffset(0); - accountCodePurposeSearch.setSortBy("name desc"); - return accountCodePurposeSearch; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountDetailKeyJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountDetailKeyJdbcRepositoryTest.java deleted file mode 100644 index 767bf0befe8..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountDetailKeyJdbcRepositoryTest.java +++ /dev/null @@ -1,201 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.persistence.entity.AccountDetailKeyEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class AccountDetailKeyJdbcRepositoryTest { - - private AccountDetailKeyJdbcRepository accountDetailKeyJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - accountDetailKeyJdbcRepository = new AccountDetailKeyJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailKey.sql" }) - public void test_create() { - - AccountDetailKeyEntity accountDetailKey = AccountDetailKeyEntity.builder().id("1").key("1") - .accountDetailTypeId(getAccountDetailType().getId()).build(); - accountDetailKey.setTenantId("default"); - AccountDetailKeyEntity actualResult = accountDetailKeyJdbcRepository.create(accountDetailKey); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountDetailKey", - new AccountDetailKeyResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("key")).isEqualTo(actualResult.getKey()); - - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearAccountDetailKey.sql" }) - public void test_create_with_tenantId_null() { - - AccountDetailKeyEntity accountDetailKey = AccountDetailKeyEntity.builder().id("1").key("1") - .accountDetailTypeId(getAccountDetailType().getId()).build(); - accountDetailKeyJdbcRepository.create(accountDetailKey); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailKey.sql", "/sql/insertAccountDetailKey.sql" }) - public void test_update() { - - AccountDetailKeyEntity accountDetailKey = AccountDetailKeyEntity.builder().id("1").key("1") - .accountDetailTypeId(getAccountDetailType().getId()).build(); - accountDetailKey.setTenantId("default"); - AccountDetailKeyEntity actualResult = accountDetailKeyJdbcRepository.update(accountDetailKey); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountDetailKey", - new AccountDetailKeyResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("key")).isEqualTo(actualResult.getKey()); - assertThat(row.get("accountDetailTypeId")).isEqualTo(actualResult.getAccountDetailTypeId()); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailKey.sql", "/sql/insertAccountDetailKey.sql" }) - public void test_search() { - - Pagination page = (Pagination) accountDetailKeyJdbcRepository - .search(getAccountDetailKeySearch()); - assertThat(page.getPagedData().get(0).getKey()).isEqualTo("1"); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailKey.sql", "/sql/insertAccountDetailKey.sql" }) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) accountDetailKeyJdbcRepository - .search(new AccountDetailKeySearch()); - assertThat(page.getPagedData().get(0).getKey()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getAccountDetailType().getId()).isEqualTo(getAccountDetailType().getId()); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailKey.sql", "/sql/insertAccountDetailKey.sql" }) - public void test_find_by_id() { - - AccountDetailKeyEntity accountDetailKeyEntity = AccountDetailKeyEntity.builder().id("1").build(); - accountDetailKeyEntity.setTenantId("default"); - AccountDetailKeyEntity result = accountDetailKeyJdbcRepository.findById(accountDetailKeyEntity); - assertThat(result.getId()).isEqualTo("1"); - assertThat(result.getKey()).isEqualTo("1"); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailKey.sql", "/sql/insertAccountDetailKey.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - AccountDetailKeyEntity accountDetailKeyEntity = AccountDetailKeyEntity.builder().id("5").build(); - accountDetailKeyEntity.setTenantId("default"); - AccountDetailKeyEntity result = accountDetailKeyJdbcRepository.findById(accountDetailKeyEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearAccountDetailKey.sql", "/sql/insertAccountDetailKey.sql" }) - public void test_search_invalid_sort_option() { - - AccountDetailKeySearch search = getAccountDetailKeySearch(); - search.setSortBy("desc"); - accountDetailKeyJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailKey.sql", "/sql/insertAccountDetailKey.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - AccountDetailKeySearch search = getAccountDetailKeySearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) accountDetailKeyJdbcRepository - .search(getAccountDetailKeySearch()); - assertThat(page.getPagedData().get(0).getKey()).isEqualTo("1"); - - } - - class AccountDetailKeyResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("key", resultSet.getString("key")); - put("accountDetailTypeId", resultSet.getString("accountDetailTypeId")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private AccountDetailKeySearch getAccountDetailKeySearch() { - AccountDetailKeySearch accountDetailKeySearch = new AccountDetailKeySearch(); - accountDetailKeySearch.setId("1"); - accountDetailKeySearch.setKey("1"); - accountDetailKeySearch.setAccountDetailType(getAccountDetailType()); - accountDetailKeySearch.setPageSize(500); - accountDetailKeySearch.setOffset(0); - accountDetailKeySearch.setSortBy("key desc"); - accountDetailKeySearch.setTenantId("default"); - return accountDetailKeySearch; - } - - private AccountDetailType getAccountDetailType() { - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("contractor") - .fullyQualifiedName("abc/acb").active(true).build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountDetailTypeJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountDetailTypeJdbcRepositoryTest.java deleted file mode 100644 index b53fc6270f0..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountDetailTypeJdbcRepositoryTest.java +++ /dev/null @@ -1,201 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.persistence.entity.AccountDetailTypeEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class AccountDetailTypeJdbcRepositoryTest { - - private AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - accountDetailTypeJdbcRepository = new AccountDetailTypeJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailType.sql" }) - public void test_create() { - - AccountDetailTypeEntity accountDetailType = AccountDetailTypeEntity.builder().id("1").tablename("contractor") - .description("contractor").fullyQualifiedName("abc/contractor").name("name").active(true).build(); - accountDetailType.setTenantId("default"); - AccountDetailTypeEntity actualResult = accountDetailTypeJdbcRepository.create(accountDetailType); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountDetailType", - new AccountDetailTypeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("tableName")).isEqualTo(actualResult.getTablename()); - assertThat(row.get("fullyQualifiedName")).isEqualTo(actualResult.getFullyQualifiedName()); - - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearAccountDetailType.sql" }) - public void test_create_with_tenantId_null() { - - AccountDetailTypeEntity accountDetailType = AccountDetailTypeEntity.builder().tablename("contractor") - .fullyQualifiedName("abc/contractor").name("name").active(true).build(); - accountDetailTypeJdbcRepository.create(accountDetailType); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailType.sql", "/sql/insertAccountDetailType.sql" }) - public void test_update() { - - AccountDetailTypeEntity accountDetailType = AccountDetailTypeEntity.builder().tablename("contractorU") - .description("contractor").fullyQualifiedName("abc/contractorU").name("nameU").active(true).id("1") - .build(); - accountDetailType.setTenantId("default"); - AccountDetailTypeEntity actualResult = accountDetailTypeJdbcRepository.update(accountDetailType); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountDetailType", - new AccountDetailTypeResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailType.sql", "/sql/insertAccountDetailType.sql" }) - public void test_search() { - - Pagination page = (Pagination) accountDetailTypeJdbcRepository - .search(getAccountDetailTypeSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailType.sql", "/sql/insertAccountDetailType.sql" }) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) accountDetailTypeJdbcRepository - .search(new AccountDetailTypeSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailType.sql", "/sql/insertAccountDetailType.sql" }) - public void test_find_by_id() { - - AccountDetailTypeEntity accountDetailTypeEntity = AccountDetailTypeEntity.builder().id("1").build(); - accountDetailTypeEntity.setTenantId("default"); - AccountDetailTypeEntity result = accountDetailTypeJdbcRepository.findById(accountDetailTypeEntity); - assertThat(result.getId()).isEqualTo("1"); - assertThat(result.getName()).isEqualTo("name"); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailType.sql", "/sql/insertAccountDetailType.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - AccountDetailTypeEntity accountDetailTypeEntity = AccountDetailTypeEntity.builder().id("5").build(); - accountDetailTypeEntity.setTenantId("default"); - AccountDetailTypeEntity result = accountDetailTypeJdbcRepository.findById(accountDetailTypeEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearAccountDetailType.sql", "/sql/insertAccountDetailType.sql" }) - public void test_search_invalid_sort_option() { - - AccountDetailTypeSearch search = getAccountDetailTypeSearch(); - search.setSortBy("desc"); - accountDetailTypeJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearAccountDetailType.sql", "/sql/insertAccountDetailType.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - AccountDetailTypeSearch search = getAccountDetailTypeSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) accountDetailTypeJdbcRepository - .search(getAccountDetailTypeSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - class AccountDetailTypeResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("tableName", resultSet.getString("tableName")); - put("active", resultSet.getBoolean("active")); - put("fullyQualifiedName", resultSet.getString("fullyQualifiedName")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private AccountDetailTypeSearch getAccountDetailTypeSearch() { - AccountDetailTypeSearch accountDetailTypeSearch = new AccountDetailTypeSearch(); - accountDetailTypeSearch.setId("1"); - accountDetailTypeSearch.setName("name"); - accountDetailTypeSearch.setTableName("contractor"); - accountDetailTypeSearch.setActive(true); - accountDetailTypeSearch.setFullyQualifiedName("abc/contractor"); - accountDetailTypeSearch.setPageSize(500); - accountDetailTypeSearch.setOffset(0); - accountDetailTypeSearch.setSortBy("name desc"); - return accountDetailTypeSearch; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountEntityJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountEntityJdbcRepositoryTest.java deleted file mode 100644 index 5a5667b93ff..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/AccountEntityJdbcRepositoryTest.java +++ /dev/null @@ -1,212 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.persistence.entity.AccountEntityEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class AccountEntityJdbcRepositoryTest { - - private AccountEntityJdbcRepository accountEntityJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - accountEntityJdbcRepository = new AccountEntityJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = {"/sql/clearAccountEntity.sql"}) - public void test_create() { - - AccountEntityEntity accountEntity = AccountEntityEntity.builder().id("1").code("code").name("name").active(true) - .accountDetailTypeId(getAccountDetaialType().getId()).description("entity").build(); - accountEntity.setTenantId("default"); - AccountEntityEntity actualResult = accountEntityJdbcRepository.create(accountEntity); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountEntity", - new AccountEntityResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - assertThat(row.get("accountDetailTypeId")).isEqualTo(actualResult.getAccountDetailTypeId()); - - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = {"/sql/clearAccountEntity.sql"}) - public void test_create_with_tenantId_null() { - - AccountEntityEntity accountEntity = AccountEntityEntity.builder().code("code").name("name").active(true) - .accountDetailTypeId(getAccountDetaialType().getId()).description("entity").build(); - accountEntityJdbcRepository.create(accountEntity); - - } - - @Test - @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) - public void test_update() { - - AccountEntityEntity accountEntity = AccountEntityEntity.builder().code("codeU").name("nameU").active(true).id("1") - .accountDetailTypeId(getAccountDetaialType().getId()).description("entity").build(); - accountEntity.setTenantId("default"); - AccountEntityEntity actualResult = accountEntityJdbcRepository.update(accountEntity); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_accountEntity", - new AccountEntityResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - - } - - @Test - @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) - public void test_search() { - - Pagination page = (Pagination) accountEntityJdbcRepository.search(getAccountEntitySearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) accountEntityJdbcRepository.search(new AccountEntitySearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) - public void test_find_by_id() { - - AccountEntityEntity accountEntityEntity = AccountEntityEntity.builder().id("1").build(); - accountEntityEntity.setTenantId("default"); - AccountEntityEntity result = accountEntityJdbcRepository.findById(accountEntityEntity); - assertThat(result.getId()).isEqualTo("1"); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getCode()).isEqualTo("code"); - - } - - @Test - @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) - public void test_find_by_invalid_id_should_return_null() { - - AccountEntityEntity accountEntityEntity = AccountEntityEntity.builder().id("5").build(); - accountEntityEntity.setTenantId("default"); - AccountEntityEntity result = accountEntityJdbcRepository.findById(accountEntityEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) - public void test_search_invalid_sort_option() { - - AccountEntitySearch search = getAccountEntitySearch(); - search.setSortBy("desc"); - accountEntityJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = {"/sql/clearAccountEntity.sql", "/sql/insertAccountEntity.sql"}) - public void test_search_without_pagesize_offset_sortby() { - - AccountEntitySearch search = getAccountEntitySearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) accountEntityJdbcRepository.search(getAccountEntitySearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - private AccountEntitySearch getAccountEntitySearch() { - AccountEntitySearch accountEntitySearch = new AccountEntitySearch(); - accountEntitySearch.setId("1"); - accountEntitySearch.setName("name"); - accountEntitySearch.setCode("code"); - accountEntitySearch.setActive(true); - accountEntitySearch.setAccountDetailType(getAccountDetaialType()); - accountEntitySearch.setDescription("entity"); - accountEntitySearch.setPageSize(500); - accountEntitySearch.setOffset(0); - accountEntitySearch.setSortBy("name desc"); - return accountEntitySearch; - } - - private AccountDetailType getAccountDetaialType() { - - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("table") - .fullyQualifiedName("abc/table").build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - - class AccountEntityResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("code", resultSet.getString("code")); - put("active", resultSet.getBoolean("active")); - put("accountDetailTypeId", resultSet.getString("accountDetailTypeId")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - put("description", resultSet.getString("description")); - - } - }; - - rows.add(row); - } - return rows; - } - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankAccountJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankAccountJdbcRepositoryTest.java deleted file mode 100644 index aa25e3f11d0..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankAccountJdbcRepositoryTest.java +++ /dev/null @@ -1,238 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.enums.BankAccountType; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.persistence.entity.BankAccountEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class BankAccountJdbcRepositoryTest { - - private BankAccountJdbcRepository bankAccountJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - bankAccountJdbcRepository = new BankAccountJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearBankAccount.sql" }) - public void testCreate() { - BankAccountEntity bankAccountEntity = getBankAccountEntity(); - BankAccountEntity actualResult = bankAccountJdbcRepository.create(bankAccountEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_bankaccount", - new BankAccountResultExtractor()); - Map row = result.get(0); - assertThat(row.get("accountNumber")).isEqualTo(actualResult.getAccountNumber()); - } - - @Test - @Sql(scripts = { "/sql/clearBankAccount.sql", "/sql/insertBankAccount.sql" }) - public void testUpdate() { - BankAccountEntity bankAccountEntity = getBankAccountEntity(); - BankAccountEntity actualResult = bankAccountJdbcRepository.update(bankAccountEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_bankaccount", - new BankAccountResultExtractor()); - Map row = result.get(0); - assertThat(row.get("accountNumber")).isEqualTo(actualResult.getAccountNumber()); - } - - @Test - @Sql(scripts = { "/sql/clearBankAccount.sql", "/sql/insertBankAccount.sql" }) - public void testSearch() { - Pagination page = (Pagination) bankAccountJdbcRepository - .search(getBankAccountSearch()); - assertThat(page.getPagedData().get(0).getAccountNumber()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - } - - @Test - @Sql(scripts = { "/sql/clearBankAccount.sql", "/sql/insertBankAccount.sql" }) - public void testFindById() { - BankAccountEntity bankAccountEntity = BankAccountEntity.builder().id("1").build(); - bankAccountEntity.setTenantId("default"); - BankAccountEntity result = bankAccountJdbcRepository.findById(bankAccountEntity); - assertThat(result.getId()).isEqualTo("1"); - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearBankAccount.sql" }) - public void test_create_with_tenantId_null() { - - BankAccountEntity bankAccount = BankAccountEntity.builder().accountNumber("001").active(true).build(); - bankAccountJdbcRepository.create(bankAccount); - - } - - @Test - @Sql(scripts = { "/sql/clearBankAccount.sql", "/sql/insertBankAccount.sql" }) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) bankAccountJdbcRepository - .search(new BankAccountSearch()); - assertThat(page.getPagedData().get(0).getAccountNumber()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearBankAccount.sql", "/sql/insertBankAccount.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - BankAccountEntity bankAccountEntity = BankAccountEntity.builder().id("5").build(); - bankAccountEntity.setTenantId("default"); - BankAccountEntity result = bankAccountJdbcRepository.findById(bankAccountEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearBankAccount.sql", "/sql/insertBankAccount.sql" }) - public void test_search_invalid_sort_option() { - - BankAccountSearch search = getBankAccountSearch(); - search.setSortBy("desc"); - bankAccountJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearBankAccount.sql", "/sql/insertBankAccount.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - BankAccountSearch search = getBankAccountSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) bankAccountJdbcRepository - .search(getBankAccountSearch()); - assertThat(page.getPagedData().get(0).getAccountNumber()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - class BankAccountResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("accountNumber", resultSet.getString("accountNumber")); - put("bankBranchId", resultSet.getString("bankBranchId")); - put("coa", resultSet.getString("chartOfAccountId")); - put("fund", resultSet.getBoolean("fundId")); - put("tenantId", resultSet.getBoolean("tenantId")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private BankAccountEntity getBankAccountEntity() { - BankAccountEntity bankAccountEntity = new BankAccountEntity(); - BankAccount bankAccount = getBankAccountDomain(); - bankAccountEntity.setId(bankAccount.getId()); - bankAccountEntity.setBankBranchId(bankAccount.getBankBranch().getId()); - bankAccountEntity.setAccountNumber(bankAccount.getAccountNumber()); - bankAccountEntity.setActive(bankAccount.getActive()); - bankAccountEntity.setChartOfAccountId(bankAccount.getChartOfAccount().getId()); - bankAccountEntity.setFundId(bankAccount.getFund().getId()); - bankAccountEntity.setActive(bankAccount.getActive()); - bankAccountEntity.setTenantId(bankAccount.getTenantId()); - bankAccountEntity.setAccountType(bankAccount.getAccountType()); - bankAccountEntity.setDescription(bankAccount.getDescription()); - bankAccountEntity.setPayTo(bankAccount.getPayTo()); - bankAccountEntity.setType(bankAccount.getType().toString()); - return bankAccountEntity; - } - - private BankAccount getBankAccountDomain() { - BankAccount bankAccount = new BankAccount(); - bankAccount.setId("1"); - bankAccount.setBankBranch(getBankBranch()); - bankAccount.setAccountNumber("1"); - bankAccount.setChartOfAccount(getCOA()); - bankAccount.setFund(getFund()); - bankAccount.setActive(true); - bankAccount.setTenantId("default"); - bankAccount.setAccountType("Payment"); - bankAccount.setDescription("bank account"); - bankAccount.setPayTo("abc"); - bankAccount.setType(BankAccountType.PAYMENTS); - return bankAccount; - } - - private BankBranch getBankBranch() { - return BankBranch.builder().id("1").code("branch").name("branch").active(true).bank(getBank()).build(); - } - - private Bank getBank() { - Bank bank = new Bank(); - bank.setId("1"); - bank.setCode("code"); - bank.setName("name"); - bank.setDescription("description"); - bank.setType("type"); - bank.setActive(true); - bank.setTenantId("default"); - return bank; - } - - private ChartOfAccount getCOA() { - return ChartOfAccount.builder().id("1").glcode("101010").build(); - - } - - private Fund getFund() { - return Fund.builder().id("1").code("fund").name("fund").build(); - } - - private BankAccountSearch getBankAccountSearch() { - BankAccountSearch bankAccountSearch = new BankAccountSearch(); - bankAccountSearch.setAccountNumber("1"); - bankAccountSearch.setType(BankAccountType.PAYMENTS); - bankAccountSearch.setPageSize(500); - bankAccountSearch.setOffset(0); - bankAccountSearch.setSortBy("id desc"); - return bankAccountSearch; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankBranchJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankBranchJdbcRepositoryTest.java deleted file mode 100644 index 813c57687fe..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankBranchJdbcRepositoryTest.java +++ /dev/null @@ -1,217 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.persistence.entity.BankBranchEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class BankBranchJdbcRepositoryTest { - - private BankBranchJdbcRepository bankBranchJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - bankBranchJdbcRepository = new BankBranchJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql", "/sql/clearBankBranch.sql" }) - public void testCreate() { - BankBranchEntity bankBranchEntity = getBankBranchEntity(); - BankBranchEntity actualResult = bankBranchJdbcRepository.create(bankBranchEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_bankbranch", - new BankBranchResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - } - - @Test - @Sql(scripts = { "/sql/clearBankBranch.sql", "/sql/insertBankBranch.sql" }) - public void testUpdate() { - BankBranchEntity bankBranchEntity = getBankBranchEntity(); - BankBranchEntity actualResult = bankBranchJdbcRepository.update(bankBranchEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_bankbranch", - new BankBranchResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - } - - @Test - @Sql(scripts = { "/sql/clearBankBranch.sql", "/sql/insertBankBranch.sql" }) - public void testSearch() { - Pagination page = (Pagination) bankBranchJdbcRepository.search(getBankBranchSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - } - - @Test - @Sql(scripts = { "/sql/clearBankBranch.sql", "/sql/insertBankBranch.sql" }) - public void testFindById() { - BankBranchEntity bankBranchEntity = BankBranchEntity.builder().id("2").build(); - bankBranchEntity.setTenantId("default"); - BankBranchEntity result = bankBranchJdbcRepository.findById(bankBranchEntity); - assertThat(result.getId()).isEqualTo("2"); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getCode()).isEqualTo("code"); - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearBankBranch.sql" }) - public void test_create_with_tenantId_null() { - - BankBranchEntity bankBranch = BankBranchEntity.builder().code("code").name("name").active(true).build(); - bankBranchJdbcRepository.create(bankBranch); - - } - -@Test - @Sql(scripts = { "/sql/clearBankBranch.sql", "/sql/insertBankBranch.sql" }) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) bankBranchJdbcRepository.search(new BankBranchSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - -@Test - @Sql(scripts = { "/sql/clearBankBranch.sql", "/sql/insertBankBranch.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - BankBranchEntity bankBranchEntity = BankBranchEntity.builder().id("5").build(); - bankBranchEntity.setTenantId("default"); - BankBranchEntity result = bankBranchJdbcRepository.findById(bankBranchEntity); - assertNull(result); - - } -@Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearBankBranch.sql", "/sql/insertBankBranch.sql" }) - public void test_search_invalid_sort_option() { - - BankBranchSearch search = getBankBranchSearch(); - search.setSortBy("desc"); - bankBranchJdbcRepository.search(search); - - } - -@Test - @Sql(scripts = { "/sql/clearBankBranch.sql", "/sql/insertBankBranch.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - BankBranchSearch search = getBankBranchSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) bankBranchJdbcRepository.search(getBankBranchSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - - - class BankBranchResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("code", resultSet.getString("code")); - put("name", resultSet.getString("name")); - put("description", resultSet.getString("description")); - put("active", resultSet.getBoolean("active")); - } - }; - - rows.add(row); - } - return rows; - } - } - - private BankBranchEntity getBankBranchEntity() { - BankBranchEntity bankBranchEntity = new BankBranchEntity(); - BankBranch bankBranch = getBankBranchDomain(); - bankBranchEntity.setId(bankBranch.getId()); - bankBranchEntity.setBankId(bankBranch.getBank().getId()); - bankBranchEntity.setCode(bankBranch.getCode()); - bankBranchEntity.setName(bankBranch.getName()); - bankBranchEntity.setDescription(bankBranch.getDescription()); - bankBranchEntity.setAddress(getBankBranchDomain().getAddress()); - bankBranchEntity.setActive(bankBranch.getActive()); - bankBranchEntity.setTenantId(bankBranch.getTenantId()); - return bankBranchEntity; - } - - private BankBranch getBankBranchDomain() { - BankBranch bankBranch = new BankBranch(); - bankBranch.setId("124234"); - bankBranch.setBank(getBankDomain()); - bankBranch.setCode("code"); - bankBranch.setName("name"); - bankBranch.setAddress("address"); - bankBranch.setDescription("description"); - bankBranch.setActive(true); - bankBranch.setTenantId("default"); - return bankBranch; - } - - private Bank getBankDomain() { - Bank bank = new Bank(); - bank.setId("1"); - bank.setCode("code"); - bank.setName("name"); - bank.setDescription("description"); - bank.setType("type"); - bank.setActive(true); - bank.setTenantId("default"); - return bank; - } - - private BankBranchSearch getBankBranchSearch() { - BankBranchSearch bankBranchSearch = new BankBranchSearch(); - bankBranchSearch.setName("name"); - bankBranchSearch.setCode("code"); - bankBranchSearch.setPageSize(500); - bankBranchSearch.setOffset(0); - bankBranchSearch.setSortBy("name desc"); - return bankBranchSearch; - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankJdbcRepositoryTest.java deleted file mode 100644 index 6677b8283d0..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/BankJdbcRepositoryTest.java +++ /dev/null @@ -1,201 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.persistence.entity.BankEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class BankJdbcRepositoryTest { - - private BankJdbcRepository bankJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - bankJdbcRepository = new BankJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql" }) - public void testCreate() { - BankEntity bankEntity = getBankEntity(); - BankEntity actualResult = bankJdbcRepository.create(bankEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_bank", - new BankResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql", "/sql/insertBank.sql" }) - public void testUpdate() { - BankEntity bankEntity = getBankEntity(); - BankEntity actualResult = bankJdbcRepository.update(bankEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_bank", - new BankResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql", "/sql/insertBank.sql" }) - public void testSearch() { - Pagination page = (Pagination) bankJdbcRepository.search(getBankSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql", "/sql/insertBank.sql" }) - public void testFindById() { - BankEntity bankEntity = BankEntity.builder().id("2").build(); - bankEntity.setTenantId("default"); - BankEntity result = bankJdbcRepository.findById(bankEntity); - assertThat(result.getId()).isEqualTo("2"); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getCode()).isEqualTo("code"); - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearBank.sql" }) - public void test_create_with_tenantId_null() { - - BankEntity bank = BankEntity.builder().code("code").name("name").active(true).build(); - bankJdbcRepository.create(bank); - - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql", "/sql/insertBank.sql" }) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) bankJdbcRepository.search(new BankSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql", "/sql/insertBank.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - BankEntity bankEntity = BankEntity.builder().id("5").build(); - bankEntity.setTenantId("default"); - BankEntity result = bankJdbcRepository.findById(bankEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearBank.sql", "/sql/insertBank.sql" }) - public void test_search_invalid_sort_option() { - - BankSearch search = getBankSearch(); - search.setSortBy("desc"); - bankJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearBank.sql", "/sql/insertBank.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - BankSearch search = getBankSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) bankJdbcRepository.search(getBankSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - class BankResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("code", resultSet.getString("code")); - put("name", resultSet.getString("name")); - put("description", resultSet.getString("description")); - put("active", resultSet.getBoolean("active")); - put("type", resultSet.getString("type")); - } - }; - - rows.add(row); - } - return rows; - } - } - - private BankEntity getBankEntity() { - BankEntity bankEntity = new BankEntity(); - Bank bank = getBankDomain(); - bankEntity.setId(bank.getId()); - bankEntity.setCode(bank.getCode()); - bankEntity.setName(bank.getName()); - bankEntity.setDescription(bank.getDescription()); - bankEntity.setType(bank.getType()); - bankEntity.setActive(bank.getActive()); - bankEntity.setTenantId(bank.getTenantId()); - return bankEntity; - } - - private Bank getBankDomain() { - Bank bank = new Bank(); - bank.setId("134235"); - bank.setCode("code"); - bank.setName("name"); - bank.setDescription("description"); - bank.setType("type"); - bank.setActive(true); - bank.setTenantId("default"); - return bank; - } - - private BankSearch getBankSearch() { - BankSearch bankSearch = new BankSearch(); - bankSearch.setName("name"); - bankSearch.setCode("code"); - bankSearch.setPageSize(500); - bankSearch.setOffset(0); - bankSearch.setSortBy("name desc"); - return bankSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/ChartOfAccountDetailJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/ChartOfAccountDetailJdbcRepositoryTest.java deleted file mode 100644 index e3bf2a9ef5d..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/ChartOfAccountDetailJdbcRepositoryTest.java +++ /dev/null @@ -1,196 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.persistence.entity.ChartOfAccountDetailEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class ChartOfAccountDetailJdbcRepositoryTest { - - private ChartOfAccountDetailJdbcRepository chartOfAccountDetailJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Autowired - private AccountDetailTypeJdbcRepository accountDetailTypeJdbcRepository; - - @Before - public void setUp() throws Exception { - chartOfAccountDetailJdbcRepository = new ChartOfAccountDetailJdbcRepository( - namedParameterJdbcTemplate,accountDetailTypeJdbcRepository); - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql" }) - @Sql(scripts = { "/sql/insertChartOfAccountData.sql" }) - @Sql(scripts = { "/sql/clearAccountDetailType.sql" }) - @Sql(scripts = { "/sql/insertAccountDetailType.sql" }) - @Sql(scripts = { "/sql/clearChartOfAccountDetail.sql" }) - @Sql(scripts = { "/sql/insertChartOfAccountDetail.sql" }) - public void testCreate() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = getChartOfAccountDetailEntity(); - ChartOfAccountDetailEntity actualResult = chartOfAccountDetailJdbcRepository - .create(chartOfAccountDetailEntity); - List> result = namedParameterJdbcTemplate.query( - "SELECT * FROM egf_chartofaccountdetail", - new ChartOfAccountDetailResultExtractor()); - assertThat(result.get(0).get("id")).isEqualTo("1"); - assertThat(result.get(0).get("chartofaccountid")).isEqualTo("1"); - assertThat(result.get(0).get("accountdetailtypeid")).isEqualTo("1"); - - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql" }) - @Sql(scripts = { "/sql/insertChartOfAccountData.sql" }) - @Sql(scripts = { "/sql/clearAccountDetailType.sql" }) - @Sql(scripts = { "/sql/insertAccountDetailType.sql" }) - @Sql(scripts = { "/sql/clearChartOfAccountDetail.sql", - "/sql/insertChartOfAccountDetail.sql" }) - public void testUpdate() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = getChartOfAccountDetailEntity(); - ChartOfAccountDetailEntity actualResult = chartOfAccountDetailJdbcRepository - .update(chartOfAccountDetailEntity); - List> result = namedParameterJdbcTemplate.query( - "SELECT * FROM egf_chartofaccountdetail order by id asc", - new ChartOfAccountDetailResultExtractor()); - assertThat(result.get(0).get("id")).isEqualTo("1"); - assertThat(result.get(0).get("chartofaccountid")).isEqualTo("1"); - assertThat(result.get(0).get("accountdetailtypeid")).isEqualTo("1"); - - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql" }) - @Sql(scripts = { "/sql/insertChartOfAccountData.sql" }) - @Sql(scripts = { "/sql/clearAccountDetailType.sql" }) - @Sql(scripts = { "/sql/insertAccountDetailType.sql" }) - @Sql(scripts = { "/sql/clearChartOfAccountDetail.sql", - "/sql/insertChartOfAccountDetail.sql" }) - public void testSearch() { - Pagination page = (Pagination) chartOfAccountDetailJdbcRepository - .search(getChartOfAccountDetailSearch()); - assertThat(page.getPagedData().get(0).getId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getChartOfAccount().getId()).isEqualTo("1"); - assertThat(page.getPagedData().get(0).getAccountDetailType().getId()).isEqualTo("1"); - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql" }) - @Sql(scripts = { "/sql/insertChartOfAccountData.sql" }) - @Sql(scripts = { "/sql/clearAccountDetailType.sql" }) - @Sql(scripts = { "/sql/insertAccountDetailType.sql" }) - @Sql(scripts = { "/sql/clearChartOfAccountDetail.sql", - "/sql/insertChartOfAccountDetail.sql" }) - public void testFindById() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = getChartOfAccountDetailEntity(); - ChartOfAccountDetailEntity actualResult = chartOfAccountDetailJdbcRepository - .findById(chartOfAccountDetailEntity); - List> result = namedParameterJdbcTemplate.query( - "SELECT * FROM egf_chartofaccountdetail", - new ChartOfAccountDetailResultExtractor()); - assertThat(result.get(0).get("id")).isEqualTo("1"); - assertThat(result.get(0).get("chartofaccountid")).isEqualTo("1"); - assertThat(result.get(0).get("accountdetailtypeid")).isEqualTo("1"); - } - - class ChartOfAccountDetailResultExtractor implements - ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) - throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("chartofaccountid", resultSet.getString("chartofaccountid")); - put("accountdetailtypeid", resultSet.getString("accountdetailtypeid")); - put("createdby", resultSet.getString("createdby")); - put("createddate", resultSet.getString("createddate")); - put("lastmodifiedby", resultSet.getBoolean("lastmodifiedby")); - put("lastmodifieddate", resultSet.getString("lastmodifieddate")); - put("version", resultSet.getString("version")); - put("tenantid", resultSet.getString("tenantid")); - } - }; - - rows.add(row); - } - return rows; - } - } - - private ChartOfAccountDetailEntity getChartOfAccountDetailEntity() { - ChartOfAccountDetailEntity chartOfAccountDetailEntity = new ChartOfAccountDetailEntity(); - ChartOfAccountDetail chartOfAccountDetail = getChartOfAccountDetailDomain(); - chartOfAccountDetailEntity.setId(chartOfAccountDetail.getId()); - chartOfAccountDetailEntity.setChartOfAccountId(chartOfAccountDetail.getChartOfAccount().getId()); - chartOfAccountDetailEntity.setAccountDetailTypeId(chartOfAccountDetail.getAccountDetailType().getId()); - chartOfAccountDetailEntity.setTenantId("default"); - return chartOfAccountDetailEntity; - } - - private ChartOfAccountDetail getChartOfAccountDetailDomain() { - ChartOfAccountDetail chartOfAccountDetail = ChartOfAccountDetail - .builder().id("14632342").accountDetailType(getAccountDetailType()).chartOfAccount(getChartOfAccount()).build(); - chartOfAccountDetail.setChartOfAccount(getChartOfAccount()); - chartOfAccountDetail.setAccountDetailType(getAccountDetailType()); - chartOfAccountDetail.setTenantId("default"); - return chartOfAccountDetail; - } - - private ChartOfAccount getChartOfAccount() { - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("1") - .glcode("glcode").name("name").description("description") - .isActiveForPosting(true).type('A') - .classification((long) 123456).functionRequired(true) - .budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private AccountDetailType getAccountDetailType() { - AccountDetailType accountDetailType = AccountDetailType.builder() - .id("1").name("name").description("description").active(true) - .build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - - private ChartOfAccountDetailSearch getChartOfAccountDetailSearch() { - ChartOfAccountDetailSearch chartOfAccountDetailSearch = new ChartOfAccountDetailSearch(); - chartOfAccountDetailSearch.setId("1"); - chartOfAccountDetailSearch.setPageSize(500); - chartOfAccountDetailSearch.setOffset(0); - chartOfAccountDetailSearch.setSortBy("id asc"); - chartOfAccountDetailSearch.setTenantId("default"); - return chartOfAccountDetailSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/ChartOfAccountJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/ChartOfAccountJdbcRepositoryTest.java deleted file mode 100644 index 079fb2f1afa..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/ChartOfAccountJdbcRepositoryTest.java +++ /dev/null @@ -1,196 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.persistence.entity.ChartOfAccountEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class ChartOfAccountJdbcRepositoryTest { - - private ChartOfAccountJdbcRepository chartOfAccountJdbcRepository; - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Autowired - private ChartOfAccountDetailJdbcRepository chartOfAccountDetailJdbcRepository; - - @Before - public void setUp() throws Exception { - chartOfAccountJdbcRepository = new ChartOfAccountJdbcRepository(namedParameterJdbcTemplate,chartOfAccountDetailJdbcRepository); - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql" }) - @Sql(scripts = { "/sql/insertChartOfAccountData.sql" }) - public void testCreate() { - ChartOfAccountEntity chartOfAccountEntity = getChartOfAccountEntity(); - ChartOfAccountEntity actualResult =chartOfAccountJdbcRepository.create(chartOfAccountEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_chartofaccount", - new ChartOfAccountResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("glcode")).isEqualTo(actualResult.getGlcode()); - assertThat(row.get("budgetCheckRequired")).isEqualTo(actualResult.getBudgetCheckRequired()); - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql", "/sql/insertChartOfAccountData.sql" }) - public void testUpdate() { - ChartOfAccountEntity chartOfAccountEntity = getChartOfAccountEntity(); - ChartOfAccountEntity actualResult =chartOfAccountJdbcRepository.update(chartOfAccountEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_chartofaccount", - new ChartOfAccountResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("glcode")).isEqualTo(actualResult.getGlcode()); - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql", "/sql/insertChartOfAccountData.sql" }) - public void testSearch() { - Pagination page = (Pagination) chartOfAccountJdbcRepository.search(getChartOfAccountSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getGlcode()).isEqualTo("glcode"); - assertThat(page.getPagedData().get(0).getBudgetCheckRequired()).isEqualTo(true); - } - - @Test - @Sql(scripts = { "/sql/clearChartOfAccount.sql", "/sql/insertChartOfAccountData.sql" }) - public void testFindById() { - ChartOfAccountEntity chartOfAccountEntity = getChartOfAccountEntity(); - ChartOfAccountEntity actualResult =chartOfAccountJdbcRepository.findById(chartOfAccountEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_chartofaccount", - new ChartOfAccountResultExtractor()); - assertThat(result.get(0).get("id")).isEqualTo("2"); - assertThat(result.get(0).get("name")).isEqualTo("name"); - assertThat(result.get(0).get("glcode")).isEqualTo("glcode"); - } - -/* @Test - public void testFindByAccountCodePurposeId() { - ChartOfAccountEntity chartOfAccountEntity = getChartOfAccountEntity(); - ChartOfAccountEntity actualResult =chartOfAccountJdbcRepository.findByAccountCodePurposeId(chartOfAccountEntity); - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_chartofaccount", - new ChartOfAccountResultExtractor()); - assertThat(result.get(0).get("id")).isEqualTo("2"); - assertThat(result.get(0).get("name")).isEqualTo("name"); - assertThat(result.get(0).get("glcode")).isEqualTo("glcode"); - }*/ - - private ChartOfAccountEntity getChartOfAccountEntity() { - ChartOfAccountEntity chartOfAccountEntity = new ChartOfAccountEntity(); - ChartOfAccount chartOfAccount = getChartOfAccountDomain(); - chartOfAccountEntity.setId(chartOfAccount.getId()); - chartOfAccountEntity.setGlcode(chartOfAccount.getGlcode()); - chartOfAccountEntity.setName(chartOfAccount.getName()); - chartOfAccountEntity.setDescription(chartOfAccount.getDescription()); - chartOfAccountEntity.setIsActiveForPosting(chartOfAccount.getIsActiveForPosting()); - chartOfAccountEntity.setType(chartOfAccount.getType()); - chartOfAccountEntity.setClassification(chartOfAccount.getClassification()); - chartOfAccountEntity.setFunctionRequired(chartOfAccount.getFunctionRequired()); - chartOfAccountEntity.setBudgetCheckRequired(chartOfAccount.getBudgetCheckRequired()); - chartOfAccountEntity.setTenantId("default"); - chartOfAccountEntity.setCreatedBy("1"); - chartOfAccountEntity.setLastModifiedBy("1"); - return chartOfAccountEntity; - } - - private ChartOfAccount getChartOfAccountDomain() { - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("B") - .glcode("glcode").name("name") - .description("description").isActiveForPosting(true) - .type('B').classification((long) 123456).functionRequired(true) - .budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - class ChartOfAccountResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("glcode", resultSet.getString("glcode")); - put("name", resultSet.getString("name")); - put("accountCodePurposeId", resultSet.getString("accountCodePurposeId")); - put("description", resultSet.getString("description")); - put("isActiveForPosting", resultSet.getBoolean("isActiveForPosting")); - put("parentId", resultSet.getString("parentId")); - put("type", resultSet.getString("type")); - put("functionRequired", resultSet.getString("functionRequired")); - put("budgetCheckRequired", resultSet.getString("budgetCheckRequired")); - put("majorCode", resultSet.getString("majorCode")); - put("isSubLedger", resultSet.getString("isSubLedger")); - put("functionRequired", resultSet.getBoolean("functionRequired")); - put("budgetCheckRequired", resultSet.getBoolean("budgetCheckRequired")); - put("majorCode", resultSet.getString("majorCode")); - } - }; - - rows.add(row); - } - return rows; - } - } - - private ChartOfAccountSearch getChartOfAccountSearch() { - ChartOfAccountSearch chartOfAccountSearch = new ChartOfAccountSearch(); - chartOfAccountSearch.setId("2"); - //chartOfAccountSearch.setGlcode("glcode"); - chartOfAccountSearch.setName("name"); - chartOfAccountSearch.setDescription("description"); - chartOfAccountSearch.setIsActiveForPosting(true); - chartOfAccountSearch.setType(Character.valueOf('B')); - chartOfAccountSearch.setClassification(123456l); - chartOfAccountSearch.setBudgetCheckRequired(true); - chartOfAccountSearch.setIsSubLedger(true); - chartOfAccountSearch.setMajorCode("majorcode"); - chartOfAccountSearch.setFunctionRequired(true); - chartOfAccountSearch.setAccountCodePurpose(getAccountCodePurpose()); - chartOfAccountSearch.setParentId(getParent()); - chartOfAccountSearch.setPageSize(500); - chartOfAccountSearch.setOffset(0); - chartOfAccountSearch.setSortBy("name desc"); - chartOfAccountSearch.setTenantId("default"); - return chartOfAccountSearch; - } - - private ChartOfAccount getParent(){ - return ChartOfAccount.builder().id("1").glcode("glcode").name("name") - .isActiveForPosting(true).type(Character.valueOf('B')).classification(123456l) - .isSubLedger(true).accountCodePurpose(getAccountCodePurpose()).budgetCheckRequired(true) - .majorCode("majorcode").functionRequired(true).build(); - } - - private AccountCodePurpose getAccountCodePurpose(){ - return AccountCodePurpose.builder().id("P").name("accountpurpose").build(); - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/FunctionJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/FunctionJdbcRepositoryTest.java deleted file mode 100644 index 30e11a35db0..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/FunctionJdbcRepositoryTest.java +++ /dev/null @@ -1,209 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.persistence.entity.FunctionEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class FunctionJdbcRepositoryTest { - - private FunctionJdbcRepository functionJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - functionJdbcRepository = new FunctionJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearFunction.sql" }) - public void test_create() { - - FunctionEntity function = FunctionEntity.builder().id("46353532").code("code").name("name").active(true) - .level(1).parentId("1").build(); - function.setTenantId("default"); - FunctionEntity actualResult = functionJdbcRepository.create(function); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_function", - new FunctionResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - assertThat(row.get("parentId")).isEqualTo(actualResult.getParentId()); - - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearFunction.sql" }) - public void test_create_with_tenantId_null() { - - FunctionEntity function = FunctionEntity.builder().code("code").name("name").active(true).level(1).parentId("1") - .level(1).build(); - functionJdbcRepository.create(function); - - } - - @Test - @Sql(scripts = { "/sql/clearFunction.sql", "/sql/insertFunctionData.sql" }) - public void test_update() { - - FunctionEntity function = FunctionEntity.builder().code("codeU").name("nameU").active(true).id("2").level(1) - .build(); - function.setTenantId("default"); - FunctionEntity actualResult = functionJdbcRepository.update(function); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_function", - new FunctionResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - - } - - @Test - @Sql(scripts = { "/sql/clearFunction.sql", "/sql/insertFunctionData.sql" }) - public void test_search() { - - Pagination page = (Pagination) functionJdbcRepository.search(getFunctionSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearFunction.sql", "/sql/insertFunctionData.sql" }) - public void test_search_with_no_parameter() { - - Pagination page = (Pagination) functionJdbcRepository.search(new FunctionSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearFunction.sql", "/sql/insertFunctionData.sql" }) - public void test_find_by_id() { - - FunctionEntity functionEntity = FunctionEntity.builder().id("2").build(); - functionEntity.setTenantId("default"); - FunctionEntity result = functionJdbcRepository.findById(functionEntity); - assertThat(result.getId()).isEqualTo("2"); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getCode()).isEqualTo("code"); - - } - - @Test - @Sql(scripts = { "/sql/clearFunction.sql", "/sql/insertFunctionData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - FunctionEntity functionEntity = FunctionEntity.builder().id("5").build(); - functionEntity.setTenantId("default"); - FunctionEntity result = functionJdbcRepository.findById(functionEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearFunction.sql", "/sql/insertFunctionData.sql" }) - public void test_search_invalid_sort_option() { - - FunctionSearch search = getFunctionSearch(); - search.setSortBy("desc"); - functionJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearFunction.sql", "/sql/insertFunctionData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - FunctionSearch search = getFunctionSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) functionJdbcRepository.search(getFunctionSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - class FunctionResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("code", resultSet.getString("code")); - put("active", resultSet.getBoolean("active")); - put("level", resultSet.getLong("level")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - put("parentId", resultSet.getString("parentId")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private FunctionSearch getFunctionSearch() { - FunctionSearch functionSearch = new FunctionSearch(); - functionSearch.setId("2"); - functionSearch.setName("name"); - functionSearch.setCode("code"); - functionSearch.setActive(true); - functionSearch.setLevel(1); - functionSearch.setParentId(parentFunction()); - functionSearch.setPageSize(500); - functionSearch.setOffset(0); - functionSearch.setSortBy("name desc"); - return functionSearch; - } - - private Function parentFunction() { - Function function = Function.builder().name("parent").code("001").level(0).active(true).id("1").build(); - function.setTenantId("default"); - return function; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/FundJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/FundJdbcRepositoryTest.java deleted file mode 100644 index 30599f3490c..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/FundJdbcRepositoryTest.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.persistence.entity.FundEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class FundJdbcRepositoryTest { - - private FundJdbcRepository fundJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - fundJdbcRepository = new FundJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearFund.sql" }) - public void test_create() { - - FundEntity fund = FundEntity.builder().id("2374257").code("code").name("name").active(true).level(1l) - .parentId("1").identifier('F').build(); - fund.setTenantId("default"); - FundEntity actualResult = fundJdbcRepository.create(fund); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_fund", - new FundResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - assertThat(row.get("parentId")).isEqualTo(actualResult.getParentId()); - - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearFund.sql" }) - public void test_create_with_tenantId_null() { - - FundEntity fund = FundEntity.builder().code("code").name("name").active(true).level(1l) - .parentId("1").identifier('F').build(); - fundJdbcRepository.create(fund); - - } - - @Test - @Sql(scripts = { "/sql/clearFund.sql", "/sql/insertFundData.sql" }) - public void test_update() { - - FundEntity fund = FundEntity.builder().code("codeU").name("nameU").active(true).level(1l) - .identifier('F').id("2").build(); - fund.setTenantId("default"); - FundEntity actualResult = fundJdbcRepository.update(fund); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_fund", - new FundResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - - } - - @Test - @Sql(scripts = { "/sql/clearFund.sql", "/sql/insertFundData.sql" }) - public void test_search() { - - Pagination page = (Pagination) fundJdbcRepository.search(getFundSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearFund.sql", "/sql/insertFundData.sql" }) - public void test_find_by_id() { - - FundEntity fundEntity = FundEntity.builder().id("2").build(); - fundEntity.setTenantId("default"); - FundEntity result = fundJdbcRepository.findById(fundEntity); - assertThat(result.getId()).isEqualTo("2"); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getCode()).isEqualTo("code"); - - } - - @Test - @Sql(scripts = { "/sql/clearFund.sql", "/sql/insertFundData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - FundEntity fundEntity = FundEntity.builder().id("5").build(); - fundEntity.setTenantId("default"); - FundEntity result = fundJdbcRepository.findById(fundEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearFund.sql", "/sql/insertFundData.sql" }) - public void test_search_invalid_sort_option() { - - FundSearch search = getFundSearch(); - search.setSortBy("desc"); - fundJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearFund.sql", "/sql/insertFundData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - FundSearch search = getFundSearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) fundJdbcRepository.search(getFundSearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - class FundResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("code", resultSet.getString("code")); - put("active", resultSet.getBoolean("active")); - put("level", resultSet.getLong("level")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - put("identifier", resultSet.getString("identifier")); - put("parentId", resultSet.getString("parentId")); - - } - }; - - rows.add(row); - } - return rows; - } - } - - private FundSearch getFundSearch() { - FundSearch fundSearch = new FundSearch(); - fundSearch.setName("name"); - fundSearch.setCode("code"); - fundSearch.setPageSize(500); - fundSearch.setOffset(0); - fundSearch.setSortBy("name desc"); - return fundSearch; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/RecoveryJdbcRepositoryTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/RecoveryJdbcRepositoryTest.java deleted file mode 100644 index e63f81c5c23..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/persistence/repository/RecoveryJdbcRepositoryTest.java +++ /dev/null @@ -1,194 +0,0 @@ -package org.egov.egf.master.persistence.repository; - -import org.egov.common.domain.exception.InvalidDataException; -import org.egov.common.domain.model.Pagination; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.persistence.entity.RecoveryEntity; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.jdbc.core.ResultSetExtractor; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.junit4.SpringRunner; - -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; - -@RunWith(SpringRunner.class) -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) -@Ignore -public class RecoveryJdbcRepositoryTest { - - private RecoveryJdbcRepository recoveryJdbcRepository; - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - @Before - public void setUp() throws Exception { - recoveryJdbcRepository = new RecoveryJdbcRepository(namedParameterJdbcTemplate); - } - - @Test - @Sql(scripts = { "/sql/clearRecovery.sql" }) - public void test_create() { - - RecoveryEntity recovery = RecoveryEntity.builder().id("2374257").code("code").name("name").active(true) - .mode('M').accountNumber("30492234547").flat(100.00).ifscCode("ifsccode").chartOfAccountId("1").remittanceMode('M').remitted("test").build(); - recovery.setTenantId("default"); - RecoveryEntity actualResult = recoveryJdbcRepository.create(recovery); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_recovery", - new RecoveryResultExtractor()); - Map row = result.get(0); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - - } - - @Test(expected = DataIntegrityViolationException.class) - @Sql(scripts = { "/sql/clearRecovery.sql" }) - public void test_create_with_tenantId_null() { - - RecoveryEntity recovery = RecoveryEntity.builder().id("2374257").code("code").name("name").active(true) - .mode('M').accountNumber("30492234547").flat(100.00).ifscCode("ifsccode").chartOfAccountId("1").remittanceMode('M').remitted("test").build(); - recoveryJdbcRepository.create(recovery); - - } - - @Test - @Sql(scripts = { "/sql/clearRecovery.sql", "/sql/insertRecoveryData.sql" }) - public void test_update() { - - RecoveryEntity recovery = RecoveryEntity.builder().id("2374257").code("code").name("name").active(true) - .mode('M').accountNumber("30492234547").flat(100.00).ifscCode("ifsccode").chartOfAccountId("1").remittanceMode('M').remitted("test").build(); - recovery.setTenantId("default"); - RecoveryEntity actualResult = recoveryJdbcRepository.update(recovery); - - List> result = namedParameterJdbcTemplate.query("SELECT * FROM egf_recovery", - new RecoveryResultExtractor()); - Map row = result.get(0); - assertThat(row.get("id")).isEqualTo(actualResult.getId()); - assertThat(row.get("name")).isEqualTo(actualResult.getName()); - assertThat(row.get("code")).isEqualTo(actualResult.getCode()); - - } - - @Test - @Sql(scripts = { "/sql/clearRecovery.sql", "/sql/insertRecoveryData.sql" }) - public void test_search() { - - Pagination page = (Pagination) recoveryJdbcRepository.search(getRecoverySearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - @Test - @Sql(scripts = { "/sql/clearRecovery.sql", "/sql/insertRecoveryData.sql" }) - public void test_find_by_id() { - - RecoveryEntity recoveryEntity = RecoveryEntity.builder().id("2374257").build(); - recoveryEntity.setTenantId("default"); - RecoveryEntity result = recoveryJdbcRepository.findById(recoveryEntity); - assertThat(result.getId()).isEqualTo("2374257"); - assertThat(result.getName()).isEqualTo("name"); - assertThat(result.getCode()).isEqualTo("code"); - - } - - @Test - @Sql(scripts = { "/sql/clearRecovery.sql", "/sql/insertRecoveryData.sql" }) - public void test_find_by_invalid_id_should_return_null() { - - RecoveryEntity recoveryEntity = RecoveryEntity.builder().id("5").build(); - recoveryEntity.setTenantId("default"); - RecoveryEntity result = recoveryJdbcRepository.findById(recoveryEntity); - assertNull(result); - - } - - @Test(expected = InvalidDataException.class) - @Sql(scripts = { "/sql/clearRecovery.sql", "/sql/insertRecoveryData.sql" }) - public void test_search_invalid_sort_option() { - - RecoverySearch search = getRecoverySearch(); - search.setSortBy("desc"); - recoveryJdbcRepository.search(search); - - } - - @Test - @Sql(scripts = { "/sql/clearRecovery.sql", "/sql/insertRecoveryData.sql" }) - public void test_search_without_pagesize_offset_sortby() { - - RecoverySearch search = getRecoverySearch(); - search.setSortBy(null); - search.setPageSize(null); - search.setOffset(null); - Pagination page = (Pagination) recoveryJdbcRepository.search(getRecoverySearch()); - assertThat(page.getPagedData().get(0).getName()).isEqualTo("name"); - assertThat(page.getPagedData().get(0).getCode()).isEqualTo("code"); - assertThat(page.getPagedData().get(0).getActive()).isEqualTo(true); - - } - - class RecoveryResultExtractor implements ResultSetExtractor>> { - @Override - public List> extractData(ResultSet resultSet) throws SQLException, DataAccessException { - List> rows = new ArrayList<>(); - while (resultSet.next()) { - Map row = new HashMap() { - { - put("id", resultSet.getString("id")); - put("name", resultSet.getString("name")); - put("code", resultSet.getString("code")); - put("active", resultSet.getBoolean("active")); - put("createdBy", resultSet.getString("createdBy")); - put("createdDate", resultSet.getString("createdDate")); - put("lastModifiedBy", resultSet.getString("lastModifiedBy")); - put("lastModifiedDate", resultSet.getString("lastModifiedDate")); - } - }; - - rows.add(row); - } - return rows; - } - } - - private RecoverySearch getRecoverySearch() { - RecoverySearch recoverySearch = new RecoverySearch(); - recoverySearch.setName("name"); - recoverySearch.setCode("code"); - recoverySearch.setPageSize(500); - recoverySearch.setOffset(0); - recoverySearch.setSortBy("name desc"); - return recoverySearch; - } - - private ChartOfAccount getChartOfAccount() { - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("1") - .glcode("glcode").name("name").description("description") - .isActiveForPosting(true).type('A') - .classification((long) 123456).functionRequired(true) - .budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountCodePurposeControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountCodePurposeControllerTest.java deleted file mode 100644 index de77e2d0ea7..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountCodePurposeControllerTest.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountCodePurpose; -import org.egov.egf.master.domain.model.AccountCodePurposeSearch; -import org.egov.egf.master.domain.service.AccountCodePurposeService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(AccountCodePurposeController.class) -@Import(TestConfiguration.class) -public class AccountCodePurposeControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - AccountCodePurposeService accountCodePurposeService; - - @Captor - private ArgumentCaptor> captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void testCreate() throws IOException, Exception { - when(accountCodePurposeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountCodePurposes()); - mockMvc.perform(post("/accountcodepurposes/_create?tenantId=default") - .content(resources.readRequest("accountcodepurpose/accountcodepurpose_create_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json( - resources.readResponse("accountcodepurpose/accountcodepurpose_create_response.json"))); - - verify(accountCodePurposeService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("name", actualRequest.get(0).getName()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - when(accountCodePurposeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountCodePurposes()); - mockMvc.perform(post("/accountcodepurposes/_create") - .content(resources.readRequest("accountcodepurpose/accountcodepurpose_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void testUpdate() throws IOException, Exception { - when(accountCodePurposeService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getUpdateAccountCodePurposes()); - - mockMvc.perform(post("/accountcodepurposes/_update?tenantId=default") - .content(resources.readRequest("accountcodepurpose/accountcodepurpose_update_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json( - resources.readResponse("accountcodepurpose/accountcodepurpose_update_response.json"))); - - verify(accountCodePurposeService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("nameU", actualRequest.get(0).getName()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getAccountCodePurposes()); - page.getPagedData().get(0).setId("1"); - - when(accountCodePurposeService.search(any(AccountCodePurposeSearch.class), any(BindingResult.class))) - .thenReturn(page); - - mockMvc.perform(post("/accountcodepurposes/_search?tenantId=default").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json( - resources.readResponse("accountcodepurpose/accountcodepurpose_search_response.json"))); - - } - - private List getAccountCodePurposes() { - List accountCodePurposes = new ArrayList(); - AccountCodePurpose accountCodePurpose = AccountCodePurpose.builder().id("1").name("name").build(); - accountCodePurpose.setTenantId("default"); - accountCodePurposes.add(accountCodePurpose); - return accountCodePurposes; - } - - private List getUpdateAccountCodePurposes() { - List accountCodePurposes = new ArrayList(); - AccountCodePurpose accountCodePurpose = AccountCodePurpose.builder().id("1").name("nameU").build(); - accountCodePurpose.setTenantId("default"); - accountCodePurposes.add(accountCodePurpose); - return accountCodePurposes; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountDetailKeyControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountDetailKeyControllerTest.java deleted file mode 100644 index ca2168bc55f..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountDetailKeyControllerTest.java +++ /dev/null @@ -1,142 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailKey; -import org.egov.egf.master.domain.model.AccountDetailKeySearch; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.service.AccountDetailKeyService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(AccountDetailKeyController.class) -@Import(TestConfiguration.class) -public class AccountDetailKeyControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - AccountDetailKeyService accountDetailKeyService; - - @Captor - private ArgumentCaptor> captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void testCreate() throws IOException, Exception { - when(accountDetailKeyService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountDetailKies()); - mockMvc.perform(post("/accountdetailkeys/_create?tenantId=default") - .content(resources.readRequest("accountdetailkey/accountdetailkey_create_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("accountdetailkey/accountdetailkey_create_response.json"))); - - verify(accountDetailKeyService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("1", actualRequest.get(0).getKey()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - when(accountDetailKeyService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountDetailKies()); - mockMvc.perform(post("/accountdetailkeys/_create") - .content(resources.readRequest("accountdetailkey/accountdetailkey_create_invalid_fieldvalue.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void testUpdate() throws IOException, Exception { - when(accountDetailKeyService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getUpdateAccountDetailKies()); - - mockMvc.perform(post("/accountdetailkeys/_update?tenantId=default") - .content(resources.readRequest("accountdetailkey/accountdetailkey_update_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("accountdetailkey/accountdetailkey_update_response.json"))); - - verify(accountDetailKeyService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("2", actualRequest.get(0).getKey()); - assertEquals("1", actualRequest.get(0).getAccountDetailType().getId()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getAccountDetailKies()); - page.getPagedData().get(0).setId("1"); - - when(accountDetailKeyService.search(any(AccountDetailKeySearch.class), any(BindingResult.class))) - .thenReturn(page); - - mockMvc.perform(post("/accountdetailkeys/_search?tenantId=default").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content() - .json(resources.readResponse("accountdetailkey/accountdetailkey_search_response.json"))); - - } - - private List getAccountDetailKies() { - List accountDetailKies = new ArrayList(); - AccountDetailKey accountDetailKey = AccountDetailKey.builder().id("1").key("1") - .accountDetailType(getAccountDetailType()).build(); - accountDetailKey.setTenantId("default"); - accountDetailKies.add(accountDetailKey); - return accountDetailKies; - } - - private List getUpdateAccountDetailKies() { - List accountDetailKies = new ArrayList(); - AccountDetailKey accountDetailKey = AccountDetailKey.builder().id("1").key("2") - .accountDetailType(getAccountDetailType()).build(); - accountDetailKey.setTenantId("default"); - accountDetailKies.add(accountDetailKey); - return accountDetailKies; - } - - private AccountDetailType getAccountDetailType() { - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("contractor") - .fullyQualifiedName("abc/acb").active(true).build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountDetailTypeControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountDetailTypeControllerTest.java deleted file mode 100644 index 6a7f222380b..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountDetailTypeControllerTest.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountDetailTypeSearch; -import org.egov.egf.master.domain.service.AccountDetailTypeService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(AccountDetailTypeController.class) -@Import(TestConfiguration.class) -public class AccountDetailTypeControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - AccountDetailTypeService accountDetailTypeService; - - @Captor - private ArgumentCaptor> captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void testCreate() throws IOException, Exception { - when(accountDetailTypeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountDetailTypes()); - mockMvc.perform(post("/accountdetailtypes/_create?tenantId=default") - .content(resources.readRequest("accountdetailtype/accountdetailtype_create_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json( - resources.readResponse("accountdetailtype/accountdetailtype_create_response.json"))); - - verify(accountDetailTypeService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("name", actualRequest.get(0).getName()); - assertEquals("contractor", actualRequest.get(0).getTableName()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - when(accountDetailTypeService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountDetailTypes()); - mockMvc.perform(post("/accountdetailtypes/_create") - .content(resources.readRequest("accountdetailtype/accountdetailtype_create_invalid_fieldvalue.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void testUpdate() throws IOException, Exception { - when(accountDetailTypeService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getUpdateAccountDetailTypes()); - - mockMvc.perform(post("/accountdetailtypes/_update?tenantId=default") - .content(resources.readRequest("accountdetailtype/accountdetailtype_update_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json( - resources.readResponse("accountdetailtype/accountdetailtype_update_response.json"))); - - verify(accountDetailTypeService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("nameU", actualRequest.get(0).getName()); - assertEquals("abc/contractorU", actualRequest.get(0).getFullyQualifiedName()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getAccountDetailTypes()); - page.getPagedData().get(0).setId("1"); - - when(accountDetailTypeService.search(any(AccountDetailTypeSearch.class), any(BindingResult.class))) - .thenReturn(page); - - mockMvc.perform(post("/accountdetailtypes/_search?tenantId=default").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json( - resources.readResponse("accountdetailtype/accountdetailtype_search_response.json"))); - - } - - private List getAccountDetailTypes() { - List accountDetailTypes = new ArrayList(); - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("contractor") - .fullyQualifiedName("abc/contractor").active(true).build(); - accountDetailType.setTenantId("default"); - accountDetailTypes.add(accountDetailType); - return accountDetailTypes; - } - - private List getUpdateAccountDetailTypes() { - List accountDetailTypes = new ArrayList(); - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("nameU").tableName("contractorU") - .fullyQualifiedName("abc/contractorU").active(true).build(); - accountDetailType.setTenantId("default"); - accountDetailTypes.add(accountDetailType); - return accountDetailTypes; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountEntityControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountEntityControllerTest.java deleted file mode 100644 index 25ed29e431f..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/AccountEntityControllerTest.java +++ /dev/null @@ -1,142 +0,0 @@ -package org.egov.egf.master.web.controller; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.AccountEntity; -import org.egov.egf.master.domain.model.AccountEntitySearch; -import org.egov.egf.master.domain.service.AccountEntityService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -@RunWith(SpringRunner.class) -@WebMvcTest(AccountEntityController.class) -@Import(TestConfiguration.class) -public class AccountEntityControllerTest { - - @MockBean - AccountEntityService accountEntityService; - @Autowired - private MockMvc mockMvc; - @Captor - private ArgumentCaptor> captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void testCreate() throws IOException, Exception { - when(accountEntityService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountEntities()); - mockMvc.perform( - post("/accountentities/_create?tenantId=default").content(resources.readRequest("accountentity/accountentity_create_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(201)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("accountentity/accountentity_create_response.json"))); - - verify(accountEntityService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("name", actualRequest.get(0).getName()); - assertEquals("code", actualRequest.get(0).getCode()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - when(accountEntityService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getAccountEntities()); - mockMvc.perform(post("/accountentities/_create?tenantId=default") - .content(resources.readRequest("accountentity/accountentity_create_invalid_fieldvalue.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void testUpdate() throws IOException, Exception { - when(accountEntityService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getUpdateAccountEntities()); - - mockMvc.perform( - post("/accountentities/_update?tenantId=default").content(resources.readRequest("accountentity/accountentity_update_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(201)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("accountentity/accountentity_update_response.json"))); - - verify(accountEntityService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("nameU", actualRequest.get(0).getName()); - assertEquals("codeU", actualRequest.get(0).getCode()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getAccountEntities()); - page.getPagedData().get(0).setId("1"); - - when(accountEntityService.search(any(AccountEntitySearch.class), any(BindingResult.class))).thenReturn(page); - - mockMvc.perform(post("/accountentities/_search?tenantId=default").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("accountentity/accountentity_search_response.json"))); - - } - - private List getAccountEntities() { - List accountEntities = new ArrayList(); - AccountEntity accountEntity = AccountEntity.builder().id("1").name("name").code("code").active(true) - .accountDetailType(getAccountDetaialType()).description("entity").build(); - accountEntity.setTenantId("default"); - accountEntities.add(accountEntity); - return accountEntities; - } - - private List getUpdateAccountEntities() { - List accountEntities = new ArrayList(); - AccountEntity accountEntity = AccountEntity.builder().name("nameU").code("codeU").active(true) - .accountDetailType(getAccountDetaialType()).id("1").description("entity").build(); - accountEntity.setTenantId("default"); - accountEntities.add(accountEntity); - return accountEntities; - } - - private AccountDetailType getAccountDetaialType() { - - AccountDetailType accountDetailType = AccountDetailType.builder().id("1").name("name").tableName("table") - .fullyQualifiedName("abc/table").build(); - accountDetailType.setTenantId("default"); - return accountDetailType; - } - -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankAccountControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankAccountControllerTest.java deleted file mode 100644 index d047125ed3c..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankAccountControllerTest.java +++ /dev/null @@ -1,178 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankAccount; -import org.egov.egf.master.domain.model.BankAccountSearch; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.service.BankAccountService; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(BankAccountController.class) -@Import(TestConfiguration.class) -public class BankAccountControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private BankAccountService bankAccountService; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Captor - private ArgumentCaptor> captor; - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testCreate() throws IOException, Exception { - when(bankAccountService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn((getBankAccounts())); - - mockMvc.perform(post("/bankaccounts/_create?tenantId=default") - .content(resources.readRequest("bankaccount/bankAccount_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect( - content().json(resources.readResponse("bankaccount/bankAccount_create_valid_response.json"))); - - verify(bankAccountService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("1", actualRequest.get(0).getBankBranch().getId()); - assertEquals("1", actualRequest.get(0).getChartOfAccount().getId()); - assertEquals("2", actualRequest.get(0).getFund().getId()); - assertEquals("0004", actualRequest.get(0).getAccountNumber()); - assertEquals(true, actualRequest.get(0).getActive()); - } - - @Test - public void testUpdate() throws IOException, Exception { - when(bankAccountService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn((getUpdatedBankAccounts())); - - mockMvc.perform(post("/bankaccounts/_update?tenantId=default") - .content(resources.readRequest("bankaccount/bankAccount_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect( - content().json(resources.readResponse("bankaccount/bankAccount_update_valid_response.json"))); - - verify(bankAccountService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("1", actualRequest.get(0).getBankBranch().getId()); - assertEquals("1", actualRequest.get(0).getChartOfAccount().getId()); - assertEquals("2", actualRequest.get(0).getFund().getId()); - assertEquals("0004", actualRequest.get(0).getAccountNumber()); - assertEquals("testupdate", actualRequest.get(0).getAccountType()); - assertEquals(true, actualRequest.get(0).getActive()); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - - when(bankAccountService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn((getBankAccounts())); - - mockMvc.perform(post("/bankaccounts/_create") - .content(resources.readRequest("bankaccount/bankaccount_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void testSearch() throws IOException, Exception { - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getBankAccounts()); - page.getPagedData().get(0).setId("1"); - - when(bankAccountService.search(any(BankAccountSearch.class), any(BindingResult.class))).thenReturn(page); - - mockMvc.perform(post("/bankaccounts/_search?tenantId=default").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect( - content().json(resources.readResponse("bankaccount/bankAccount_search_valid_response.json"))); - } - - private List getBankAccounts() { - List bankAccounts = new ArrayList(); - BankAccount bankAccount = BankAccount.builder().accountNumber("0004").accountType("test") - .description("accountNumber").active(true).payTo("tester").build(); - BankBranch bankBranch = BankBranch.builder().id("1").build(); - bankBranch.setTenantId("default"); - Bank bank = Bank.builder().id("1").active(true).type("Bank").build(); - bank.setTenantId("default"); - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("1").build(); - chartOfAccount.setTenantId("default"); - Fund fund = Fund.builder().id("2").build(); - fund.setTenantId("default"); - bankBranch.setBank(bank); - bankAccount.setBankBranch(bankBranch); - bankAccount.setChartOfAccount(chartOfAccount); - bankAccount.setFund(fund); - bankAccount.setTenantId("default"); - bankAccounts.add(bankAccount); - return bankAccounts; - } - - private List getUpdatedBankAccounts() { - List bankAccounts = new ArrayList(); - BankAccount bankAccount = BankAccount.builder().accountNumber("0004").accountType("testupdate") - .description("accountNumber").active(true).payTo("tester").build(); - BankBranch bankBranch = BankBranch.builder().id("1").build(); - bankBranch.setTenantId("default"); - Bank bank = Bank.builder().id("1").active(true).type("Bank").build(); - bank.setTenantId("default"); - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("1").build(); - chartOfAccount.setTenantId("default"); - Fund fund = Fund.builder().id("2").build(); - fund.setTenantId("default"); - bankBranch.setBank(bank); - bankAccount.setBankBranch(bankBranch); - bankAccount.setChartOfAccount(chartOfAccount); - bankAccount.setFund(fund); - bankAccount.setTenantId("default"); - bankAccounts.add(bankAccount); - return bankAccounts; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankBranchControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankBranchControllerTest.java deleted file mode 100644 index bf2ce0a72ec..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankBranchControllerTest.java +++ /dev/null @@ -1,153 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankBranch; -import org.egov.egf.master.domain.model.BankBranchSearch; -import org.egov.egf.master.domain.service.BankBranchService; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(BankBranchController.class) -@Import(TestConfiguration.class) -public class BankBranchControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private BankBranchService bankBranchService; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Captor - private ArgumentCaptor> captor; - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testCreate() throws IOException, Exception { - when(bankBranchService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn((getBankBranches())); - - mockMvc.perform(post("/bankbranches/_create?tenantId=default") - .content(resources.readRequest("bankbranch/bankbranch_create_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("bankbranch/bankbranch_create_response.json"))); - - verify(bankBranchService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("code", actualRequest.get(0).getCode()); - assertEquals("default", actualRequest.get(0).getTenantId()); - assertEquals(true, actualRequest.get(0).getActive()); - } - - @Test - public void testUpdate() throws IOException, Exception { - when(bankBranchService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn((getUpdatedBankBranches())); - - mockMvc.perform(post("/bankbranches/_update?tenantId=default") - .content(resources.readRequest("bankbranch/bankbranch_update_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("bankbranch/bankbranch_update_response.json"))); - - verify(bankBranchService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("1", actualRequest.get(0).getBank().getId()); - assertEquals("default", actualRequest.get(0).getTenantId()); - assertEquals(true, actualRequest.get(0).getActive()); - } - - @Test - public void testSearch() throws IOException, Exception { - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setOffset(0); - page.setPageSize(0); - page.setPagedData(getBankBranches()); - page.getPagedData().get(0).setId("1"); - - when(bankBranchService.search(any(BankBranchSearch.class), any(BindingResult.class))).thenReturn(page); - - mockMvc.perform(post("/bankbranches/_search?tenantId=default").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("bankbranch/bankbranch_search_response.json"))); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - - when(bankBranchService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))).thenReturn((getBankBranches())); - - mockMvc.perform(post("/bankbranches/_create") - .content(resources.readRequest("bankbranch/bankbranch_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - private List getBankBranches() { - List bankBranches = new ArrayList(); - Bank bank = Bank.builder().id("1").build(); - BankBranch bankBranch = BankBranch.builder().bank(bank).code("code").name("name").address("Bangalore") - .address2("Bangalore").city("Bangalore").state("Bangalore").pincode("Bangalore").phone("Bangalore") - .fax("Bangalore").contactPerson("Bangalore").active(true).description("Bangalore").micr("Bangalore") - .build(); - bankBranch.setTenantId("default"); - bankBranches.add(bankBranch); - return bankBranches; - } - - private List getUpdatedBankBranches() { - List bankBranches = new ArrayList(); - Bank bank = Bank.builder().id("1").build(); - BankBranch bankBranch = BankBranch.builder().bank(bank).code("codeupdate").name("nameupdate") - .address("Bangalore").address2("Bangalore").city("Bangalore").state("Bangalore").pincode("Bangalore") - .phone("Bangalore").fax("Bangalore").contactPerson("Bangalore").active(true).description("Bangalore") - .micr("Bangalore").build(); - bankBranch.setTenantId("default"); - bankBranches.add(bankBranch); - return bankBranches; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankControllerTest.java deleted file mode 100644 index 941d70a3b3d..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/BankControllerTest.java +++ /dev/null @@ -1,143 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Bank; -import org.egov.egf.master.domain.model.BankSearch; -import org.egov.egf.master.domain.service.BankService; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(BankController.class) -@Import(TestConfiguration.class) -public class BankControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private BankService bankService; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Captor - private ArgumentCaptor> captor; - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - /*@Test - public void testCreate() throws IOException, Exception { - when(bankService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getBanks()); - - mockMvc.perform(post("/banks/_create").content(resources.readRequest("bank/bank_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("bank/bank_create_valid_response.json"))); - - verify(bankService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("name", actualRequest.get(0).getName()); - assertEquals("default", actualRequest.get(0).getTenantId()); - assertEquals(true, actualRequest.get(0).getActive()); - }*/ - - @Test - public void testUpdate() throws IOException, Exception { - when(bankService.update(captor.capture(), any(BindingResult.class), any(RequestInfo.class))).thenReturn((getUpdateBanks())); - - mockMvc.perform(post("/banks/_update?tenantId=default").content(resources.readRequest("bank/bank_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("bank/bank_update_valid_response.json"))); - - verify(bankService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("nameupdate", actualRequest.get(0).getName()); - assertEquals("codeupdate", actualRequest.get(0).getCode()); - assertEquals(true, actualRequest.get(0).getActive()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void testSearch() throws IOException, Exception { - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getBanks()); - page.getPagedData().get(0).setId("1"); - - when(bankService.search(any(BankSearch.class), any(BindingResult.class))).thenReturn(page); - - mockMvc.perform( - post("/banks/_search?tenantId=default").content(resources.getRequestInfo()).contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(200)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("bank/bank_search_valid_response.json"))); - } - - /*@Test - public void testCreate_Error() throws IOException, Exception { - - when(bankService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))).thenReturn(getBanks()); - - mockMvc.perform( - post("/banks/_create").content(resources.readRequest("bank/bank_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is5xxServerError()); - - } -*/ - private List getBanks() { - List banks = new ArrayList(); - Bank bank = Bank.builder().code("code").name("name").description("description").active(true).type("type") - .build(); - bank.setTenantId("default"); - banks.add(bank); - return banks; - } - - private List getUpdateBanks() { - List banks = new ArrayList(); - Bank bank = Bank.builder().code("codeupdate").name("nameupdate").description("descriptionupdate").active(true) - .type("typeupdate").build(); - bank.setTenantId("default"); - banks.add(bank); - return banks; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/ChartOfAccountControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/ChartOfAccountControllerTest.java deleted file mode 100644 index d280621d391..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/ChartOfAccountControllerTest.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountSearch; -import org.egov.egf.master.domain.service.ChartOfAccountService; -import org.egov.egf.master.web.requests.ChartOfAccountRequest; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(ChartOfAccountController.class) -@Import(TestConfiguration.class) -public class ChartOfAccountControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private ChartOfAccountService chartOfAccountService; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Captor - private ArgumentCaptor captor; - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testCreate() throws IOException, Exception { - when(chartOfAccountService.add(any(List.class),any(BindingResult.class))) - .thenReturn((getChartOfAccounts())); - - mockMvc.perform(post("/chartofaccounts/_create?tenantId=default").content(resources.readRequest("chartofaccount/chartofaccount_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("chartofaccount/chartofaccount_create_valid_response.json"))); - - verify(chartOfAccountService).addToQue(captor.capture()); - - final ChartOfAccountRequest actualRequest = captor.getValue(); - assertEquals("AadharBank", actualRequest.getChartOfAccounts().get(0).getName()); - assertEquals("GLCode", actualRequest.getChartOfAccounts().get(0).getGlcode()); - assertEquals(true, actualRequest.getChartOfAccounts().get(0).getIsActiveForPosting()); - assertEquals("default", actualRequest.getChartOfAccounts().get(0).getTenantId()); - assertEquals(true, actualRequest.getChartOfAccounts().get(0).getBudgetCheckRequired()); - } - - @Test - public void testUpdate() throws IOException, Exception { - when(chartOfAccountService.update(any(List.class),any(BindingResult.class))) - .thenReturn((getUpdatedChartOfAccounts())); - - mockMvc.perform(post("/chartofaccounts/_update?tenantId=default").content(resources.readRequest("chartofaccount/chartofaccount_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("chartofaccount/chartofaccount_update_valid_response.json"))); - - verify(chartOfAccountService).addToQue(captor.capture()); - - final ChartOfAccountRequest actualRequest = captor.getValue(); - assertEquals("MunicipalBank", actualRequest.getChartOfAccounts().get(0).getName()); - assertEquals("GLCode", actualRequest.getChartOfAccounts().get(0).getGlcode()); - assertEquals("DefaultDescription", actualRequest.getChartOfAccounts().get(0).getDescription()); - assertEquals(true, actualRequest.getChartOfAccounts().get(0).getBudgetCheckRequired()); - assertEquals(true, actualRequest.getChartOfAccounts().get(0).getIsActiveForPosting()); - assertEquals("default", actualRequest.getChartOfAccounts().get(0).getTenantId()); - assertEquals(true, actualRequest.getChartOfAccounts().get(0).getFunctionRequired()); - assertEquals(true, actualRequest.getChartOfAccounts().get(0).getBudgetCheckRequired()); - } - - @Test - public void testSearch() throws IOException, Exception { - when(chartOfAccountService.search(any(ChartOfAccountSearch.class), any(BindingResult.class))) - .thenReturn((getPagination())); - - mockMvc.perform( - post("/chartofaccounts/_search?tenantId=default").content(resources.getRequestInfo()).contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(200)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("chartofaccount/chartofaccount_search_valid_response.json"))); - - - } - - private List getChartOfAccounts() { - List chartOfAccounts = new ArrayList(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder() - .glcode("GLCode").name("AadharBank") - .description("DefaultDescription").isActiveForPosting(true) - .type('B').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).majorCode("GLC").build(); - chartOfAccount.setTenantId("default"); - chartOfAccounts.add(chartOfAccount); - return chartOfAccounts; - } - - private List getUpdatedChartOfAccounts() { - List chartOfAccounts = new ArrayList(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder() - .glcode("GLCode").name("MunicipalBank") - .description("DefaultDescription").isActiveForPosting(true) - .type('B').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - chartOfAccounts.add(chartOfAccount); - return chartOfAccounts; - } - - private Pagination getPagination(){ - Pagination pgn = new Pagination<>(); - pgn.setCurrentPage(0); - pgn.setOffset(0); - pgn.setPageSize(500); - pgn.setTotalPages(1); - pgn.setTotalResults(1); - pgn.setPagedData(getChartOfAccounts()); - return pgn; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/ChartOfAccountDetailControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/ChartOfAccountDetailControllerTest.java deleted file mode 100644 index 7d94034e0ed..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/ChartOfAccountDetailControllerTest.java +++ /dev/null @@ -1,181 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.AccountDetailType; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.ChartOfAccountDetail; -import org.egov.egf.master.domain.model.ChartOfAccountDetailSearch; -import org.egov.egf.master.domain.service.ChartOfAccountDetailService; -import org.egov.egf.master.web.requests.ChartOfAccountDetailRequest; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(ChartOfAccountDetailController.class) -@Import(TestConfiguration.class) -public class ChartOfAccountDetailControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - private ChartOfAccountDetailService chartOfAccountDetailService; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Captor - private ArgumentCaptor captor; - - @Before - public void setUp() throws Exception { - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testCreate() throws IOException, Exception { - when(chartOfAccountDetailService.add(any(List.class),any(BindingResult.class))) - .thenReturn((getChartOfAccountDetails())); - - mockMvc.perform(post("/chartofaccountdetails/_create?tenantId=default").content(resources.readRequest("chartofaccountdetail/chartofaccountdetail_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("chartofaccountdetail/chartofaccountdetail_create_valid_response.json"))); - - verify(chartOfAccountDetailService).addToQue(captor.capture()); - - final ChartOfAccountDetailRequest actualRequest = captor.getValue(); - assertEquals("830bf3dc60504244babfe228bdf80bac", actualRequest.getChartOfAccountDetails().get(0).getChartOfAccount().getId()); - assertEquals("e647d2406902400cbf3cee71a4befb35", actualRequest.getChartOfAccountDetails().get(0).getAccountDetailType().getId()); - } - - @Test - public void testUpdate() throws IOException, Exception { - when(chartOfAccountDetailService.update(any(List.class),any(BindingResult.class))) - .thenReturn((getUpdatedChartOfAccountDetails())); - - mockMvc.perform(post("/chartofaccountdetails/_update?tenantId=default").content(resources.readRequest("chartofaccountdetail/chartofaccountdetail_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("chartofaccountdetail/chartofaccountdetail_update_valid_response.json"))); - - verify(chartOfAccountDetailService).addToQue(captor.capture()); - - final ChartOfAccountDetailRequest actualRequest = captor.getValue(); - assertEquals("4ff38860184f4f348fa9b9a9ebb25c53", actualRequest.getChartOfAccountDetails().get(0).getId()); - assertEquals("830bf3dc60504244babfe228bdf80bac", actualRequest.getChartOfAccountDetails().get(0).getChartOfAccount().getId()); - assertEquals("9ed569220386455fb3b1f1a81535396d", actualRequest.getChartOfAccountDetails().get(0).getAccountDetailType().getId()); -} - - @Test - public void testSearch() throws IOException, Exception { - when(chartOfAccountDetailService.search(any(ChartOfAccountDetailSearch.class), any(BindingResult.class))) - .thenReturn((getPagination())); - - mockMvc.perform( - post("/chartofaccountdetails/_search?tenantId=default").content(resources.getRequestInfo()).contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(200)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("chartofaccountdetail/chartofaccountdetail_search_valid_response.json"))); - } - - private List getChartOfAccountDetails(){ - - List chartOfAccountDetails = new ArrayList(); - ChartOfAccountDetail chartOfAccountDetail = ChartOfAccountDetail.builder().build(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("830bf3dc60504244babfe228bdf80bac").glcode("1201").name("finalfdf").description("accountNumber").build(); - chartOfAccount.setTenantId("default"); - AccountDetailType accountDetailType = AccountDetailType.builder().id("e647d2406902400cbf3cee71a4befb35").name("final").description("final").tableName("final").active(true).fullyQualifiedName("final").build(); - accountDetailType.setTenantId("default"); - chartOfAccountDetail.setTenantId("default"); - chartOfAccountDetail.setChartOfAccount(chartOfAccount); - chartOfAccountDetail.setAccountDetailType(accountDetailType); - chartOfAccountDetails.add(chartOfAccountDetail); - return chartOfAccountDetails; - } - - private List getChartOfAccountDetailsSearch(){ - - List chartOfAccountDetails = new ArrayList(); - ChartOfAccountDetail chartOfAccountDetail1 = ChartOfAccountDetail.builder().id("4ff38860184f4f348fa9b9a9ebb25c53").build(); - ChartOfAccountDetail chartOfAccountDetail2 = ChartOfAccountDetail.builder().id("9bea76ae70e04164a1f98df7b996ba0f").build(); - ChartOfAccountDetail chartOfAccountDetail3 = ChartOfAccountDetail.builder().id("cabf5df544af4253a1cc26aa80e57270").build(); - ChartOfAccount chartOfAccount1 = ChartOfAccount.builder().id("830bf3dc60504244babfe228bdf80bac").build(); - ChartOfAccount chartOfAccount2 = ChartOfAccount.builder().id("830bf3dc60504244babfe228bdf80bac").build(); - ChartOfAccount chartOfAccount3 = ChartOfAccount.builder().id("830bf3dc60504244babfe228bdf80bac").build(); - chartOfAccount1.setTenantId("default"); - chartOfAccount2.setTenantId("default"); - chartOfAccount3.setTenantId("default"); - AccountDetailType accountDetailType1 = AccountDetailType.builder().id("e647d2406902400cbf3cee71a4befb35").build(); - AccountDetailType accountDetailType2 = AccountDetailType.builder().id("e647d2406902400cbf3cee71a4befb35").build(); - AccountDetailType accountDetailType3 = AccountDetailType.builder().id("e647d2406902400cbf3cee71a4befb35").build(); - chartOfAccountDetail1.setTenantId("default"); - chartOfAccountDetail2.setTenantId("default"); - chartOfAccountDetail3.setTenantId("default"); - chartOfAccountDetail1.setChartOfAccount(chartOfAccount1); - chartOfAccountDetail1.setAccountDetailType(accountDetailType1); - chartOfAccountDetail2.setChartOfAccount(chartOfAccount2); - chartOfAccountDetail2.setAccountDetailType(accountDetailType2); - chartOfAccountDetail3.setChartOfAccount(chartOfAccount3); - chartOfAccountDetail3.setAccountDetailType(accountDetailType3); - chartOfAccountDetails.add(chartOfAccountDetail1); - chartOfAccountDetails.add(chartOfAccountDetail2); - chartOfAccountDetails.add(chartOfAccountDetail3); - return chartOfAccountDetails; - } - - private List getUpdatedChartOfAccountDetails(){ - List chartOfAccountDetails = new ArrayList(); - ChartOfAccountDetail chartOfAccountDetail = ChartOfAccountDetail.builder().id("4ff38860184f4f348fa9b9a9ebb25c53").build(); - ChartOfAccount chartOfAccount = ChartOfAccount.builder().id("830bf3dc60504244babfe228bdf80bac") - .glcode("updatedglcode").name("name") - .description("description").isActiveForPosting(true) - .type('B').classification((long) 123456) - .functionRequired(true).budgetCheckRequired(true).build(); - chartOfAccount.setTenantId("default"); - chartOfAccountDetail.setTenantId("default"); - AccountDetailType accountDetailType = AccountDetailType.builder().id("9ed569220386455fb3b1f1a81535396d").build(); - chartOfAccountDetail.setChartOfAccount(chartOfAccount); - chartOfAccountDetail.setAccountDetailType(accountDetailType); - chartOfAccountDetails.add(chartOfAccountDetail); - return chartOfAccountDetails; - } - - private Pagination getPagination(){ - Pagination pgn = new Pagination<>(); - pgn.setCurrentPage(0); - pgn.setOffset(0); - pgn.setPageSize(500); - pgn.setTotalPages(1); - pgn.setTotalResults(3); - pgn.setPagedData(getChartOfAccountDetailsSearch()); - return pgn; - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/FunctionControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/FunctionControllerTest.java deleted file mode 100644 index 341d5ae5449..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/FunctionControllerTest.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Function; -import org.egov.egf.master.domain.model.FunctionSearch; -import org.egov.egf.master.domain.service.FunctionService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(FunctionController.class) -@Import(TestConfiguration.class) -public class FunctionControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - FunctionService functionService; - - @Captor - private ArgumentCaptor> captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void testCreate() throws IOException, Exception { - when(functionService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getFunctions()); - mockMvc.perform( - post("/functions/_create?tenantId=default").content(resources.readRequest("function/function_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(201)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("function/function_create_valid_response.json"))); - - verify(functionService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("name", actualRequest.get(0).getName()); - assertEquals("code", actualRequest.get(0).getCode()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - when(functionService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getFunctions()); - mockMvc.perform(post("/functions/_create") - .content(resources.readRequest("function/function_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is5xxServerError()); - - } - - @Test - public void testUpdate() throws IOException, Exception { - when(functionService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getUpdateFunctions()); - - mockMvc.perform( - post("/functions/_update?tenantId=default").content(resources.readRequest("function/function_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(201)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("function/function_update_valid_response.json"))); - - verify(functionService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("nameU", actualRequest.get(0).getName()); - assertEquals("codeU", actualRequest.get(0).getCode()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getFunctions()); - page.getPagedData().get(0).setId("1"); - - when(functionService.search(any(FunctionSearch.class), any(BindingResult.class))).thenReturn(page); - - mockMvc.perform(post("/functions/_search?tenantId=default").content(resources.getRequestInfo()) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(200)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("function/function_search_valid_response.json"))); - - } - - private List getFunctions() { - List functions = new ArrayList(); - Function function = Function.builder().name("name").code("code").level(1).active(true).build(); - function.setTenantId("default"); - functions.add(function); - return functions; - } - - private List getUpdateFunctions() { - List functions = new ArrayList(); - Function function = Function.builder().name("nameU").code("codeU").active(true).id("1").level(2).build(); - function.setTenantId("default"); - functions.add(function); - return functions; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/FundControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/FundControllerTest.java deleted file mode 100644 index f0e7f526d6f..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/FundControllerTest.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.Fund; -import org.egov.egf.master.domain.model.FundSearch; -import org.egov.egf.master.domain.service.FundService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(FundController.class) -@Import(TestConfiguration.class) -public class FundControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - FundService fundService; - - @Captor - private ArgumentCaptor> captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void testCreate() throws IOException, Exception { - when(fundService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getFunds()); - mockMvc.perform(post("/funds/_create?tenantId=default") - .content(resources.readRequest("fund/fund_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("fund/fund_create_valid_response.json"))); - - verify(fundService).create(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("name", actualRequest.get(0).getName()); - assertEquals("code", actualRequest.get(0).getCode()); - assertEquals(Character.valueOf('I'), actualRequest.get(0).getIdentifier()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - when(fundService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getFunds()); - mockMvc.perform( - post("/funds/_create").content(resources.readRequest("fund/fund_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is5xxServerError()); - - } - - @Test - public void testUpdate() throws IOException, Exception { - when(fundService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getUpdateFunds()); - - mockMvc.perform(post("/funds/_update?tenantId=default") - .content(resources.readRequest("fund/fund_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("fund/fund_update_valid_response.json"))); - - verify(fundService).update(captor.capture(), any(BindingResult.class), any(RequestInfo.class)); - - final List actualRequest = captor.getValue(); - assertEquals("nameupdate", actualRequest.get(0).getName()); - assertEquals("code", actualRequest.get(0).getCode()); - assertEquals(Character.valueOf('U'), actualRequest.get(0).getIdentifier()); - assertEquals("default", actualRequest.get(0).getTenantId()); - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getFunds()); - page.getPagedData().get(0).setId("1"); - - when(fundService.search(any(FundSearch.class), any(BindingResult.class))).thenReturn(page); - - mockMvc.perform( - post("/funds/_search?tenantId=default").content(resources.getRequestInfo()).contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(200)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("fund/fund_search_valid_response.json"))); - - } - - private List getFunds() { - List funds = new ArrayList(); - Fund fund = Fund.builder().name("name").code("code").identifier('I').level(1234l).active(true).build(); - fund.setTenantId("default"); - funds.add(fund); - return funds; - } - - private List getUpdateFunds() { - List funds = new ArrayList(); - Fund fund = Fund.builder().name("nameupdate").code("code").identifier('U').active(true).id("1").level(1234l).build(); - fund.setTenantId("default"); - funds.add(fund); - return funds; - } -} diff --git a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/RecoveryControllerTest.java b/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/RecoveryControllerTest.java deleted file mode 100644 index 3561e5b68b0..00000000000 --- a/business-services/egf-master/src/test/java/org/egov/egf/master/web/controller/RecoveryControllerTest.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.egov.egf.master.web.controller; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.egov.common.contract.request.RequestInfo; -import org.egov.common.domain.model.Pagination; -import org.egov.common.utils.RequestJsonReader; -import org.egov.egf.master.TestConfiguration; -import org.egov.egf.master.domain.model.ChartOfAccount; -import org.egov.egf.master.domain.model.Recovery; -import org.egov.egf.master.domain.model.RecoverySearch; -import org.egov.egf.master.domain.service.RecoveryService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.context.annotation.Import; -import org.springframework.http.MediaType; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.validation.BindingResult; - -@RunWith(SpringRunner.class) -@WebMvcTest(RecoveryController.class) -@Import(TestConfiguration.class) -public class RecoveryControllerTest { - - @Autowired - private MockMvc mockMvc; - - @MockBean - RecoveryService recoveryService; - - @Captor - private ArgumentCaptor> captor; - - private RequestJsonReader resources = new RequestJsonReader(); - - @Test - public void testCreate() throws IOException, Exception { - when(recoveryService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getRecoverys()); - mockMvc.perform(post("/recoverys/_create?tenantId=default") - .content(resources.readRequest("recovery/recovery_create_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("recovery/recovery_create_valid_response.json"))); - } - - @Test - public void testCreate_Error() throws IOException, Exception { - when(recoveryService.create(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getRecoverys()); - mockMvc.perform( - post("/recoverys/_create").content(resources.readRequest("recovery/recovery_create_invalid_field_value.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is5xxServerError()); - - } - - @Test - public void testUpdate() throws IOException, Exception { - when(recoveryService.update(any(List.class), any(BindingResult.class), any(RequestInfo.class))) - .thenReturn(getUpdateRecoverys()); - - mockMvc.perform(post("/recoverys/_update?tenantId=default") - .content(resources.readRequest("recovery/recovery_update_valid_request.json")) - .contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(status().is(201)) - .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)).andExpect(content().json(resources - .readResponse("recovery/recovery_update_valid_response.json"))); - } - - @Test - public void test_search() throws IOException, Exception { - - Pagination page = new Pagination<>(); - page.setTotalPages(1); - page.setTotalResults(1); - page.setCurrentPage(0); - page.setPagedData(getRecoverys()); - page.getPagedData().get(0).setId("1"); - - when(recoveryService.search(any(RecoverySearch.class), any(BindingResult.class))).thenReturn(page); - - mockMvc.perform( - post("/recoverys/_search?tenantId=default").content(resources.getRequestInfo()).contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(status().is(200)).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8)) - .andExpect(content().json(resources.readResponse("recovery/recovery_search_valid_response.json"))); - - } - - private List getRecoverys() { - List recoverys = new ArrayList(); - Recovery recovery = Recovery.builder().name("name").code("code").type("M").mode('M').remittanceMode('M').active(true).build(); - recovery.setTenantId("default"); - recovery.setChartOfAccount(getCOAccount()); - recovery.setRemitted("S"); - recovery.setIfscCode("SBIN0005532"); - recovery.setAccountNumber("3049223457"); - recovery.setId("1"); - recoverys.add(recovery); - return recoverys; - } - - private ChartOfAccount getCOAccount() { - ChartOfAccount chartOfAccount = new ChartOfAccount(); - chartOfAccount.setGlcode("341"); - chartOfAccount.setTenantId("default"); - return chartOfAccount; - } - - private List getUpdateRecoverys() { - List recoverys = new ArrayList(); - Recovery recovery = Recovery.builder().name("nameU").code("codeU").type("M").mode('M').remittanceMode('M').active(true).build(); - recovery.setTenantId("default"); - recovery.setChartOfAccount(getCOAccount()); - recovery.setRemitted("S"); - recovery.setIfscCode("SBIN0005532"); - recovery.setAccountNumber("3049223457"); - recovery.setId("1"); - recoverys.add(recovery); - return recoverys; - } - -} diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_invalid_field_value.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_invalid_field_value.json deleted file mode 100644 index 0b8e3e77fa2..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_invalid_field_value.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "accountCodePurpose": - { - "name":"namee", - "tenantId":"default" - } - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_request.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_request.json deleted file mode 100644 index 3d20fe45643..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_request.json +++ /dev/null @@ -1,9 +0,0 @@ -"accountCodePurposes": - [ - { - "id":"1", - "name":"name", - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_response.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_response.json deleted file mode 100644 index 8a213eb4619..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_create_response.json +++ /dev/null @@ -1,7 +0,0 @@ - "accountCodePurposes": [ - { - "id": "1", - "name": "name", - "tenantId": "default" - } - ] diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_search_request.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_search_request.json deleted file mode 100644 index e788be4470b..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_search_request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_search_response.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_search_response.json deleted file mode 100644 index 325de61b920..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_search_response.json +++ /dev/null @@ -1,16 +0,0 @@ -"accountCodePurposes": [ - { - "id": "1", - "name": "name", - "tenantId":"default" - } - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_allrequest.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_allrequest.json deleted file mode 100644 index 97a790982ca..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_allrequest.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "accountCodePurposes": - [ - { - "id":1, - "name":"accountCodePurposeUU", - "tenantId":"default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_allresponse.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_allresponse.json deleted file mode 100644 index 09574dfee83..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_allresponse.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "responseInfo": { - "resMsgId": "placeholder", - "status": "200", - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - }, - "accountCodePurposes": [ - { - "id": 1, - "name": "accountCodePurposeUU", - "createdBy": null, - "createdDate": null, - "lastModifiedBy": null, - "lastModifiedDate": null, - "tenantId": "default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_request.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_request.json deleted file mode 100644 index aa5629c6f0f..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_request.json +++ /dev/null @@ -1,7 +0,0 @@ - "accountCodePurposes": [ - { - "id":"1", - "name":"nameU", - "tenantId":"default" - }] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_response.json b/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_response.json deleted file mode 100644 index ca7dddc5a0e..00000000000 --- a/business-services/egf-master/src/test/resources/accountcodepurpose/accountcodepurpose_update_response.json +++ /dev/null @@ -1,7 +0,0 @@ - "accountCodePurposes": [ - { - "id":"1", - "name":"nameU", - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_invalid_fieldvalue.json b/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_invalid_fieldvalue.json deleted file mode 100644 index 8328799b60b..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_invalid_fieldvalue.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - "accountDetailKeys": - [ - { - "id":"1", - "key":null, - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] - -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_request.json b/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_request.json deleted file mode 100644 index f038210dbe7..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_request.json +++ /dev/null @@ -1,13 +0,0 @@ -"accountDetailKeys": - [ - { - "id":"1", - "key":"1", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_response.json b/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_response.json deleted file mode 100644 index f038210dbe7..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_create_response.json +++ /dev/null @@ -1,13 +0,0 @@ -"accountDetailKeys": - [ - { - "id":"1", - "key":"1", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_search_response.json b/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_search_response.json deleted file mode 100644 index ec45ee388ea..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_search_response.json +++ /dev/null @@ -1,24 +0,0 @@ -"accountDetailKeys": - [ - { - "id":"1", - "key":"1", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] - -, - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_update_request.json b/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_update_request.json deleted file mode 100644 index b6c7a45a2e3..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_update_request.json +++ /dev/null @@ -1,13 +0,0 @@ - "accountDetailKeys": - [ - { - "id":"1", - "key":"2", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_update_response.json b/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_update_response.json deleted file mode 100644 index ca517180550..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailkey/accountdetailkey_update_response.json +++ /dev/null @@ -1,13 +0,0 @@ -"accountDetailKeys": - [ - { - "id":"1", - "key":"2", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_invalid_fieldvalue.json b/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_invalid_fieldvalue.json deleted file mode 100644 index 5344a8a5ecd..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_invalid_fieldvalue.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "accountDetailTypes": - [ - { - "id":"1", - "name":"nameU", - "tableName":"abc", - "fullyQualifiedName":"abc/contractor", - "tenantId":"default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_request.json b/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_request.json deleted file mode 100644 index 818361c0183..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_request.json +++ /dev/null @@ -1,11 +0,0 @@ -"accountDetailTypes": - [ - { - "id":"1", - "name":"name", - "tableName":"contractor", - "fullyQualifiedName":"abc/contractor", - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_response.json b/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_response.json deleted file mode 100644 index 818361c0183..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_create_response.json +++ /dev/null @@ -1,11 +0,0 @@ -"accountDetailTypes": - [ - { - "id":"1", - "name":"name", - "tableName":"contractor", - "fullyQualifiedName":"abc/contractor", - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_search_response.json b/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_search_response.json deleted file mode 100644 index 530923cc58f..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_search_response.json +++ /dev/null @@ -1,20 +0,0 @@ - "accountDetailTypes": - [ - { - "id":"1", - "name":"name", - "tableName":"contractor", - "fullyQualifiedName":"abc/contractor", - "tenantId":"default" - } - - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_update_request.json b/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_update_request.json deleted file mode 100644 index 1b9a22b8593..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_update_request.json +++ /dev/null @@ -1,11 +0,0 @@ - "accountDetailTypes": - [ - { - "id":"1", - "name":"nameU", - "tableName":"contractorU", - "fullyQualifiedName":"abc/contractorU", - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_update_response.json b/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_update_response.json deleted file mode 100644 index c9e1a965a5d..00000000000 --- a/business-services/egf-master/src/test/resources/accountdetailtype/accountdetailtype_update_response.json +++ /dev/null @@ -1,11 +0,0 @@ -"accountDetailTypes": - [ - { - "id":"1", - "name":"nameU", - "tableName":"contractorU", - "fullyQualifiedName":"abc/contractorU", - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountentity/accountentity_create_invalid_fieldvalue.json b/business-services/egf-master/src/test/resources/accountentity/accountentity_create_invalid_fieldvalue.json deleted file mode 100644 index 9177c80641c..00000000000 --- a/business-services/egf-master/src/test/resources/accountentity/accountentity_create_invalid_fieldvalue.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "accountEntities": - [ - { - "id":"1", - "name":"nameee", - "code":"code", - "accountDetailType":null, - "active":true, - "description":"entity", - "tenantId":"default" - } - - ] - - - } \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountentity/accountentity_create_request.json b/business-services/egf-master/src/test/resources/accountentity/accountentity_create_request.json deleted file mode 100644 index 3fd245a4bfa..00000000000 --- a/business-services/egf-master/src/test/resources/accountentity/accountentity_create_request.json +++ /dev/null @@ -1,16 +0,0 @@ -"accountEntities": - [ - { - "id":"1", - "name":"name", - "code":"code", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "active":true, - "description":"entity", - "tenantId":"default" - } - - ] diff --git a/business-services/egf-master/src/test/resources/accountentity/accountentity_create_response.json b/business-services/egf-master/src/test/resources/accountentity/accountentity_create_response.json deleted file mode 100644 index 1a0a4fec471..00000000000 --- a/business-services/egf-master/src/test/resources/accountentity/accountentity_create_response.json +++ /dev/null @@ -1,15 +0,0 @@ -"accountEntities": -[ - { - "id": "1", - "name": "name", - "code": "code", - "accountDetailType": { - "id": "1", - "tenantId": "default" - }, - "active": true, - "description": "entity", - "tenantId": "default" - } -] diff --git a/business-services/egf-master/src/test/resources/accountentity/accountentity_search_response.json b/business-services/egf-master/src/test/resources/accountentity/accountentity_search_response.json deleted file mode 100644 index f605c816e62..00000000000 --- a/business-services/egf-master/src/test/resources/accountentity/accountentity_search_response.json +++ /dev/null @@ -1,28 +0,0 @@ -"accountEntities": -[ - { - "id":"1", - "name":"name", - "code":"code", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "active":true, - "description":"entity", - "tenantId":"default" - } - -] - - -, - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/accountentity/accountentity_update_request.json b/business-services/egf-master/src/test/resources/accountentity/accountentity_update_request.json deleted file mode 100644 index 9cbd36cdd47..00000000000 --- a/business-services/egf-master/src/test/resources/accountentity/accountentity_update_request.json +++ /dev/null @@ -1,16 +0,0 @@ -"accountEntities": -[ - { - "id":"1", - "name":"nameU", - "code":"codeU", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "active":true, - "description":"entity", - "tenantId":"default" - } - -] diff --git a/business-services/egf-master/src/test/resources/accountentity/accountentity_update_response.json b/business-services/egf-master/src/test/resources/accountentity/accountentity_update_response.json deleted file mode 100644 index 9cbd36cdd47..00000000000 --- a/business-services/egf-master/src/test/resources/accountentity/accountentity_update_response.json +++ /dev/null @@ -1,16 +0,0 @@ -"accountEntities": -[ - { - "id":"1", - "name":"nameU", - "code":"codeU", - "accountDetailType":{ - "id":"1", - "tenantId":"default" - }, - "active":true, - "description":"entity", - "tenantId":"default" - } - -] diff --git a/business-services/egf-master/src/test/resources/application.properties b/business-services/egf-master/src/test/resources/application.properties deleted file mode 100644 index 190f6aeae25..00000000000 --- a/business-services/egf-master/src/test/resources/application.properties +++ /dev/null @@ -1,96 +0,0 @@ -app.timezone=UTC - -fetch_data_from=db - -persist.through.kafka=yes - -es.host=localhost -es.transport.port=9300 -es.cluster.name=docker-cluster - - -kafka.topics.egf.masters.validated.key=egov.egf.masters.bank.validated.key - - -#Kafka Topic config -kafka.topics.egf.masters.validated.topic=egov.egf.masters.validated.topic -kafka.topics.egf.masters.validated.group=egov.egf.masters.validated.group -kafka.topics.egf.masters.validated.id=egov.egf.masters.bank.validated.id - -kafka.topics.egf.masters.completed.topic=egov.egf.masters.completed -kafka.topics.egf.masters.completed.group=egov.egf.masters.completed.group - -kafka.topics.egf.masters.bank.validated.key=egov.egf.masters.bank.validated.key -kafka.topics.egf.masters.bankbranch.validated.key=egov.egf.masters.bankbranch.validated.key -kafka.topics.egf.masters.bankaccount.validated.key=egov.egf.masters.bankaccount.validated.key -kafka.topics.egf.masters.accountcodepurpose.validated.key=egov.egf.masters.accountcodepurpose.validated.key -kafka.topics.egf.masters.accountdetailkey.validated.key=egov.egf.masters.accountdetailkey.validated.key -kafka.topics.egf.masters.accountdetailtype.validated.key=egov.egf.masters.accountdetailtype.validated.key -kafka.topics.egf.masters.accountentity.validated.key=egov.egf.masters.accountentity.validated.key -kafka.topics.egf.masters.budgetgroup.validated.key=egov.egf.masters.budgetgroup.validated.key -kafka.topics.egf.masters.chartofaccount.validated.key=egov.egf.masters.chartofaccount.validated.key -kafka.topics.egf.masters.chartofaccountdetail.validated.key=egov.egf.masters.chartofaccountdetail.validated.key -kafka.topics.egf.masters.financialyear.validated.key=egov.egf.masters.financialyear.validated.key -kafka.topics.egf.masters.fiscalperiod.validated.key=egov.egf.masters.fiscalperiod.validated.key -kafka.topics.egf.masters.functionary.validated.key=egov.egf.masters.functionary.validated.key -kafka.topics.egf.masters.function.validated.key=egov.egf.masters.function.validated.key -kafka.topics.egf.masters.fund.validated.key=egov.egf.masters.fund.validated.key -kafka.topics.egf.masters.fundsource.validated.key=egov.egf.masters.fundsource.validated.key -kafka.topics.egf.masters.scheme.validated.key=egov.egf.masters.scheme.validated.key -kafka.topics.egf.masters.subscheme.validated.key=egov.egf.masters.subscheme.validated.key -kafka.topics.egf.masters.supplier.validated.key=egov.egf.masters.supplierfund.validated.key -kafka.topics.egf.masters.financialstatus.validated.key=egov.egf.masters.financialstatus.validated.key -kafka.topics.egf.masters.financialconfiguration.validated.key=egov.egf.masters.financialconfiguration.validated.key -kafka.topics.egf.masters.recovery.validated.key=egov.egf.masters.recovery.validated.key - - - -kafka.topics.egf.masters.bank.completed.key=egov.egf.masters.bank.completed.key -kafka.topics.egf.masters.bankbranch.completed.key=egov.egf.masters.bankbranch.completed.key -kafka.topics.egf.masters.bankaccount.completed.key=egov.egf.masters.bankaccount.completed.key -kafka.topics.egf.masters.accountcodepurpose.completed.key=egov.egf.masters.accountcodepurpose.completed.key -kafka.topics.egf.masters.accountdetailkey.completed.key=egov.egf.masters.accountdetailkey.completed.key -kafka.topics.egf.masters.accountdetailtype.completed.key=egov.egf.masters.accountdetailtype.completed.key -kafka.topics.egf.masters.accountentity.completed.key=egov.egf.masters.accountentity.completed.key -kafka.topics.egf.masters.budgetgroup.completed.key=egov.egf.masters.budgetgroup.completed.key -kafka.topics.egf.masters.chartofaccount.completed.key=egov.egf.masters.chartofaccount.completed.key -kafka.topics.egf.masters.chartofaccountdetail.completed.key=egov.egf.masters.chartofaccountdetail.completed.key -kafka.topics.egf.masters.financialyear.completed.key=egov.egf.masters.financialyear.completed.key -kafka.topics.egf.masters.fiscalperiod.completed.key=egov.egf.masters.fiscalperiod.completed.key -kafka.topics.egf.masters.functionary.completed.key=egov.egf.masters.functionary.completed.key -kafka.topics.egf.masters.function.completed.key=egov.egf.masters.function.completed.key -kafka.topics.egf.masters.fund.completed.key=egov.egf.masters.fund.completed.key -kafka.topics.egf.masters.fundsource.completed.key=egov.egf.masters.fundsource.completed.key -kafka.topics.egf.masters.scheme.completed.key=egov.egf.masters.scheme.completed.key -kafka.topics.egf.masters.subscheme.completed.key=egov.egf.masters.subscheme.completed.key -kafka.topics.egf.masters.supplier.completed.key=egov.egf.masters.supplier.completed.key -kafka.topics.egf.masters.financialstatus.completed.key=egov.egf.masters.financialstatus.completed.key -kafka.topics.egf.masters.financialconfiguration.completed.key=egov.egf.masters.financialconfiguration.completed.key -kafka.topics.egf.masters.recovery.completed.key=egov.egf.masters.recovery.completed.key - - - - -egf.master.host.url=http://localhost:8280 - -logging.pattern.console=%clr(%X{CORRELATION_ID:-}) %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} - - -spring.kafka.consumer.value-deserializer=org.egov.common.queue.HashMapDeserializer -spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.group-id=egf-master -spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer -spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer - -spring.datasource.driver-class-name=org.postgresql.Driver - -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres -spring.datasource.username=postgres -spring.datasource.password=postgres -flyway.user=postgres -flyway.password=postgres -flyway.outOfOrder=true -flyway.table=egf_masters_schema_version -flyway.baseline-on-migrate=true -flyway.url=jdbc:postgresql://localhost:5432/postgres -flyway.locations=db/migration/main diff --git a/business-services/egf-master/src/test/resources/bank/bank_create_invalid_field_value.json b/business-services/egf-master/src/test/resources/bank/bank_create_invalid_field_value.json deleted file mode 100644 index eb6e7d396f9..00000000000 --- a/business-services/egf-master/src/test/resources/bank/bank_create_invalid_field_value.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requestInfo":{ - "action":"action", - "did":"did", - "msgId":"msgId", - "requesterId":"requesterId", - "ts":"01-01-2017 01:01:01", - "authToken":null - }, - "banks":[ - { - "code":"code", - "name":"name", - "description":"description", - "active":true, - "type":1, - "tenantId":"default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bank/bank_create_valid_request.json b/business-services/egf-master/src/test/resources/bank/bank_create_valid_request.json deleted file mode 100644 index 40b02a384f9..00000000000 --- a/business-services/egf-master/src/test/resources/bank/bank_create_valid_request.json +++ /dev/null @@ -1,10 +0,0 @@ -"banks":[ - { - "code":"code", - "name":"name", - "description":"description", - "active":true, - "type":"type", - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bank/bank_create_valid_response.json b/business-services/egf-master/src/test/resources/bank/bank_create_valid_response.json deleted file mode 100644 index 40b02a384f9..00000000000 --- a/business-services/egf-master/src/test/resources/bank/bank_create_valid_response.json +++ /dev/null @@ -1,10 +0,0 @@ -"banks":[ - { - "code":"code", - "name":"name", - "description":"description", - "active":true, - "type":"type", - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bank/bank_search_valid_response.json b/business-services/egf-master/src/test/resources/bank/bank_search_valid_response.json deleted file mode 100644 index 40b02a384f9..00000000000 --- a/business-services/egf-master/src/test/resources/bank/bank_search_valid_response.json +++ /dev/null @@ -1,10 +0,0 @@ -"banks":[ - { - "code":"code", - "name":"name", - "description":"description", - "active":true, - "type":"type", - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bank/bank_update_valid_request.json b/business-services/egf-master/src/test/resources/bank/bank_update_valid_request.json deleted file mode 100644 index d7dd3d3eb26..00000000000 --- a/business-services/egf-master/src/test/resources/bank/bank_update_valid_request.json +++ /dev/null @@ -1,10 +0,0 @@ -"banks":[ - { - "code":"codeupdate", - "name":"nameupdate", - "description":"descriptionupdate", - "active":true, - "type":"typeupdate", - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bank/bank_update_valid_response.json b/business-services/egf-master/src/test/resources/bank/bank_update_valid_response.json deleted file mode 100644 index d7dd3d3eb26..00000000000 --- a/business-services/egf-master/src/test/resources/bank/bank_update_valid_response.json +++ /dev/null @@ -1,10 +0,0 @@ -"banks":[ - { - "code":"codeupdate", - "name":"nameupdate", - "description":"descriptionupdate", - "active":true, - "type":"typeupdate", - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankSearchRequest.json b/business-services/egf-master/src/test/resources/bankSearchRequest.json deleted file mode 100644 index 93e3ed14e17..00000000000 --- a/business-services/egf-master/src/test/resources/bankSearchRequest.json +++ /dev/null @@ -1,16 +0,0 @@ - { - "action": "_search", - "did": "", - "msgid": "", - "requesterId": "1", - "authToken": "", - "apiId": "org.egov.egf.bank", - "ver": "1", - "ts": "", - "key": null, - "tenantId": "ap.kurnool", - "userInfo":{ - - } - } - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankSearchResponse.json b/business-services/egf-master/src/test/resources/bankSearchResponse.json deleted file mode 100644 index 93e3ed14e17..00000000000 --- a/business-services/egf-master/src/test/resources/bankSearchResponse.json +++ /dev/null @@ -1,16 +0,0 @@ - { - "action": "_search", - "did": "", - "msgid": "", - "requesterId": "1", - "authToken": "", - "apiId": "org.egov.egf.bank", - "ver": "1", - "ts": "", - "key": null, - "tenantId": "ap.kurnool", - "userInfo":{ - - } - } - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_create_valid_request.json b/business-services/egf-master/src/test/resources/bankaccount/bankAccount_create_valid_request.json deleted file mode 100644 index ae4f22cf732..00000000000 --- a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_create_valid_request.json +++ /dev/null @@ -1,29 +0,0 @@ - - "bankAccounts":[ - { - "bankBranch":{ - "id":"1", - "bank":{ - "id":"1", - "active":true, - "type":"Bank", - "tenantId":"default" - }, - "tenantId":"default" - }, - "chartOfAccount":{ - "id":"1", - "tenantId":"default" - }, - "fund":{ - "id":"2", - "tenantId":"default" - }, - "accountNumber":"0004", - "accountType":"test", - "description":"accountNumber", - "active":true, - "payTo":"tester", - "tenantId":"default" - } - ] diff --git a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_create_valid_response.json b/business-services/egf-master/src/test/resources/bankaccount/bankAccount_create_valid_response.json deleted file mode 100644 index 40bc1ae8f92..00000000000 --- a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_create_valid_response.json +++ /dev/null @@ -1,27 +0,0 @@ - - "bankAccounts":[ - { - "id":null, - "bankBranch":{ - "id":"1", - "bank":{ - "id":"1" - }, - "tenantId":"default" - }, - "chartOfAccount":{ - "id":"1", - "tenantId":"default" - }, - "fund":{ - "id":"2", - "tenantId":"default" - }, - "accountNumber":"0004", - "accountType":"test", - "description":"accountNumber", - "active":true, - "payTo":"tester", - "tenantId":"default" - } - ] diff --git a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_search_valid_response.json b/business-services/egf-master/src/test/resources/bankaccount/bankAccount_search_valid_response.json deleted file mode 100644 index 571fb38eda5..00000000000 --- a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_search_valid_response.json +++ /dev/null @@ -1,18 +0,0 @@ - "bankAccounts": [ - { - "id": "1", - "bankBranch": { - "id": "1" - }, - "chartOfAccount": { - "id": "1" - }, - "fund": { - "id": "2" - }, - "accountNumber": "0004", - "accountType": "test", - "active": true, - "tenantId": "default" - } - ] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_update_valid_request.json b/business-services/egf-master/src/test/resources/bankaccount/bankAccount_update_valid_request.json deleted file mode 100644 index 8121546a7e0..00000000000 --- a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_update_valid_request.json +++ /dev/null @@ -1,29 +0,0 @@ - - "bankAccounts":[ - { - "bankBranch":{ - "id":"1", - "bank":{ - "id":"1", - "active":true, - "type":"Bank", - "tenantId":"default" - }, - "tenantId":"default" - }, - "chartOfAccount":{ - "id":"1", - "tenantId":"default" - }, - "fund":{ - "id":"2", - "tenantId":"default" - }, - "accountNumber":"0004", - "accountType":"testupdate", - "description":"accountNumber", - "active":true, - "payTo":"tester", - "tenantId":"default" - } - ] diff --git a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_update_valid_response.json b/business-services/egf-master/src/test/resources/bankaccount/bankAccount_update_valid_response.json deleted file mode 100644 index 87a57ce74a5..00000000000 --- a/business-services/egf-master/src/test/resources/bankaccount/bankAccount_update_valid_response.json +++ /dev/null @@ -1,27 +0,0 @@ - - "bankAccounts":[ - { - "id":null, - "bankBranch":{ - "id":"1", - "bank":{ - "id":"1" - }, - "tenantId":"default" - }, - "chartOfAccount":{ - "id":"1", - "tenantId":"default" - }, - "fund":{ - "id":"2", - "tenantId":"default" - }, - "accountNumber":"0004", - "accountType":"testupdate", - "description":"accountNumber", - "active":true, - "payTo":"tester", - "tenantId":"default" - } - ] diff --git a/business-services/egf-master/src/test/resources/bankaccount/bankaccount_create_invalid_field_value.json b/business-services/egf-master/src/test/resources/bankaccount/bankaccount_create_invalid_field_value.json deleted file mode 100644 index 46ff1c45ece..00000000000 --- a/business-services/egf-master/src/test/resources/bankaccount/bankaccount_create_invalid_field_value.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "requestInfo": { - "resMsgId": "placeholder", - "status": "200", - "apiId": null, - "ver": null, - "ts": "01-01-2017 01:01:01", - "key": null, - "userInfo": { - "id": 1 - } - }, - "bankAccounts":[ - { - "fund":{ - "id":"2", - "tenantId":"default" - }, - "accountNumber":"2212", - "accountType":"test", - "description":"accountNumber", - "active":true, - "payTo":"tester", - "tenantId":"default" - } - ] diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_invalid_field_value.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_invalid_field_value.json deleted file mode 100644 index c5a8014b750..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_invalid_field_value.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "requestInfo": { - "resMsgId": "placeholder", - "status": "200", - "apiId": null, - "ver": null, - "ts": "01-01-2017 01:01:01", - "key": null, - "userInfo": { - "id": 1 - } - }, - "bankBranches": [ - { - "bank": { - "id": 1 - }, - "code": "code", - "name": "name", - "address": "Bangalore", - "address2": "Bangalore", - "city": "Bangalore", - "state": "Bangalore", - "pincode": "Bangalore", - "phone": "Bangalore", - "fax": "Bangalore", - "contactPerson": "Bangalore", - "active": true, - "description": "Bangalore", - "micr": "Bangalore", - "tenantId": "default" - } - ] -} diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_request.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_request.json deleted file mode 100644 index 3475d461f02..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_request.json +++ /dev/null @@ -1,21 +0,0 @@ -"bankBranches":[ - { - "bank":{ - "id":1 - }, - "code":"code", - "name":"name", - "address":"Bangalore", - "address2":"Bangalore", - "city":"Bangalore", - "state":"Bangalore", - "pincode":"Bangalore", - "phone":"Bangalore", - "fax":"Bangalore", - "contactPerson":"Bangalore", - "active":true, - "description":"Bangalore", - "micr":"Bangalore", - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_response.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_response.json deleted file mode 100644 index bb231532c04..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_create_response.json +++ /dev/null @@ -1,26 +0,0 @@ -"bankBranches":[ - { - "id":null, - "code":"code", - "name":"name", - "bank":{ - "id":"1" - }, - "address":"Bangalore", - "address2":"Bangalore", - "city":"Bangalore", - "state":"Bangalore", - "pincode":"Bangalore", - "phone":"Bangalore", - "fax":"Bangalore", - "contactPerson":"Bangalore", - "active":true, - "description":"Bangalore", - "micr":"Bangalore", - "createdBy":null, - "createdDate":null, - "lastModifiedBy":null, - "lastModifiedDate":null, - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_search_request.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_search_request.json deleted file mode 100644 index e788be4470b..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_search_request.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_search_response.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_search_response.json deleted file mode 100644 index dc4e346f2b4..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_search_response.json +++ /dev/null @@ -1,26 +0,0 @@ -"bankBranches":[ - { - "id":"1", - "code":"code", - "name":"name", - "bank":{ - "id":"1" - }, - "address":"Bangalore", - "address2":"Bangalore", - "city":"Bangalore", - "state":"Bangalore", - "pincode":"Bangalore", - "phone":"Bangalore", - "fax":"Bangalore", - "contactPerson":"Bangalore", - "active":true, - "description":"Bangalore", - "micr":"Bangalore", - "createdBy":null, - "createdDate":null, - "lastModifiedBy":null, - "lastModifiedDate":null, - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_allrequest.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_allrequest.json deleted file mode 100644 index 4542896d3b0..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_allrequest.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "requestInfo": - { - "resMsgId": "placeholder", - "status": "200", - "apiId": null, - "ver": null, - "ts": "01-01-2017 01:01:01", - "key": null, - "userInfo":{ - "id":1 - } - }, - "bankBranches": [ - { - "id":1, - "bank": - { - "id":1 - - }, - "code":"codeU", - "name":"nameU", - "address": "Bangalore", - "address2": "Bangalore", - "city": "Bangalore", - "state": "Bangalore", - "pincode": "Bangalore", - "phone": "Bangalore", - "fax": "Bangalore", - "contactPerson": "Bangalore", - "active": true, - "description": "Bangalore", - "micr": "Bangalore", - "tenantId":"default" - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_allresponse.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_allresponse.json deleted file mode 100644 index fa85144cf08..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_allresponse.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "responseInfo": { - "resMsgId": "placeholder", - "status": "200", - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - }, - "bankBranches": [ - { - "id": 1, - "code": "codeU", - "name": "nameU", - "bank": { - "id": 1 - }, - "address": "Bangalore", - "address2": "Bangalore", - "city": "Bangalore", - "state": "Bangalore", - "pincode": "Bangalore", - "phone": "Bangalore", - "fax": "Bangalore", - "contactPerson": "Bangalore", - "active": true, - "description": "Bangalore", - "micr": "Bangalore", - "createdBy": null, - "createdDate": null, - "lastModifiedBy": null, - "lastModifiedDate": null, - "tenantId": "default" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_request.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_request.json deleted file mode 100644 index 8db28aae9b4..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_request.json +++ /dev/null @@ -1,26 +0,0 @@ -"bankBranches":[ - { - "id":null, - "code":"codeupdate", - "name":"nameupdate", - "bank":{ - "id":"1" - }, - "address":"Bangalore", - "address2":"Bangalore", - "city":"Bangalore", - "state":"Bangalore", - "pincode":"Bangalore", - "phone":"Bangalore", - "fax":"Bangalore", - "contactPerson":"Bangalore", - "active":true, - "description":"Bangalore", - "micr":"Bangalore", - "createdBy":null, - "createdDate":null, - "lastModifiedBy":null, - "lastModifiedDate":null, - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_response.json b/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_response.json deleted file mode 100644 index 8db28aae9b4..00000000000 --- a/business-services/egf-master/src/test/resources/bankbranch/bankbranch_update_response.json +++ /dev/null @@ -1,26 +0,0 @@ -"bankBranches":[ - { - "id":null, - "code":"codeupdate", - "name":"nameupdate", - "bank":{ - "id":"1" - }, - "address":"Bangalore", - "address2":"Bangalore", - "city":"Bangalore", - "state":"Bangalore", - "pincode":"Bangalore", - "phone":"Bangalore", - "fax":"Bangalore", - "contactPerson":"Bangalore", - "active":true, - "description":"Bangalore", - "micr":"Bangalore", - "createdBy":null, - "createdDate":null, - "lastModifiedBy":null, - "lastModifiedDate":null, - "tenantId":"default" - } -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_create_valid_request.json b/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_create_valid_request.json deleted file mode 100644 index 7a7adb7f79a..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_create_valid_request.json +++ /dev/null @@ -1,15 +0,0 @@ - "chartOfAccounts": - [ - { - "glcode":"GLCode", - "name":"AadharBank", - "isActiveForPosting":true, - "type":"B", - "classification":123456, - "functionRequired":true, - "budgetCheckRequired":true, - "tenantId":"default" - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_create_valid_response.json b/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_create_valid_response.json deleted file mode 100644 index 7e98fabc838..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_create_valid_response.json +++ /dev/null @@ -1,12 +0,0 @@ - "chartOfAccounts": [ - { - "glcode": "GLCode", - "name": "AadharBank", - "isActiveForPosting": true, - "type": "B", - "classification": 123456, - "functionRequired": true, - "budgetCheckRequired": true, - "tenantId": "default" - } - ] diff --git a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_search_valid_request.json b/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_search_valid_request.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_search_valid_response.json b/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_search_valid_response.json deleted file mode 100644 index 60d60e271d1..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_search_valid_response.json +++ /dev/null @@ -1,19 +0,0 @@ -"chartOfAccounts": [ - { - "name": "AadharBank", - "isActiveForPosting": true, - "type": "B", - "classification": 123456, - "functionRequired": true, - "budgetCheckRequired": true, - "majorCode": "GLC", - "tenantId": "default" - } - ], - "page": { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } diff --git a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_update_valid_request.json b/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_update_valid_request.json deleted file mode 100644 index 224fd9bef39..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_update_valid_request.json +++ /dev/null @@ -1,16 +0,0 @@ - "chartOfAccounts": - [ - { - "glcode":"GLCode", - "name":"MunicipalBank", - "isActiveForPosting":true, - "description": "DefaultDescription", - "type":"B", - "classification":123456, - "functionRequired":true, - "budgetCheckRequired":true, - "tenantId":"default" - } - - ] - diff --git a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_update_valid_response.json b/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_update_valid_response.json deleted file mode 100644 index d36483fbf18..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccount/chartofaccount_update_valid_response.json +++ /dev/null @@ -1,13 +0,0 @@ - "chartOfAccounts": [ - { - "glcode": "GLCode", - "name": "MunicipalBank", - "description": "DefaultDescription", - "isActiveForPosting": true, - "type": "B", - "classification": 123456, - "functionRequired": true, - "budgetCheckRequired": true, - "tenantId": "default" - } - ] diff --git a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_create_valid_request.json b/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_create_valid_request.json deleted file mode 100644 index a9ae30402c3..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_create_valid_request.json +++ /dev/null @@ -1,14 +0,0 @@ - "chartOfAccountDetails": [ - { - "chartOfAccount":{ - "id":"830bf3dc60504244babfe228bdf80bac", - "tenantId":"default" - }, - "accountDetailType":{ - "id":"e647d2406902400cbf3cee71a4befb35", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_create_valid_response.json b/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_create_valid_response.json deleted file mode 100644 index 6ae7b84d15c..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_create_valid_response.json +++ /dev/null @@ -1,21 +0,0 @@ - "chartOfAccountDetails": [ - { - "chartOfAccount": { - "id": "830bf3dc60504244babfe228bdf80bac", - "glcode": "1201", - "name": "finalfdf", - "description": "accountNumber", - "tenantId": "default" - }, - "accountDetailType": { - "id": "e647d2406902400cbf3cee71a4befb35", - "name": "final", - "description": "final", - "tableName": "final", - "active": true, - "fullyQualifiedName": "final", - "tenantId": "default" - }, - "tenantId": "default" - } - ] diff --git a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_search_valid_request.json b/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_search_valid_request.json deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_search_valid_response.json b/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_search_valid_response.json deleted file mode 100644 index f7ced974320..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_search_valid_response.json +++ /dev/null @@ -1,39 +0,0 @@ - "chartOfAccountDetails": [ - { - "id": "4ff38860184f4f348fa9b9a9ebb25c53", - "chartOfAccount": { - "id": "830bf3dc60504244babfe228bdf80bac" - }, - "accountDetailType": { - "id": "e647d2406902400cbf3cee71a4befb35" - }, - "tenantId": "default" - }, - { - "id": "9bea76ae70e04164a1f98df7b996ba0f", - "chartOfAccount": { - "id": "830bf3dc60504244babfe228bdf80bac" - }, - "accountDetailType": { - "id": "e647d2406902400cbf3cee71a4befb35" - }, - "tenantId": "default" - }, - { - "id": "cabf5df544af4253a1cc26aa80e57270", - "chartOfAccount": { - "id": "830bf3dc60504244babfe228bdf80bac" - }, - "accountDetailType": { - "id": "e647d2406902400cbf3cee71a4befb35" - }, - "tenantId": "default" - } - ], - "page": { - "totalResults": 3, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } diff --git a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_update_valid_request.json b/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_update_valid_request.json deleted file mode 100644 index 75392f2a221..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_update_valid_request.json +++ /dev/null @@ -1,15 +0,0 @@ - "chartOfAccountDetails": [ - { - "id": "4ff38860184f4f348fa9b9a9ebb25c53", - "chartOfAccount":{ - "id":"830bf3dc60504244babfe228bdf80bac", - "tenantId":"default" - }, - "accountDetailType":{ - "id":"9ed569220386455fb3b1f1a81535396d", - "tenantId":"default" - }, - "tenantId":"default" - } - - ] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_update_valid_response.json b/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_update_valid_response.json deleted file mode 100644 index 3802644facf..00000000000 --- a/business-services/egf-master/src/test/resources/chartofaccountdetail/chartofaccountdetail_update_valid_response.json +++ /dev/null @@ -1,12 +0,0 @@ - "chartOfAccountDetails": [ - { - "id": "4ff38860184f4f348fa9b9a9ebb25c53", - "chartOfAccount": { - "id": "830bf3dc60504244babfe228bdf80bac" - }, - "accountDetailType": { - "id": "9ed569220386455fb3b1f1a81535396d" - }, - "tenantId": "default" - } - ] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/common/error_info.json b/business-services/egf-master/src/test/resources/common/error_info.json deleted file mode 100644 index 8bca32084ed..00000000000 --- a/business-services/egf-master/src/test/resources/common/error_info.json +++ /dev/null @@ -1,8 +0,0 @@ -"responseInfo": { - "resMsgId": null, - "status": "400", - "apiId": null, - "ver": null, - "key": null, - "tenantId": null - } \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/common/error_response.json b/business-services/egf-master/src/test/resources/common/error_response.json deleted file mode 100644 index ee05d470ce6..00000000000 --- a/business-services/egf-master/src/test/resources/common/error_response.json +++ /dev/null @@ -1,6 +0,0 @@ -"error": - { - "code":null, - "message":"sample", - "description":"sample" - } \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/common/request_info.json b/business-services/egf-master/src/test/resources/common/request_info.json deleted file mode 100644 index f01cf8c2d0d..00000000000 --- a/business-services/egf-master/src/test/resources/common/request_info.json +++ /dev/null @@ -1,8 +0,0 @@ -"requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - } \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/common/response_info.json b/business-services/egf-master/src/test/resources/common/response_info.json deleted file mode 100644 index 04cae36133a..00000000000 --- a/business-services/egf-master/src/test/resources/common/response_info.json +++ /dev/null @@ -1,6 +0,0 @@ -"responseInfo": { - "resMsgId": "placeholder", - "status": "placeholder", - "apiId": null, - "ver": null - } \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_create_invalid_field_value.json b/business-services/egf-master/src/test/resources/function/function_create_invalid_field_value.json deleted file mode 100644 index 53df424dc37..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_create_invalid_field_value.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "functions": - [ - { - "name":"function", - "tenantId":"default", - "code":"001900000000000000000000000000000", - "active":true - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_create_invalid_fieldsize.json b/business-services/egf-master/src/test/resources/function/function_create_invalid_fieldsize.json deleted file mode 100644 index 097e67500db..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_create_invalid_fieldsize.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "functions": - [ - { - "name":"functions", - "tenantId":"default", - "code":"001", - "active":true - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_create_valid_request.json b/business-services/egf-master/src/test/resources/function/function_create_valid_request.json deleted file mode 100644 index 479e40abd99..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_create_valid_request.json +++ /dev/null @@ -1,12 +0,0 @@ - "functions": - [ - { - "name":"name", - "tenantId":"default", - "code":"code", - "active":true, - "level":1 - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_create_valid_response.json b/business-services/egf-master/src/test/resources/function/function_create_valid_response.json deleted file mode 100644 index bf5a20be43f..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_create_valid_response.json +++ /dev/null @@ -1,12 +0,0 @@ - - "functions": - [ - { - "name":"name", - "tenantId":"default", - "code":"code", - "active":true - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_search_valid_response.json b/business-services/egf-master/src/test/resources/function/function_search_valid_response.json deleted file mode 100644 index 079a5004e9e..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_search_valid_response.json +++ /dev/null @@ -1,18 +0,0 @@ - "functions": - [ - { - "id": "1", - "name": "name", - "code": "code", - "tenantId": "default" - } - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_update_invalid_field_value.json b/business-services/egf-master/src/test/resources/function/function_update_invalid_field_value.json deleted file mode 100644 index 564dcf2dd91..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_update_invalid_field_value.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "functions": - [ - { - "id":"2", - "name":"functionUaa", - "tenantId":"default", - "code":"003", - "active":true - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_update_valid_request.json b/business-services/egf-master/src/test/resources/function/function_update_valid_request.json deleted file mode 100644 index 28777abd3df..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_update_valid_request.json +++ /dev/null @@ -1,13 +0,0 @@ - "functions": - [ - { - "id":"1", - "name":"nameU", - "tenantId":"default", - "code":"codeU", - "active":true, - "level":2 - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/function/function_update_valid_response.json b/business-services/egf-master/src/test/resources/function/function_update_valid_response.json deleted file mode 100644 index ec8bdda8a27..00000000000 --- a/business-services/egf-master/src/test/resources/function/function_update_valid_response.json +++ /dev/null @@ -1,14 +0,0 @@ - - "functions": - [ - { - "id":"1", - "name":"nameU", - "tenantId":"default", - "code":"codeU", - "active":true, - "level":2 - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_create_invalid_field_value.json b/business-services/egf-master/src/test/resources/fund/fund_create_invalid_field_value.json deleted file mode 100644 index 99c3e97c7e6..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_create_invalid_field_value.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "funds": - [ - { - "name":"MunicipalFund", - "tenantId":"default", - "code":"001900000000000000000000000000000", - "active":true - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_create_invalid_fieldsize.json b/business-services/egf-master/src/test/resources/fund/fund_create_invalid_fieldsize.json deleted file mode 100644 index d2da315b182..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_create_invalid_fieldsize.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "funds": - [ - { - "name":"MunicipalFund", - "tenantId":"default", - "code":"001", - "active":true - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_create_valid_request.json b/business-services/egf-master/src/test/resources/fund/fund_create_valid_request.json deleted file mode 100644 index 50dc6811631..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_create_valid_request.json +++ /dev/null @@ -1,13 +0,0 @@ - "funds": - [ - { - "name":"name", - "tenantId":"default", - "code":"code", - "level":1234, - "identifier":"I", - "active":true - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_create_valid_response.json b/business-services/egf-master/src/test/resources/fund/fund_create_valid_response.json deleted file mode 100644 index 2e8765ae9f2..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_create_valid_response.json +++ /dev/null @@ -1,14 +0,0 @@ - - "funds": - [ - { - "name":"name", - "tenantId":"default", - "code":"code", - "level":1234, - "identifier":"I", - "active":true - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_search_valid_response.json b/business-services/egf-master/src/test/resources/fund/fund_search_valid_response.json deleted file mode 100644 index 048564de1da..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_search_valid_response.json +++ /dev/null @@ -1,19 +0,0 @@ - "funds": - [ - { - "id": "1", - "name": "name", - "code": "code", - "identifier": "I", - "tenantId": "default" - } - ], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_update_invalid_field_value.json b/business-services/egf-master/src/test/resources/fund/fund_update_invalid_field_value.json deleted file mode 100644 index d780beb6da8..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_update_invalid_field_value.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "funds": - [ - { - "id":"1", - "name":"MunicipalFundUpdate", - "tenantId":"default", - "code":"001", - "identifier":1, - "active":true - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_update_valid_request.json b/business-services/egf-master/src/test/resources/fund/fund_update_valid_request.json deleted file mode 100644 index caf65283e7b..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_update_valid_request.json +++ /dev/null @@ -1,14 +0,0 @@ - "funds": - [ - { - "id":"1", - "name":"nameupdate", - "tenantId":"default", - "code":"code", - "active":true, - "identifier":"U", - "level":1234 - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/fund/fund_update_valid_response.json b/business-services/egf-master/src/test/resources/fund/fund_update_valid_response.json deleted file mode 100644 index 5ffb2ad871a..00000000000 --- a/business-services/egf-master/src/test/resources/fund/fund_update_valid_response.json +++ /dev/null @@ -1,15 +0,0 @@ - - "funds": - [ - { - "id":"1", - "name":"nameupdate", - "tenantId":"default", - "code":"code", - "active":true, - "identifier":"U", - "level":1234 - } - - ] - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_create_invalid_field_value.json b/business-services/egf-master/src/test/resources/recovery/recovery_create_invalid_field_value.json deleted file mode 100644 index 060ee06274d..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_create_invalid_field_value.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "recoverys": [ - { - "id": "1", - "code": "0123123132", - "name": "name", - "chartOfAccount": { - "glcode": "341", - "tenantId": "default" - }, - "active": true, - "type": "M", - "remitted": "S", - "ifscCode": "SBIN0005532", - "accountNumber": "3049223457", - "tenantId": "default", - "mode": "M", - "remittanceMode": "M" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_create_invalid_fieldsize.json b/business-services/egf-master/src/test/resources/recovery/recovery_create_invalid_fieldsize.json deleted file mode 100644 index d2da315b182..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_create_invalid_fieldsize.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "funds": - [ - { - "name":"MunicipalFund", - "tenantId":"default", - "code":"001", - "active":true - } - - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_create_valid_request.json b/business-services/egf-master/src/test/resources/recovery/recovery_create_valid_request.json deleted file mode 100644 index 534a864befc..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_create_valid_request.json +++ /dev/null @@ -1,18 +0,0 @@ -"recoverys": [ -{ -"code": "code", -"name": "name", -"chartOfAccount": { -"glcode": "341", -"tenantId": "default" -}, -"active": true, -"type": "M", -"remitted": "S", -"ifscCode": "SBIN0005532", -"accountNumber": "3049223457", -"tenantId": "default", -"mode": "M", -"remittanceMode": "M" -} -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_create_valid_response.json b/business-services/egf-master/src/test/resources/recovery/recovery_create_valid_response.json deleted file mode 100644 index 4fe8a3724e1..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_create_valid_response.json +++ /dev/null @@ -1,19 +0,0 @@ -"recoverys": [ -{ -"id": "1", -"code": "code", -"name": "name", -"chartOfAccount": { -"glcode": "341", -"tenantId": "default" -}, -"active": true, -"type": "M", -"remitted": "S", -"ifscCode": "SBIN0005532", -"accountNumber": "3049223457", -"tenantId": "default", -"mode": "M", -"remittanceMode": "M" -} -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_search_valid_response.json b/business-services/egf-master/src/test/resources/recovery/recovery_search_valid_response.json deleted file mode 100644 index d7190e78f20..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_search_valid_response.json +++ /dev/null @@ -1,28 +0,0 @@ -"recoverys": [ -{ -"id": "1", -"code": "code", -"name": "name", -"chartOfAccount": { -"glcode": "341", -"tenantId": "default" -}, -"active": true, -"type": "M", -"remitted": "S", -"ifscCode": "SBIN0005532", -"accountNumber": "3049223457", -"tenantId": "default", -"mode": "M", -"remittanceMode": "M" -} -], - "page": - { - "totalResults": 1, - "totalPages": 1, - "pageSize": 500, - "currentPage": 0, - "offset": 0 - } - \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_update_invalid_field_value.json b/business-services/egf-master/src/test/resources/recovery/recovery_update_invalid_field_value.json deleted file mode 100644 index 5effce13a9f..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_update_invalid_field_value.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "requestInfo": { - "action": "action", - "did": "did", - "msgId": "msgId", - "requesterId": "requesterId", - "ts": "01-01-2017 01:01:01", - "authToken": null - }, - "recoverys": [ - { - "code": "12312313132", - "name": "name", - "chartOfAccount": { - "glcode": "341", - "tenantId": "default" - }, - "active": true, - "type": "M", - "remitted": "S", - "ifscCode": "SBIN0005532", - "accountNumber": "3049223457", - "tenantId": "default", - "mode": "M", - "remittanceMode": "M" - } - ] -} \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_update_valid_request.json b/business-services/egf-master/src/test/resources/recovery/recovery_update_valid_request.json deleted file mode 100644 index 677254e1f6a..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_update_valid_request.json +++ /dev/null @@ -1,19 +0,0 @@ -"recoverys": [ -{ -"id": "1", -"code": "codeU", -"name": "nameU", -"chartOfAccount": { -"glcode": "341", -"tenantId": "default" -}, -"active": true, -"type": "M", -"remitted": "S", -"ifscCode": "SBIN0005532", -"accountNumber": "3049223457", -"tenantId": "default", -"mode": "M", -"remittanceMode": "M" -} -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/recovery/recovery_update_valid_response.json b/business-services/egf-master/src/test/resources/recovery/recovery_update_valid_response.json deleted file mode 100644 index 677254e1f6a..00000000000 --- a/business-services/egf-master/src/test/resources/recovery/recovery_update_valid_response.json +++ /dev/null @@ -1,19 +0,0 @@ -"recoverys": [ -{ -"id": "1", -"code": "codeU", -"name": "nameU", -"chartOfAccount": { -"glcode": "341", -"tenantId": "default" -}, -"active": true, -"type": "M", -"remitted": "S", -"ifscCode": "SBIN0005532", -"accountNumber": "3049223457", -"tenantId": "default", -"mode": "M", -"remittanceMode": "M" -} -] \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearAccountCodePurpose.sql b/business-services/egf-master/src/test/resources/sql/clearAccountCodePurpose.sql deleted file mode 100644 index d19ec50cae7..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearAccountCodePurpose.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_accountcodepurpose; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearAccountDetailKey.sql b/business-services/egf-master/src/test/resources/sql/clearAccountDetailKey.sql deleted file mode 100644 index 39be682ef75..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearAccountDetailKey.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_accountdetailkey; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearAccountDetailType.sql b/business-services/egf-master/src/test/resources/sql/clearAccountDetailType.sql deleted file mode 100644 index a3e5fe41459..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearAccountDetailType.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_accountdetailtype; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearAccountEntity.sql b/business-services/egf-master/src/test/resources/sql/clearAccountEntity.sql deleted file mode 100644 index 3d4639215ba..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearAccountEntity.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_accountentity; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearBank.sql b/business-services/egf-master/src/test/resources/sql/clearBank.sql deleted file mode 100644 index 9d8dda60c73..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearBank.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_bank; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearBankAccount.sql b/business-services/egf-master/src/test/resources/sql/clearBankAccount.sql deleted file mode 100644 index c7f7d102759..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearBankAccount.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_bankaccount; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearBankBranch.sql b/business-services/egf-master/src/test/resources/sql/clearBankBranch.sql deleted file mode 100644 index 20e90d67163..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearBankBranch.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_bankbranch; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearChartOfAccount.sql b/business-services/egf-master/src/test/resources/sql/clearChartOfAccount.sql deleted file mode 100644 index 6fb02b45434..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearChartOfAccount.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_chartofaccount; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearChartOfAccountDetail.sql b/business-services/egf-master/src/test/resources/sql/clearChartOfAccountDetail.sql deleted file mode 100644 index 87b59cb9afa..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearChartOfAccountDetail.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_chartofaccountdetail; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearFunction.sql b/business-services/egf-master/src/test/resources/sql/clearFunction.sql deleted file mode 100644 index f00d403a396..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearFunction.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_function; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearFund.sql b/business-services/egf-master/src/test/resources/sql/clearFund.sql deleted file mode 100644 index b14403a27d0..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearFund.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_fund; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/clearRecovery.sql b/business-services/egf-master/src/test/resources/sql/clearRecovery.sql deleted file mode 100644 index 02d5b97a3ca..00000000000 --- a/business-services/egf-master/src/test/resources/sql/clearRecovery.sql +++ /dev/null @@ -1 +0,0 @@ -delete from egf_recovery; \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/insertAccountCodePurposeData.sql b/business-services/egf-master/src/test/resources/sql/insertAccountCodePurposeData.sql deleted file mode 100644 index 96a7ce6be7f..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertAccountCodePurposeData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_accountcodepurpose (id,name,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('1','name',1,now(),null,null,0,'default'); diff --git a/business-services/egf-master/src/test/resources/sql/insertAccountDetailKey.sql b/business-services/egf-master/src/test/resources/sql/insertAccountDetailKey.sql deleted file mode 100644 index ca9e581f150..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertAccountDetailKey.sql +++ /dev/null @@ -1 +0,0 @@ -insert into egf_accountdetailkey (id, key, accountdetailtypeid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) values('1', '1', '1', '1', 'now()', '1', 'now()', 0, 'default'); diff --git a/business-services/egf-master/src/test/resources/sql/insertAccountDetailType.sql b/business-services/egf-master/src/test/resources/sql/insertAccountDetailType.sql deleted file mode 100644 index 0a75f497281..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertAccountDetailType.sql +++ /dev/null @@ -1 +0,0 @@ -insert into egf_accountdetailtype (id, name, description, tablename, active, fullyqualifiedname, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) values('1', 'name', 'contractor', 'contractor', 'true', 'abc/contractor', '1', 'now()', '1', 'now()', 0, 'default'); diff --git a/business-services/egf-master/src/test/resources/sql/insertAccountEntity.sql b/business-services/egf-master/src/test/resources/sql/insertAccountEntity.sql deleted file mode 100644 index 27db809bff4..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertAccountEntity.sql +++ /dev/null @@ -1 +0,0 @@ -insert into egf_accountentity (id, accountdetailtypeid,code,name,active,description, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) values('1', '1', 'code', 'name',true,'entity','1', 'now()', '1', 'now()', 0, 'default'); diff --git a/business-services/egf-master/src/test/resources/sql/insertBank.sql b/business-services/egf-master/src/test/resources/sql/insertBank.sql deleted file mode 100644 index 985a6bb049f..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertBank.sql +++ /dev/null @@ -1,11 +0,0 @@ -insert into egf_bank (id,code,name,description,active,type,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('1','code','name','description',true,'type','1',now(),null,null,1234,'default'); - -insert into egf_bank (id,code,name,description,active,type,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('2','code','name','description',true,'type','1',now(),null,null,1234,'default'); - -insert into egf_bank (id,code,name,description,active,type,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('3','code','name','description',true,'type','1',now(),null,null,1234,'default'); - -insert into egf_bank (id,code,name,description,active,type,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('4','code','name','description',true,'type','1',now(),null,null,1234,'default'); \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/insertBankAccount.sql b/business-services/egf-master/src/test/resources/sql/insertBankAccount.sql deleted file mode 100644 index 4d4c4a73ede..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertBankAccount.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_bankaccount (id,bankbranchid,chartofaccountid,fundid,accountnumber,accounttype,description,active,payto,type,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('1','1','1','1','1','PAYMENTS','description',true,'payto','PAYMENTS',null,now(),null,null,1234,'default'); diff --git a/business-services/egf-master/src/test/resources/sql/insertBankBranch.sql b/business-services/egf-master/src/test/resources/sql/insertBankBranch.sql deleted file mode 100644 index e51ca8fb78b..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertBankBranch.sql +++ /dev/null @@ -1,11 +0,0 @@ -insert into egf_bankbranch (id,bankid,code,name,address,address2,city,state,pincode,phone,fax,contactperson,active,description,micr,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('1','1','code','name','address','address2','city','state','pincode','phone','fax','person',true,'description','micr',null,now(),null,null,1234,'default'); - -insert into egf_bankbranch (id,bankid,code,name,address,address2,city,state,pincode,phone,fax,contactperson,active,description,micr,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('2','1','code','name','address','address2','city','state','pincode','phone','fax','person',true,'description','micr',null,now(),null,null,1234,'default'); - -insert into egf_bankbranch (id,bankid,code,name,address,address2,city,state,pincode,phone,fax,contactperson,active,description,micr,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('3','1','code','name','address','address2','city','state','pincode','phone','fax','person',true,'description','micr',null,now(),null,null,1234,'default'); - -insert into egf_bankbranch (id,bankid,code,name,address,address2,city,state,pincode,phone,fax,contactperson,active,description,micr,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) -values('4','1','code','name','address','address2','city','state','pincode','phone','fax','person',true,'description','micr',null,now(),null,null,1234,'default'); \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/insertChartOfAccountData.sql b/business-services/egf-master/src/test/resources/sql/insertChartOfAccountData.sql deleted file mode 100644 index af4d9605665..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertChartOfAccountData.sql +++ /dev/null @@ -1,7 +0,0 @@ -insert into egf_chartofaccount (id, glcode,name,accountcodepurposeid,description,isactiveforposting,parentid,type,classification,functionrequired,budgetcheckrequired,majorcode,issubledger,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) values('2','glcode','name','P','description',true,'1','B',123456,true,true,'majorcode',true,'',now(),'',now(),'1','default'); - -insert into egf_chartofaccount (id, glcode,name,accountcodepurposeid,description,isactiveforposting,parentid,type,classification,functionrequired,budgetcheckrequired,majorcode,issubledger,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) values('1','glcode','name','P','description',true,'','B',123456,true,true,'majorcode',true,'',now(),'',now(),'1','default'); - -insert into egf_chartofaccount (id, glcode,name,accountcodepurposeid,description,isactiveforposting,parentid,type,classification,functionrequired,budgetcheckrequired,majorcode,issubledger,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) values('4','glcode','name','P','description',true,'3','B',123456,true,true,'majorcode',true,'',now(),'',now(),'1','default'); - -insert into egf_chartofaccount (id, glcode,name,accountcodepurposeid,description,isactiveforposting,parentid,type,classification,functionrequired,budgetcheckrequired,majorcode,issubledger,createdby,createddate,lastmodifiedby,lastmodifieddate,version,tenantid) values('3','glcode','name','P','description',true,'','B',123456,true,true,'majorcode',true,'',now(),'',now(),'1','default'); \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/insertChartOfAccountDetail.sql b/business-services/egf-master/src/test/resources/sql/insertChartOfAccountDetail.sql deleted file mode 100644 index 1e213986eba..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertChartOfAccountDetail.sql +++ /dev/null @@ -1,4 +0,0 @@ -insert into egf_chartofaccountdetail (id, chartofaccountid, accountdetailtypeid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) values('1', '1', '1', '1', 'now()','1', 'now()', '1', 'default'); -insert into egf_chartofaccountdetail (id, chartofaccountid, accountdetailtypeid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) values('2', '2', '2', '1', 'now()','1', 'now()', '1', 'default'); -insert into egf_chartofaccountdetail (id, chartofaccountid, accountdetailtypeid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) values('3', '3', '3', '1', 'now()','1', 'now()', '1', 'default'); -insert into egf_chartofaccountdetail (id, chartofaccountid, accountdetailtypeid, createdby, createddate, lastmodifiedby, lastmodifieddate, version, tenantid) values('4', '4', '4', '1', 'now()','1', 'now()', '1', 'default'); \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/insertFunctionData.sql b/business-services/egf-master/src/test/resources/sql/insertFunctionData.sql deleted file mode 100644 index d65e668ab30..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertFunctionData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_function (id,name,code,level,parentid,active,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('2','name','code',1,'1',true,1,now(),null,null,'default'); \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/insertFundData.sql b/business-services/egf-master/src/test/resources/sql/insertFundData.sql deleted file mode 100644 index 3c6bdcfbb72..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertFundData.sql +++ /dev/null @@ -1,2 +0,0 @@ -insert into egf_fund (id,name,code,identifier,level,parentid,active,createdby,createddate,lastmodifiedby,lastmodifieddate,tenantid) -values('2','name','code','F',1,'1',true,1,now(),null,null,'default'); \ No newline at end of file diff --git a/business-services/egf-master/src/test/resources/sql/insertRecoveryData.sql b/business-services/egf-master/src/test/resources/sql/insertRecoveryData.sql deleted file mode 100644 index fd2ee30fa66..00000000000 --- a/business-services/egf-master/src/test/resources/sql/insertRecoveryData.sql +++ /dev/null @@ -1,7 +0,0 @@ -INSERT INTO egf_recovery( - id, chartofaccountid, flat, active, remitted, name, code, - ifsccode, mode, remittancemode, accountnumber,createdby, - createddate, lastmodifiedby, lastmodifieddate, version, tenantid) - VALUES ('2374257', '1', 100.00, TRUE , 'test', 'name', 'code', - 'ifsccode', 'M', 'M', '30492234547' - ,1,now(),null,null,0,'default'); \ No newline at end of file diff --git a/business-services/egf-master/start.sh b/business-services/egf-master/start.sh deleted file mode 100644 index 13fdcee6517..00000000000 --- a/business-services/egf-master/start.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [[ -z "${JAVA_OPTS}" ]];then - export JAVA_OPTS="-Xmx64m -Xms64m" -fi - -java ${JAVA_OPTS} -jar /opt/egov/egf-master.jar diff --git a/business-services/finance-collections-voucher-consumer/CHANGELOG.md b/business-services/finance-collections-voucher-consumer/CHANGELOG.md deleted file mode 100644 index 6a9f459ab87..00000000000 --- a/business-services/finance-collections-voucher-consumer/CHANGELOG.md +++ /dev/null @@ -1,38 +0,0 @@ -# Changelog -All notable changes to this module will be documented in this file. - -## 1.1.6 - 2023-02-02 - -- Transition from 1.1.6-beta version to 1.1.6 version - -## 1.1.6-beta - 2022-01-13 -- Updated to log4j2 version 2.17.1 - -## 1.1.5 - 2021-07-27 -- minor bug fixes - -## 1.1.4 - 2021-06-03 -- Passing business service value while consuming view receipt api -- Fixed voucher creation issue in case of advance amount is collected -- Reading authorisation header key from the configuration files - -## 1.1.3 - 2021-05-11 -- Updated config in application.properties - -## 1.1.2 - 2021-02-26 -- Updated domain name in application.properties - -## 1.1.1 - 2020-10-09 -- Ignore and start server even Kafka topic is missing - -## 1.1.0 - 2020-06-22 - -- Handling the Payment Request to persist the vouchers. -- Handled dishonor of instruments to create the reversal voucher. -- Handled back updation of instrument with reversal voucher id. -- Upgraded to `tracer:2.0.0-SNAPSHOT` -- Upgraded to `Spring boot 2.2.6` - -## 1.0.0 - -- Base version diff --git a/business-services/finance-collections-voucher-consumer/LOCALSETUP.md b/business-services/finance-collections-voucher-consumer/LOCALSETUP.md deleted file mode 100644 index 86b059bbbd0..00000000000 --- a/business-services/finance-collections-voucher-consumer/LOCALSETUP.md +++ /dev/null @@ -1,47 +0,0 @@ -# Local Setup - -To setup the finance-collections-voucher-consumer service in your local system, clone the [Business services repository](https://github.com/egovernments/business-services). - -## Dependencies - - -### Infra Dependency - -- [X] Postgres DB -- [ ] Redis -- [ ] Elasticsearch -- [X] Kafka - - [X] Consumer - - [ ] Producer - -## Running Locally - -To run the finance-collections-voucher-consumer service locally, you need to port forward below services. - -```bash -function kgpt(){kubectl get pods -n egov --selector=app=$1 --no-headers=true | head -n1 | awk '{print $1}'} -kubectl port-forward -n egov $(kgpt egov-mdms-service) 8081:8080 -kubectl port-forward -n egov $(kgpt egov-user) 8082:8080 -kubectl port-forward -n egov $(kgpt egov-instrument) 8083:8080 -kubectl port-forward -n egov $(kgpt collection-service) 8084:8080 -kubectl port-forward -n egov $(kgpt egf-master) 8085:8080 -``` - -Update below listed properties in `application.properties` before running the project: - -```ini -# {egov-user service hostname} -egov.services.egov.user.host = http://127.0.0.1:8082 - -# {egov-mdms-service service hostname} -egov.services.mdms.hostname = http://127.0.0.1:8081 - -# {egf-instrument service hostname} -egov.services.egfinstrument.hostname = http://127.0.0.1:8083 - -# {collection-service service hostname} -egov.services.collections.hostname = http://127.0.0.1:8084 - -# {egf-master service hostname} -egov.services.egfmaster.hostname = http://127.0.0.1:8085 -``` diff --git a/business-services/finance-collections-voucher-consumer/README.md b/business-services/finance-collections-voucher-consumer/README.md deleted file mode 100644 index 15fb9ae7b2d..00000000000 --- a/business-services/finance-collections-voucher-consumer/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# finance-collections-voucher-consumer service - -finance-collections-voucher-consumer service creates vouchers and instruments for the receipts collected through the collection service. - -### DB UML Diagram - -NA - -### Service Dependencies - -- egov-mdms-service -- collection-service -- egf-instrument -- egov-user -- egf-master -- Finance co existence service - -### Swagger API Contract - -NA - -## Service Details - -finance-collections-voucher-consumer service creates vouchers and instruments for the receipts collected through the collection service. - -### API Details - -NA - -### Kafka Consumers - -egov.collection.receipt.voucher.save.topic : egov.collection.receipt-create - Creates Collection V1 receipt voucher, updates the voucher number with the corresponding receipt and creates instrument. -egov.collection.receipt.voucher.cancel.topic : egov.collection.receipt-cancel - Cancels Collection V1 receipt voucher and corresponding instrument. -kafka.topics.payment.create.name : egov.collection.payment-create - Creates Collection V2 receipt voucher, updates the voucher number with the corresponding receipt and creates instrument. -kafka.topics.payment.cancel.name : egov.collection.payment-cancel - Cancels Collection V2 receipt voucher and corresponding instrument. - -### Kafka Producers - -NA diff --git a/business-services/finance-collections-voucher-consumer/pom.xml b/business-services/finance-collections-voucher-consumer/pom.xml deleted file mode 100644 index b45b7d01ccd..00000000000 --- a/business-services/finance-collections-voucher-consumer/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 2.2.6.RELEASE - - org.egov - finance-collections-voucher-consumer - 1.1.6-SNAPSHOT - finance-collections-voucher-consumer - Service to create the voucher by consuming receipt data from collection service - - - 2.17.1 - 1.8 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework - spring-beans - 5.2.20.RELEASE - - - org.springframework.kafka - spring-kafka - - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.postgresql - postgresql - runtime - - - org.projectlombok - lombok - true - - - - org.springframework.boot - spring-boot-starter-test - test - - - - org.egov.services - tracer - 2.0.0-SNAPSHOT - - - - org.flywaydb - flyway-core - - - - - - repo.egovernments.org - eGov Releases Repository - https://nexus-repo.egovernments.org/nexus/content/repositories/releases/ - - - repo.egovernments.org.snapshots - eGov Releases Repository - https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/ - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - true - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/FinanceCollectionsVoucherConsumerApplication.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/FinanceCollectionsVoucherConsumerApplication.java deleted file mode 100644 index 320c849fda3..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/FinanceCollectionsVoucherConsumerApplication.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov; - -import java.util.TimeZone; - -import javax.annotation.PostConstruct; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.MapperFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -@SpringBootApplication -public class FinanceCollectionsVoucherConsumerApplication{ - @Value("${app.timezone}") - private String timeZone; - - @PostConstruct - public void initialize() { - TimeZone.setDefault(TimeZone.getTimeZone(timeZone)); - } - - @Bean - public ObjectMapper getObjectMapper() { - final ObjectMapper objectMapper = new ObjectMapper(); - objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - objectMapper.setTimeZone(TimeZone.getTimeZone(timeZone)); - return objectMapper; - } - - public static void main(String[] args) { - SpringApplication.run(FinanceCollectionsVoucherConsumerApplication.class, args); - } - - - @Bean - public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectMapper) { - MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); - objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true); - objectMapper.setTimeZone(TimeZone.getTimeZone(timeZone)); - converter.setObjectMapper(objectMapper); - return converter; - } - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/MicroServiceUtil.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/MicroServiceUtil.java deleted file mode 100644 index 1939999e201..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/MicroServiceUtil.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.mdms.service; - -import java.util.List; - -import org.egov.receipt.consumer.model.BusinessService; -import org.egov.receipt.consumer.model.FinanceMdmsModel; -import org.egov.receipt.consumer.model.FinancialStatus; -import org.egov.receipt.consumer.model.InstrumentContract; -import org.egov.receipt.consumer.model.InstrumentSearchContract; -import org.egov.receipt.consumer.model.RequestInfo; -import org.egov.receipt.consumer.model.TaxHeadMaster; -import org.egov.receipt.consumer.model.Tenant; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.egov.tracer.model.CustomException; - -public interface MicroServiceUtil { - public List getTaxHeadMasters(String tenantId, String code, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws CustomException, VoucherCustomException; - public List getBusinessService(String tenantId, String code, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws CustomException, VoucherCustomException; - String getBusinessServiceName(String tenantId, String code, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) - throws VoucherCustomException; - String getGlcodeByInstrumentType(String tenantId, String businessCode, RequestInfo requestInfo, - FinanceMdmsModel finSerMdms, String instrumentType) throws VoucherCustomException; - FinancialStatus getFinancialStatusByCode(String tenantId, RequestInfo requestInfo, FinanceMdmsModel finSerMdms, - String statusCode) throws VoucherCustomException; - List getFinanceTenantList(String tenantId, String businessCode, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) - throws VoucherCustomException; - List getInstruments(InstrumentSearchContract instrumentSearchContract, RequestInfo requestInfo, - String tenantId) throws VoucherCustomException; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/MicroServiceUtilImpl.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/MicroServiceUtilImpl.java deleted file mode 100644 index e4b5e98cffd..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/MicroServiceUtilImpl.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.mdms.service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.egov.receipt.consumer.model.BusinessService; -import org.egov.receipt.consumer.model.FinanceMdmsModel; -import org.egov.receipt.consumer.model.FinancialStatus; -import org.egov.receipt.consumer.model.InstrumentContract; -import org.egov.receipt.consumer.model.InstrumentGlCodeMapping; -import org.egov.receipt.consumer.model.InstrumentResponse; -import org.egov.receipt.consumer.model.InstrumentSearchContract; -import org.egov.receipt.consumer.model.MasterDetail; -import org.egov.receipt.consumer.model.MdmsCriteria; -import org.egov.receipt.consumer.model.MdmsCriteriaReq; -import org.egov.receipt.consumer.model.ModuleDetail; -import org.egov.receipt.consumer.model.OnlineGLCodeMapping; -import org.egov.receipt.consumer.model.ProcessStatus; -import org.egov.receipt.consumer.model.RequestInfo; -import org.egov.receipt.consumer.model.RequestInfoWrapper; -import org.egov.receipt.consumer.model.TaxHeadMaster; -import org.egov.receipt.consumer.model.Tenant; -import org.egov.receipt.consumer.repository.ServiceRequestRepository; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.egov.reciept.consumer.config.PropertiesManager; -import org.egov.tracer.model.ServiceCallException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.jayway.jsonpath.JsonPath; - -@Service -public class MicroServiceUtilImpl implements MicroServiceUtil{ - private static final String FIN_MODULE_NAME = "FinanceModule"; - private static final String BILLSERVICE_MODULE_NAME = "BillingService"; - private static final String FINANCE_CODE = "Finance"; - private static final Object ONLINE_INSTRUMENT_TYPE = "Online"; - private static final String BUSINESS_SERVICE_MAPP_MASTER = "BusinessServiceMapping"; - private static final String TAX_HEAD_MAPP_MASTER = "TaxHeadMasterGlCodeMapping"; - private static final String INSTRUMENT_GLCODE_MAPP_MASTER = "InstrumentGLcodeMapping"; - private static final String FIN_INSTRUMENT_STATUS_MAPP_MASTER = "FinanceInstrumentStatusMapping"; - private static final String ONLINE_GLCODE_MAPP_MASTER = "OnlineGLCodeMapping"; - private static final String BUSINESS_SERVICE_MASTER = "BusinessService"; - private static final String CITY_MODULE_MASTER = "citymodule"; - private static final String TENANT_MODULE_NAME = "tenant"; - @Autowired - private PropertiesManager manager; - @Autowired - private MdmsCriteria mdmscriteria; - @Autowired - private MdmsCriteriaReq mdmsrequest; - @Autowired - private ObjectMapper mapper; - @Autowired - private ServiceRequestRepository serviceRequestRepository; - - @Override - public List getBusinessService(String tenantId, String code, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws VoucherCustomException{ - if(finSerMdms.getFinanceServiceMdmsData() == null){ - this.getFinanceServiceMdmsData(tenantId, code, requestInfo, finSerMdms); - } - List list = new ArrayList<>(); - try { - if(finSerMdms.getFinanceServiceMdmsData() != null){ - list = mapper.convertValue(JsonPath.read(finSerMdms.getFinanceServiceMdmsData(), "$.MdmsRes.FinanceModule.BusinessServiceMapping"),new TypeReference>(){}); - } - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"Error while parsing mdms data. Check the business/account head mapping json file."); - } - return list; - } - - @Override - public List getTaxHeadMasters(String tenantId,String code, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws VoucherCustomException { - if(finSerMdms.getFinanceServiceMdmsData() == null){ - this.getFinanceServiceMdmsData(tenantId, code, requestInfo, finSerMdms); - } - List list = new ArrayList<>(); - try { - if(finSerMdms.getFinanceServiceMdmsData() != null){ - list = mapper.convertValue(JsonPath.read(finSerMdms.getFinanceServiceMdmsData(), "$.MdmsRes.FinanceModule.TaxHeadMasterGlCodeMapping"),new TypeReference>(){}); - } - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"Error while parsing mdms data for TaxHeadMasterGlCodeMapping master. Check the business/account head mapping json file."); - } - return list; - } - /** - * - * @param tenantId - * @param businessServiceCode - * @return - * @throws VoucherCustomException - * Function which is used to fetch the finance service mdms data based on Business Service code. - */ - public void getFinanceServiceMdmsData(String tenantId,String businessServiceCode, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws VoucherCustomException{ - StringBuilder mdmsUrl = new StringBuilder(manager.getMdmsHostUrl()+manager.getMdmsSearchUrl()); - List moduleDetails = new ArrayList<>(); - this.addFinanceModule(moduleDetails, businessServiceCode); - this.addBillingServiceModule(moduleDetails, businessServiceCode); - this.addTenantModule(moduleDetails); - mdmscriteria.setTenantId(tenantId); - mdmscriteria.setModuleDetails(moduleDetails); - mdmsrequest.setRequestInfo(requestInfo); - mdmsrequest.setMdmsCriteria(mdmscriteria); - try { - Map postForObject = mapper.convertValue(serviceRequestRepository.fetchResult(mdmsUrl, mdmsrequest, tenantId), Map.class); - finSerMdms.setFinanceServiceMdmsData(postForObject); - } catch (ServiceCallException e) { - - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"Error Occured While calling the URL : "+mdmsUrl); - } - } - - private void addFinanceModule(List moduleDetails,String businessServiceCodes){ - ArrayList masterDetailsList = new ArrayList<>(); - masterDetailsList.add(new MasterDetail(BUSINESS_SERVICE_MAPP_MASTER,businessServiceCodes != null ? "[?(" + prepareFilter(businessServiceCodes,"code") + ")]" : null)); - masterDetailsList.add(new MasterDetail(TAX_HEAD_MAPP_MASTER,businessServiceCodes != null ? "[?(" + prepareFilter(businessServiceCodes,"billingservicecode") + ")]":null)); - masterDetailsList.add(new MasterDetail(INSTRUMENT_GLCODE_MAPP_MASTER,null)); - masterDetailsList.add(new MasterDetail(FIN_INSTRUMENT_STATUS_MAPP_MASTER,null)); - masterDetailsList.add(new MasterDetail(ONLINE_GLCODE_MAPP_MASTER,businessServiceCodes != null ? "[?(" + prepareFilter(businessServiceCodes,"servicecode") + ")]" : null)); - moduleDetails.add(new ModuleDetail(FIN_MODULE_NAME, masterDetailsList)); - } - - private String prepareFilter(String businessServiceCodes, String key) { - StringBuilder builder = new StringBuilder(); - if(businessServiceCodes.split(",").length <= 1){ - return builder.append("@.").append(key).append("=='").append(businessServiceCodes).append("'").toString(); - }else{ - String[] split = businessServiceCodes.split(","); - for(String str:split){ - if(builder.toString().isEmpty()){ - builder.append("@.").append(key).append("=='").append(str).append("'"); - }else { - builder.append(" || ").append("@.").append(key).append("=='").append(str).append("'"); - } - } - } - return builder.toString(); - } - - private void addBillingServiceModule(List moduleDetails,String businessServiceCode){ - ArrayList masterDetailsList = new ArrayList<>(); - masterDetailsList.add(new MasterDetail(BUSINESS_SERVICE_MASTER,businessServiceCode != null ? "[?(@.code=='" + businessServiceCode + "')]" : null)); - moduleDetails.add(new ModuleDetail(BILLSERVICE_MODULE_NAME, masterDetailsList)); - } - - private void addTenantModule(List moduleDetails){ - ArrayList masterDetailsList = new ArrayList<>(); - masterDetailsList.add(new MasterDetail(CITY_MODULE_MASTER,"[?(@.code=='" + FINANCE_CODE + "')]")); - moduleDetails.add(new ModuleDetail(TENANT_MODULE_NAME, masterDetailsList)); - } - - @Override - public String getBusinessServiceName(String tenantId,String code, RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws VoucherCustomException { - if(finSerMdms.getFinanceServiceMdmsData() == null){ - this.getFinanceServiceMdmsData(tenantId, code, requestInfo, finSerMdms); - } - List list = new ArrayList<>(); - try { - if(finSerMdms.getFinanceServiceMdmsData() != null){ - list = mapper.convertValue(JsonPath.read(finSerMdms.getFinanceServiceMdmsData(), "$.MdmsRes.BillingService.BusinessService"),new TypeReference>(){}); - } - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"Error while parsing mdms data for BusinessService master. Check the business/account head mapping json file."); - } - return !list.isEmpty() ? list.get(0).getBusinessService() : code; - } - - @Override - public String getGlcodeByInstrumentType(String tenantId,String businessCode,RequestInfo requestInfo, FinanceMdmsModel finSerMdms,String instrumentType) throws VoucherCustomException { - if(finSerMdms.getFinanceServiceMdmsData() == null){ - this.getFinanceServiceMdmsData(tenantId, businessCode, requestInfo, finSerMdms); - } - try { - if(finSerMdms.getFinanceServiceMdmsData() != null){ - if(ONLINE_INSTRUMENT_TYPE.equals(instrumentType)){ - /* Online instrument type mapped at ULB level*/ - List list = mapper.convertValue(JsonPath.read(finSerMdms.getFinanceServiceMdmsData(), "$.MdmsRes.FinanceModule.OnlineGLCodeMapping"),new TypeReference>(){}); - List collect = list.stream().filter(inst -> inst.getServicecode().equals(businessCode)).collect(Collectors.toList()); - return !collect.isEmpty() ? collect.get(0).getGlcode() : null; - }else{ - List list = mapper.convertValue(JsonPath.read(finSerMdms.getFinanceServiceMdmsData(), "$.MdmsRes.FinanceModule.InstrumentGLcodeMapping"),new TypeReference>(){}); - List collect = list.stream().filter(inst -> inst.getInstrumenttype().equalsIgnoreCase(instrumentType)).collect(Collectors.toList()); - return !collect.isEmpty() ? collect.get(0).getGlcode() : null; - } - } - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"Error while parsing mdms data for InstrumentGLcodeMapping/OnlineGLCodeMapping master. Check the business/account head mapping json file."); - } - return null; - } - - @Override - public FinancialStatus getFinancialStatusByCode(String tenantId,RequestInfo requestInfo, FinanceMdmsModel finSerMdms,String statusCode) throws VoucherCustomException { - if(finSerMdms.getFinanceServiceMdmsData() == null){ - this.getFinanceServiceMdmsData(tenantId, null, requestInfo, finSerMdms); - } - List list = new ArrayList<>(); - try { - if(finSerMdms.getFinanceServiceMdmsData() != null){ - list = mapper.convertValue(JsonPath.read(finSerMdms.getFinanceServiceMdmsData(), "$.MdmsRes.FinanceModule.FinanceInstrumentStatusMapping"),new TypeReference>(){}); - } - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"Error while parsing mdms data for EgfInstrumentStatusMapping master. Check the EgfInstrumentStatusMapping.json file."); - } - List collect = list.stream().filter(fs -> fs.getCode().equals(statusCode)).collect(Collectors.toList()); - return !collect.isEmpty() ? collect.get(0) : null; - } - - @Override - public List getFinanceTenantList(String tenantId, String businessCode,RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws VoucherCustomException{ - if(finSerMdms.getFinanceServiceMdmsData() == null){ - this.getFinanceServiceMdmsData(tenantId, businessCode, requestInfo, finSerMdms); - } - List list = null; - try { - if(finSerMdms.getFinanceServiceMdmsData() != null){ - list = mapper.convertValue(JsonPath.read(finSerMdms.getFinanceServiceMdmsData(), "$.MdmsRes.tenant.citymodule[0].tenants"),new TypeReference>(){}); - } - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"Error while parsing mdms data for CityModule master. Check the CityModule.json file."); - } - return list; - } - - @Override - public List getInstruments(InstrumentSearchContract instrumentSearchContract, RequestInfo requestInfo, String tenantId) throws VoucherCustomException { - StringBuilder uri = new StringBuilder(manager.getInstrumentHostUrl()).append(manager.getInstrumentSearch()); - uri.append("?tenantId=").append(tenantId); - if(instrumentSearchContract.getReceiptIds() != null && !instrumentSearchContract.getReceiptIds().isEmpty()){ - uri.append("&receiptIds=").append(instrumentSearchContract.getReceiptIds()); - } - InstrumentResponse instrumentResponse = mapper.convertValue(serviceRequestRepository.fetchResult(uri, RequestInfoWrapper.builder().requestInfo(requestInfo).build(), tenantId), InstrumentResponse.class); - return instrumentResponse != null ? instrumentResponse.getInstruments() : null; - } - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/TokenService.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/TokenService.java deleted file mode 100644 index 9af675e3716..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/mdms/service/TokenService.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.mdms.service; - -import java.util.HashMap; - -import org.egov.common.contract.request.User; -import org.egov.reciept.consumer.config.PropertiesManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Service; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.RestTemplate; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.jayway.jsonpath.JsonPath; - -@Service -public class TokenService { - - public static final Logger LOGGER = LoggerFactory.getLogger(TokenService.class); - - @Autowired - private RestTemplate restTemplate; - - @Autowired - private PropertiesManager propertiesManager; - - @Autowired - private ObjectMapper mapper; - - public String generateAdminToken(String tenantId) { - - HttpHeaders header = new HttpHeaders(); - header.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - header.add("Authorization", propertiesManager.getTokenAuhorizationtKey()); - - MultiValueMap map = new LinkedMultiValueMap<>(); - map.add("username", propertiesManager.getSiUser()); - map.add("scope", propertiesManager.getSiScope()); - map.add("password", propertiesManager.getSiPassword()); - map.add("grant_type", propertiesManager.getSiGrantType()); - map.add("tenantId", tenantId); - map.add("userType", propertiesManager.getSiUserType()); - - HttpEntity> request = new HttpEntity<>(map, header); - - try { - LOGGER.debug("call: {}", propertiesManager.getTokenGenUrl()); - Object response = restTemplate.postForObject(propertiesManager.getUserHostUrl().trim() + propertiesManager.getTokenGenUrl().trim(), - request, Object.class); - if (response != null) { - String authToken = String.valueOf(((HashMap) response).get("access_token")); - User userInfo = mapper.convertValue(JsonPath.read(response, "$.UserRequest"),new TypeReference(){}); - propertiesManager.setSiAuthToken(authToken); - propertiesManager.setSiUserInfo(userInfo); - return authToken; - } - } catch (RestClientException e) { - LOGGER.error("Eror while getting admin authtoken : {}", e); - return null; - } - return null; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/entity/VoucherIntegrationLog.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/entity/VoucherIntegrationLog.java deleted file mode 100644 index 0f216db24bd..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/entity/VoucherIntegrationLog.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.entity; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class VoucherIntegrationLog { -private String id; -private String referenceNumber; -private String status; -private String voucherNumber; -private String type; -private String requestJson; -private String description; -private String tenantId; -private Date createdDate; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountCodePurpose.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountCodePurpose.java deleted file mode 100644 index d2000c92595..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountCodePurpose.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Setter -@Getter -@ToString -public class AccountCodePurpose { - private Long id = null; - - private String name = null; -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountCodePurposeContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountCodePurposeContract.java deleted file mode 100644 index 11a37c40415..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountCodePurposeContract.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; -import javax.validation.constraints.NotNull; - -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id","name"}) -public class AccountCodePurposeContract extends AuditableContract { - - private String id; - - @NotNull - @Length(max = 256, min = 3) - private String name; - - public AccountCodePurposeContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetail.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetail.java deleted file mode 100644 index 3e4493303d7..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetail.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import java.util.ArrayList; -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class AccountDetail { - - private Long id; - - private Long orderId; - - private String glcode; - - private Double debitAmount; - - private Double creditAmount; - - private Function function; - - private List subledgerDetails = new ArrayList<>(0); - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetailKey.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetailKey.java deleted file mode 100644 index 1adc404af28..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetailKey.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class AccountDetailKey { - - private Long id; - - private AccountDetailType accountDetailType; - - private Long key; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetailType.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetailType.java deleted file mode 100644 index 830ae55e84f..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AccountDetailType.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class AccountDetailType { - - private Long id; - - private String name; - - private String description; - - private String tableName; - - private Boolean active; - - private String fullyQualifiedName; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AppConfigValues.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AppConfigValues.java deleted file mode 100644 index 6535427b9b5..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AppConfigValues.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Setter -@Getter -@NoArgsConstructor -@ToString -public class AppConfigValues { -private String id; -private String value; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AuditDetails.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AuditDetails.java deleted file mode 100644 index f13545795a7..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AuditDetails.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Builder -@Setter -@Getter -@ToString -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode -public class AuditDetails { - - @JsonProperty("createdBy") - private String createdBy = null; - - @JsonProperty("createdDate") - private Long createdDate = null; - - @JsonProperty("lastModifiedBy") - private String lastModifiedBy = null; - - @JsonProperty("lastModifiedDate") - private Long lastModifiedDate = null; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AuditableContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AuditableContract.java deleted file mode 100644 index 392bddc208f..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/AuditableContract.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.egov.common.contract.request.User; - -import java.util.Date; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -public class AuditableContract { - protected String tenantId; - protected User createdBy; - protected User lastModifiedBy; - protected Date createdDate; - protected Date lastModifiedDate; - protected String deleteReason; - - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Bank.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Bank.java deleted file mode 100644 index 5db011414c4..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Bank.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Setter -@Getter -@ToString -@EqualsAndHashCode -public class Bank { - - private Long id; - - private String code; - - private String name; - - private String description; - - private Boolean active; - - private String type; - - private String tenantId; -} - - diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccount.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccount.java deleted file mode 100644 index 6e777a56ddc..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccount.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class BankAccount { - - private Long id; - - private String accountNumber; - - private String accountType; - - private String description; - - private Boolean active; - - private String payTo; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccountContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccountContract.java deleted file mode 100644 index fd20e604dc5..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccountContract.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonProperty.Access; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "bankBranch", "chartOfAccount", "fund", "accountNumber", "accountType", "description", - "active", "payTo", "type" }) -public class BankAccountContract extends AuditableContract implements java.io.Serializable { - - private Long id; - - private BankBranchContract bankBranch; - - @JsonProperty(access = Access.WRITE_ONLY) - private ChartOfAccount chartOfAccount; - - @JsonProperty(access = Access.WRITE_ONLY) - private FundContract fund; - - @NotNull - @Length(max = 25) - private String accountNumber; - - // is this required ? - private String accountType; - @Length(max = 256) - private String description; - - @NotNull - private Boolean active; - - @Length(max = 100) - private String payTo; - - @NotNull - private BankAccountType type; - - public Long getId() { - return this.id; - } - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccountType.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccountType.java deleted file mode 100644 index 75e5f1c2368..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankAccountType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -public enum BankAccountType { - RECEIPTS, PAYMENTS, RECEIPTS_PAYMENTS -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankBranchContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankBranchContract.java deleted file mode 100644 index 8087535131b..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankBranchContract.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "code", "name", "bank", "address", "address2", "city", "state", "pincode", "phone", "fax", - "contactPerson", "active", "description", "micr", "bankAccounts" }) -public class BankBranchContract extends AuditableContract { - - private Long id; - - @NotNull - private BankContract bank; - - @NotNull - @Length(max = 50, min = 1) - private String code; - - @NotNull - @Length(max = 50, min = 1) - @Pattern(regexp = "^[a-zA-Z0-9_]*$") - private String name; - - @NotNull - @Length(max = 50, min = 1) - private String address; - - @Length(max = 50) - private String address2; - - @Length(max = 50) - private String city; - - @Length(max = 50) - private String state; - - @Length(max = 50) - private String pincode; - - @Length(max = 15) - private String phone; - - @Length(max = 15) - private String fax; - - @Length(max = 50) - private String contactPerson; - - @NotNull - private Boolean active; - - @Length(max = 256) - private String description; - - @Length(max = 50) - private String micr; - - public Long getId() { - return this.id; - } - - public BankBranchContract(final String id) { - super(); - this.id = Long.valueOf(id); - } - - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankContract.java deleted file mode 100644 index 0a5641b22c0..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankContract.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.validation.constraints.NotNull; - -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonProperty.Access; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class BankContract { - - private Long id; - - @JsonProperty(access = Access.WRITE_ONLY) - private List ids = new ArrayList(); - - @NotNull - @Length(max = 50, min = 1) - private String code; - - @NotNull - @Length(max = 100, min = 2) - private String name; - - @Length(max = 250) - private String description; - - @NotNull - private Boolean active; - // is this required? - - @Length(max = 50) - private String type; - - private String tenantId; - - public Long getId() { - return id; - } - - public BankContract(final String id) { - super(); - this.id = Long.valueOf(id); - } - - public BankContract(Bank bean) { - this.setTenantId(bean.getTenantId()); - this.setId(bean.getId()); - this.setCode(bean.getCode()); - this.setName(bean.getName()); - this.setType(bean.getType()); - this.setActive(bean.getActive()); - this.setDescription(bean.getDescription()); - } - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankDetails.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankDetails.java deleted file mode 100644 index 7a1b6f2ae64..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BankDetails.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@NoArgsConstructor -public class BankDetails { - @JsonProperty("BRANCH") - private String branchName; - @JsonProperty("ADDRESS") - private String address; - @JsonProperty("CONTACT") - private String contact; - @JsonProperty("CITY") - private String city; - @JsonProperty("DISTRICT") - private String district; - @JsonProperty("STATE") - private String state; - @JsonProperty("NEFT") - private boolean neft; - @JsonProperty("RTGS") - private boolean rtgs; - @JsonProperty("IMPS") - private boolean imps; - @JsonProperty("MICR") - private String micr; - @JsonProperty("BANK") - private String bankName; - @JsonProperty("BANKCODE") - private String bankCode; - @JsonProperty("IFSC") - private String ifsc; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Bill.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Bill.java deleted file mode 100644 index eaf1cc2ffd5..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Bill.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode -public class Bill { - - @JsonProperty("id") - private String id = null; - - @JsonProperty("mobileNumber") - private String mobileNumber = null; - - @JsonProperty("paidBy") - private String paidBy = null; - - @JsonProperty("payerName") - private String payerName = null; - - @JsonProperty("payerAddress") - private String payerAddress = null; - - @JsonProperty("payerEmail") - private String payerEmail = null; - - @JsonProperty("payerId") - private String payerId = null; - - @JsonProperty("isActive") - private Boolean isActive = null; - - @JsonProperty("isCancelled") - private Boolean isCancelled = null; - - @JsonProperty("additionalDetails") - private Object additionalDetails = null; - - @JsonProperty("taxAndPayments") - @Valid - @NotNull - private List taxAndPayments = null; - - private String businessService; - - @JsonProperty("billDetails") - @Valid - private List billDetails = null; - - @JsonProperty("tenantId") - private String tenantId = null; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails = null; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BillAccountDetail.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BillAccountDetail.java deleted file mode 100644 index a647018249d..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BillAccountDetail.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.math.BigDecimal; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Setter -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode -public class BillAccountDetail { - - @JsonProperty("id") - private String id = null; - - @JsonProperty("tenantId") - private String tenantId = null; - - @JsonProperty("billDetail") - private String billDetail = null; - - @JsonProperty("demandDetailId") - private String demandDetailId = null; - - @JsonProperty("order") - private Integer order = null; - - @JsonProperty("amount") - private BigDecimal amount = null; - - @JsonProperty("adjustedAmount") - private BigDecimal adjustedAmount = null; - - @JsonProperty("isActualDemand") - private Boolean isActualDemand = null; - - @JsonProperty("glcode") - private String glcode = null; - - @JsonProperty("taxHeadCode") - private String taxHeadCode = null; - - @JsonProperty("additionalDetails") - private JsonNode additionalDetails = null; - - @JsonProperty("purpose") - private Purpose purpose = null; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BillDetail.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BillDetail.java deleted file mode 100644 index 3a3b38404f8..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BillDetail.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.validation.constraints.NotNull; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class BillDetail { - private String id; - - private String bill; - - private Long billDate; - - private String billDescription; - - private String billNumber; // refNo - - private String consumerCode; - - private String consumerType; - - private BigDecimal minimumAmount; - - private BigDecimal totalAmount; - - private BigDecimal collectedAmount; - - private List collectionModesNotAllowed = new ArrayList<>(); - - private String tenantId; - - private String businessService; // buisnessDetailsCode - - private String displayMessage; - - private Boolean callBackForApportioning; - - private String receiptNumber; - - private Long receiptDate; - - private String receiptType; - - private String channel; - - private String voucherHeader; - - private CollectionType collectionType; - - private String boundary; - - private String reasonForCancellation; - - private BigDecimal amountPaid; - - private String cancellationRemarks; - - private String status; - - @JsonProperty("billAccountDetails") - private List billAccountDetails = new ArrayList<>(); - - private String manualReceiptNumber; - - private Long manualReceiptDate; - - private Long stateId; - - private Boolean partPaymentAllowed; - - @JsonProperty("additionalDetails") - private JsonNode additionalDetails = null; - - @NotNull - @JsonProperty("expiryDate") - private Long expiryDate; - - @JsonProperty("demandId") - private String demandId = null; - - @NotNull - @JsonProperty("fromPeriod") - private Long fromPeriod = null; - - @NotNull - @JsonProperty("toPeriod") - private Long toPeriod = null; - - @JsonProperty("isAdvanceAllowed") - private Boolean isAdvanceAllowed; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BusinessService.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BusinessService.java deleted file mode 100644 index 429b272957a..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/BusinessService.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class BusinessService { - private String code; - private boolean voucherCreationEnabled; - private String fund; - private String function; - private String department; - private String functionary; - private String scheme; - private String subscheme; - private Long validFrom; - private Long validTo; - private String businessService; - private boolean serviceAttributeMappingEnabled; - private String serviceAttributeUrl; - private String serviceAttributeKey; - private String serviceAttributeTaxHead; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ChartOfAccount.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ChartOfAccount.java deleted file mode 100644 index 4cddc807160..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ChartOfAccount.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; - -@Setter -@Getter -@ToString -public class ChartOfAccount { - private Long id; - - private String glcode; - - private String name; - - @JsonProperty("AccountCodePurpose") - private AccountCodePurpose accountCodePurpose; - - private String desciption; - - private Boolean isActiveForPosting; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ChartOfAccountContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ChartOfAccountContract.java deleted file mode 100644 index f7ebc43f885..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ChartOfAccountContract.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; - -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "glcode", "name", "accountCodePurpose", "description", "isActiveForPosting", "parentId", - "type", "classification", "functionRequired", "budgetCheckRequired", "majorCode", "isSubLedger" }) -public class ChartOfAccountContract extends AuditableContract { - - private String id; - - @NotNull - @Length(max = 16, min = 1) - private String glcode; - - @NotNull - @Length(max = 128, min = 5) - private String name; - - private AccountCodePurposeContract accountCodePurpose; - - @Length(max = 256) - private String description; - - @NotNull - private Boolean isActiveForPosting; - - private ChartOfAccountContract parentId; - - @NotNull - private Character type; - - @NotNull - private Long classification; - - @NotNull - private Boolean functionRequired; - - @NotNull - private Boolean budgetCheckRequired; - - @Length(max = 16) - private String majorCode; - - private Boolean isSubLedger; - - public ChartOfAccountContract(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/CityModule.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/CityModule.java deleted file mode 100644 index 2fce5f6a1dd..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/CityModule.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Getter -@Setter -@ToString -@NoArgsConstructor -@AllArgsConstructor -public class CityModule { -private String module; -private String code; -private List tenants; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/CollectionType.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/CollectionType.java deleted file mode 100644 index 601f6dca909..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/CollectionType.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public enum CollectionType { - COUNTER("COUNTER"), - FIELD("FIELD"), - ONLINE("ONLINE"); - - - private String value; - - CollectionType(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - public String getValue() { - return value; - } - - @JsonCreator - public static CollectionType fromValue(String text) { - for (CollectionType b : CollectionType.values()) { - if (0 ==b.value.compareTo(text)) { - return b; - } - } - return null; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/DishonorReasonContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/DishonorReasonContract.java deleted file mode 100644 index 68cf358828f..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/DishonorReasonContract.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.hibernate.validator.constraints.NotBlank; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "reason", "remarks", "instrument", "reversalVoucherId", "dishonorDate" }) -public class DishonorReasonContract extends AuditableContract { - /** - * id is the unique Identifier of the reason - */ - private String id; - /** - * name is the reason of instrument surrender. Example "Damaged cheque","Cheque to be scrapped" etc - */ - @NotBlank - @Size(max = 100, min = 5) - private String reason; - /** - * description is detailed description of the surrender of a instrument - */ - @NotBlank - @Size(max = 250) - private String remarks; - @NotBlank - @Size(max = 250) - private String instrument; - private String reversalVoucherId; - @NotNull - private Long dishonorDate; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/EgModules.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/EgModules.java deleted file mode 100644 index d6cc74cdb86..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/EgModules.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Setter -@Getter -@NoArgsConstructor -@ToString -public class EgModules { - private Integer id; - private String name; - private String description; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/EgwStatus.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/EgwStatus.java deleted file mode 100644 index e7a5318c366..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/EgwStatus.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class EgwStatus { - - private Long id; - - private String moduleType; - - private String code; - - private String description; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FilterRequest.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FilterRequest.java deleted file mode 100644 index 8db3f9b57e0..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FilterRequest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import org.springframework.stereotype.Component; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Component -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class FilterRequest { - private List id; - private String code; - private List codes; - private String billingservicecode; - private String taxhead; - private String glcode; - private long validFrom; - private long validTo; - private String voucherCreationEnabled; - private String fund; - private String function; - private String department; - private String functionary; - private String scheme; - private String subscheme; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinanceMdmsModel.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinanceMdmsModel.java deleted file mode 100644 index 097becb3a8a..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinanceMdmsModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.Getter; -import lombok.Setter; - -@Setter -@Getter -public class FinanceMdmsModel { - private Object financeServiceMdmsData; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialStatus.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialStatus.java deleted file mode 100644 index d8d39f35124..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialStatus.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "moduleType", "code", "description" }) -public class FinancialStatus { - - private String id; - - private String moduleType; - - private String code; - - private String name; - - private String description; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialStatusResponse.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialStatusResponse.java deleted file mode 100644 index 344b37eed10..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialStatusResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class FinancialStatusResponse { - private List financialStatuses; -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialYear.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialYear.java deleted file mode 100644 index 525e5f628cc..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FinancialYear.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class FinancialYear { - - private Long id; - - private String finYearRange; - - private Date startingDate; - - private Date endingDate; - - private Boolean active; - - private Boolean isActiveForPosting; - - private Boolean isClosed; - - private Boolean transferClosingBalance; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FiscalPeriod.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FiscalPeriod.java deleted file mode 100644 index bdc1fe94935..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FiscalPeriod.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class FiscalPeriod { - - private Long id; - - private String name; - - private FinancialYear financialYear; - - private Date startingDate; - - private Date endingDate; - - private Boolean active; - - private Boolean isActiveForPosting; - - private Boolean isClosed; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Function.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Function.java deleted file mode 100644 index b86f275bc83..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Function.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class Function { - - private Long id; - - private String name; - - private String code; - - private Long level; - - private Boolean active; - - private Boolean isParent; - - private Long parentId; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Functionary.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Functionary.java deleted file mode 100644 index 88b9e59e90b..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Functionary.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class Functionary { - - private Long id; - - private String code; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Fund.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Fund.java deleted file mode 100644 index 26a3a26ea19..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Fund.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class Fund { - - private Long id; - - private String name; - - private String code; - - private String identifier; - - private Long level; - - private Long parentId; - - private Boolean isParent; - - private Boolean active; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FundContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FundContract.java deleted file mode 100644 index 0108eb84178..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/FundContract.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; -import org.hibernate.validator.constraints.Length; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonProperty.Access; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "code", "identifier", "level", "parentId", "isParent", "active" }) -public class FundContract extends AuditableContract { - - private Long id; - - @Length(max = 50, min = 2) - @NotNull - private String name; - - @Length(max = 50, min = 2) - @NotNull - private String code; - @NotNull - private Character identifier; - - @NotNull - private Long level; - - @JsonProperty(access = Access.WRITE_ONLY) - private FundContract parentId; - - private Boolean isParent; - @NotNull - private Boolean active; - - public Long getId() { - return this.id; - } - - public FundContract(final String id) { - super(); - this.id = Long.valueOf(id); - } - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Fundsource.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Fundsource.java deleted file mode 100644 index 11d1ffb62ca..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Fundsource.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class Fundsource { - - private Long id; - - private String code; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Instrument.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Instrument.java deleted file mode 100644 index 3e5ee8ecd54..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Instrument.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.databind.JsonNode; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@ToString -public class Instrument{ - - /* - * id is the unique reference to Instrument Header entered in the system. - */ - private String id; - - /* - * transactionNumber unique number of the instrument. For cheque type this - * is cheque date. For DD type it is DD number - * - */ - private String transactionNumber; - - /* - * transactionDate is the date of instrument . For cheque type it is cheque - * date. for DD it is DD date - */ - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") - private Date transactionDate; - - /** - * Transaction date as long comes from UI in case of cheque and DD - */ - private Long transactionDateInput; - - /* - * amount is the instrument amount. For cheque type it is cheque amount. - */ - @NotNull - @Min(value = 0) - @Max(value = 999999999) - private BigDecimal amount; - - /* - * instrumentType specifies the type of the instrument - The folowing are - * the different types Cash,Cheque,DD,POC - * - */ - @NotNull - private InstrumentType instrumentType; - - private Long instrumentDate; - - private String instrumentNumber; - - /* - * bank references to the bank from which the payment/Receipt is made. - */ - private BankContract bank; - - /* - * branchName is the branch name entered in the collection Receipt. - */ - - @Size(max = 50) - private String branchName; - - /* - * bankAccount is the reference of the Bank account from which the payment - * instrument is assigned - */ - private BankAccountContract bankAccount; - - /** - * IFSC Code of the bank branch - */ - private String ifscCode; - - - /* - * transactionType are of two kinds -Debit and Credit. When its a receipt - * instrument it is Debit and in case of payment instrument its credit. - */ - private TransactionType transactionType; - - /** - * Status of the instrument, newly added - */ - private InstrumentStatusEnum instrumentStatus; - - /* - * payee is the entity who is making the payment via instrument - */ - @Size(max = 50) - private String payee; - - /* - * drawer is the entity to which the payment is made. - */ - @Size(max = 100) - private String drawer; - - /* - * surrenderReason is the reason from the defined list seleted while - * surrendering a payment cheque. Depending on the reason, the cheque can be - * re-used or not is decided. - */ - private SurrenderReason surrenderReason; - - /* - * serialNo is the series of the cheque numbers from which the instrument is - * assigned from. The cheque numbers in an account is defined based on Year, - * Bank account and tagged to a department. - */ - //@NotBlank - @Size(max = 50, min = 2) - private String serialNo; - - /* - * instrumentVouchers is the reference to the payment vouchers for which the - * instrument is attached. - */ - // @DrillDownTable - private Set instrumentVouchers = new HashSet(0); - - private AuditDetails auditDetails; - - private JsonNode additionalDetails; - - @NotNull - private String tenantId; - - private String paymentId; - - public InstrumentContract toContract() { - - InstrumentContract contract = new InstrumentContract(); - - contract.setId(this.getId()); - contract.setAmount(this.getAmount()); - contract.setBank(this.getBank()); - contract.setBankAccount(this.getBankAccount()); - contract.setBranchName(this.getBranchName()); - contract.setDrawer(this.getDrawer()); - contract.setInstrumentType(this.getInstrumentType()); - contract.setSurrenderReason(this.getSurrenderReason()); - if (this.getInstrumentVouchers() != null) { - - List instrumentVouchers = new ArrayList<>(); - - if (this.getInstrumentVouchers() != null) - for (InstrumentVoucher iv : this.getInstrumentVouchers()) - instrumentVouchers - .add(InstrumentVoucherContract.builder().instrument(contract.getId()) - .voucherHeaderId(iv.getVoucherHeaderId()).build()); - - contract.setInstrumentVouchers(instrumentVouchers); - - } - contract.setPayee(this.getPayee()); - contract.setSerialNo(this.getSerialNo()); - contract.setTransactionDate(this.getTransactionDate()); - contract.setTransactionNumber(this.getTransactionNumber()); - contract.setTransactionType(this.getTransactionType()); - contract.setTenantId(this.getTenantId()); - return contract; - } - -} - diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeContract.java deleted file mode 100644 index 87ec6ca3e71..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeContract.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "instrumentType", "accountCode" }) -public class InstrumentAccountCodeContract extends AuditableContract { - - /* - * id is the unique reference to Instrument AccountCodes entered in the system. - */ - private String id; - - /* - * instrumentType specifies the mode/type of transaction that can be made - i.e Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS - */ - private InstrumentTypeContract instrumentType; - - /* - * accountCode is the COA that is tagged to a instrument type used in ledger posting. - */ - private ChartOfAccountContract accountCode; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeReq.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeReq.java deleted file mode 100644 index c71d6984984..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeReq.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@ToString -public class InstrumentAccountCodeReq { - @NotNull - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("requestInfo") - private RequestInfo requestInfo; - - private InstrumentAccountCodeSearchContract instrumentAccountCodeSearchContract; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeResponse.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeResponse.java deleted file mode 100644 index 9832c29a8c4..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.Data; - -@JsonIgnoreProperties(ignoreUnknown=true) -public @Data class InstrumentAccountCodeResponse { - private ResponseInfo responseInfo; - private List instrumentAccountCodes; -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeSearchContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeSearchContract.java deleted file mode 100644 index 318c8116e50..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentAccountCodeSearchContract.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -public class InstrumentAccountCodeSearchContract extends InstrumentAccountCodeContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentContract.java deleted file mode 100644 index 59865f19b92..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentContract.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.hibernate.validator.constraints.NotBlank; - -import com.fasterxml.jackson.annotation.JsonFormat; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@ToString -@JsonPropertyOrder({ "id", "transactionNumber", "transactionDate", "amount", "instrumentType", "bank", "branchName", - "bankAccount", "financialStatus", "remittanceVoucherId", "transactionType", "payee", "drawer", "surrendarReason", - "serialNo", - "instrumentVouchers" }) -public class InstrumentContract { - - /* - * id is the unique reference to InstrumentContract Header entered in the system. - */ - private String id; - - private String tenantId; - - /* - * transactionNumber unique number of the instrument. For cheque type this is cheque date. For DD type it is DD number - */ - @NotBlank - @Size(max = 50, min = 6) - private String transactionNumber; - - /* - * transactionDate is the date of instrument . For cheque type it is cheque date. for DD it is DD date - */ - @NotNull - @JsonFormat(pattern = "dd-MM-yyyy") - private Date transactionDate; - - /* - * amount is the instrument amount. For cheque type it is cheque amount. - */ - @NotNull - @Min(value = 1) - @Max(value = 999999999) - private BigDecimal amount; - - /* - * instrumentType specifies the type of the instrument - The folowing are the different types Cash,Cheque,DD,POC - */ - private InstrumentType instrumentType; - - /* - * bank references to the bank from which the payment/Receipt is made. - */ - private BankContract bank; - - /* - * branchName is the branch name entered in the collection Receipt. - */ - - @Size(max = 50) - private String branchName; - - /* - * bankAccount is the reference of the Bank account from which the payment instrument is assigned - */ - private BankAccountContract bankAccount; - - /* - * instrumentStatus gives the current status of the instrument. - */ - private FinancialStatus financialStatus; - - private String remittanceVoucherId; - - /* - * transactionType are of two kinds -Debit and Credit. When its a receipt instrument it is Debit and in case of payment - * instrument its credit. - */ - @NotNull - private TransactionType transactionType; - - /* - * payee is the entity who is making the payment via instrument - */ - @Size(max = 50) - private String payee; - - /* - * drawer is the entity to which the payment is made. - */ - @Size(max = 100) - private String drawer; - - /* - * surrenderReason is the reason from the defined list seleted while surrendering a payment cheque. Depending on the reason, - * the cheque can be re-used or not is decided. - */ - private SurrenderReason surrenderReason; - - /* - * serialNo is the series of the cheque numbers from which the instrument is assigned from. The cheque numbers in an account - * is defined based on Year, Bank account and tagged to a department. - */ - @NotBlank - @Size(max = 50, min = 2) - private String serialNo; - - private String payinSlipId; - - @Min(value = 1) - @Max(value = 999999999) - private BigDecimal reconciledAmount; - - private Date reconciledOn; - - /* - * instrumentVouchers is the reference to the payment vouchers for which the instrument is attached. - */ - private List instrumentVouchers = new ArrayList<>(); - - private DishonorReasonContract dishonor; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentGlCodeMapping.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentGlCodeMapping.java deleted file mode 100644 index b648d98f402..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentGlCodeMapping.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class InstrumentGlCodeMapping { -private String instrumenttype; -private String glcode; -private Long validFrom; -private Long validTo; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentRequest.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentRequest.java deleted file mode 100644 index 2139a966f9b..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentRequest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.ArrayList; -import java.util.List; - -import lombok.Data; - -public @Data class InstrumentRequest { - private RequestInfo requestInfo = new RequestInfo(); - private List instruments = new ArrayList(); -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentResponse.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentResponse.java deleted file mode 100644 index b587bdb6788..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -import lombok.Data; - -@JsonInclude(value = Include.NON_NULL) -public @Data class InstrumentResponse { - private List instruments; -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentSearchContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentSearchContract.java deleted file mode 100644 index abe5ff36010..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentSearchContract.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.model; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class InstrumentSearchContract { - private String ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private String instrumentTypes; - private String receiptIds; - private String financialStatuses; - private Date transactionFromDate; - private Date transactionToDate; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentStatus.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentStatus.java deleted file mode 100644 index e8f9a36e038..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentStatus.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@ToString -@Builder -public class InstrumentStatus { - - /** - * Unique Identifier of the status - */ - @NotNull - private String id; - - @NotNull - @Size(min = 3, max = 50) - private String moduleType; - - /** - * name is the status name - */ - @NotNull - @Size(min = 3, max = 20) - private String name; - - /** - * description is the detailed description of the status - */ - @NotNull - @Size(min = 3, max = 250) - private String description; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentStatusEnum.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentStatusEnum.java deleted file mode 100644 index 3ed8c35df64..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentStatusEnum.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.HashSet; -import java.util.Set; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public enum InstrumentStatusEnum { - APPROVED("APPROVED", InstrumentStatusEnum.Category.OPEN), - APPROVAL_PENDING("APPROVAL_PENDING", InstrumentStatusEnum.Category.OPEN), - TO_BE_SUBMITTED("TO_BE_SUBMITTED", InstrumentStatusEnum.Category.OPEN), - REMITTED("REMITTED", InstrumentStatusEnum.Category.OPEN), - REJECTED("REJECTED", InstrumentStatusEnum.Category.CLOSED), - CANCELLED("CANCELLED", InstrumentStatusEnum.Category.CLOSED), - DISHONOURED("DISHONOURED", InstrumentStatusEnum.Category.CLOSED); - - - private String value; - - private InstrumentStatusEnum.Category category; - - InstrumentStatusEnum(String value, InstrumentStatusEnum.Category category) { - this.value = value; - this.category = category; - } - - public boolean isCategory(InstrumentStatusEnum.Category category) { - return this.category == category; - } - - public static Set statusesByCategory(InstrumentStatusEnum.Category category) { - Set statuses = new HashSet<>(); - for (InstrumentStatusEnum b : InstrumentStatusEnum.values()) { - if (b.category == category) { - statuses.add(b.value); - } - } - - return statuses; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InstrumentStatusEnum fromValue(String text) { - for (InstrumentStatusEnum b : InstrumentStatusEnum.values()) { - if (String.valueOf(b.value).equalsIgnoreCase(text)) { - return b; - } - } - return null; - } - - public enum Category { - OPEN, - CLOSED; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentType.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentType.java deleted file mode 100644 index 2457fd2411a..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentType.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.hibernate.validator.constraints.NotBlank; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@ToString -@Builder -public class InstrumentType{ - - /* - * id is the unique reference to instrument type entered in the system. - */ - private String id; - - /* - * type specifies the mode/type of transaction that can be made - i.e - * Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS - */ - @NotNull - @NotBlank - @Size(max = 50, min = 2) - private String name; - - /* - * description specifies details of the instrument type . For example type - * DD description may be Demand Draft - */ - - @Size(max = 100) - private String description; - - /* - * active specifies whether the type is active for transacting. - */ - @NotNull - private Boolean active; - - @Valid - @NotNull - @Size(max = 2, min = 2, message = "") - private List instrumentTypeProperties; - -} - diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypeContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypeContract.java deleted file mode 100644 index 632996ff423..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypeContract.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "id", "name", "description", "active", "instrumentTypeProperties" }) -public class InstrumentTypeContract extends AuditableContract { - - /* - * id is the unique reference to instrument type entered in the system. - */ - private String id; - - /* - * type specifies the mode/type of transaction that can be made - i.e Cheque,DD,RTGS. For receipt - Cheque,DD,RTGS - */ - @NotNull - @Size(max = 50, min = 2) - private String name; - - /* - * description specifies details of the instrument type . For example type DD description may be Demand Draft - */ - - @Size(max = 100) - private String description; - - /* - * active specifies whether the type is active for transacting. - */ - @NotNull - private Boolean active; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypeProperty.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypeProperty.java deleted file mode 100644 index 2d864dc4525..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypeProperty.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.NotNull; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class InstrumentTypeProperty{ - - @NotNull - private TransactionType transactionType; - @NotNull - private Boolean reconciledOncreate; - @NotNull - private InstrumentStatus statusOnCreate; - @NotNull - private InstrumentStatus statusOnUpdate; - @NotNull - private InstrumentStatus statusOnReconcile; -} - diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypesEnum.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypesEnum.java deleted file mode 100644 index d63316ac373..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentTypesEnum.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -public enum InstrumentTypesEnum { - CASH, CHEQUE, DD, ONLINE, CARD; - - public static boolean contains(String test) { - for (InstrumentTypesEnum val : InstrumentTypesEnum.values()) { - if (val.name().equalsIgnoreCase(test)) { - return true; - } - } - return false; - } -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentVoucher.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentVoucher.java deleted file mode 100644 index deeba41c699..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentVoucher.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -public class InstrumentVoucher { - - /* - * instrumentHeaderId is the reference of the instrument attached to a - * voucher - */ - private Instrument instrument; - - /* - * voucherHeaderId is the reference of the voucher attached to a instrument. - */ - private String voucherHeaderId; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentVoucherContract.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentVoucherContract.java deleted file mode 100644 index 5da70f13139..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/InstrumentVoucherContract.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor - -@JsonPropertyOrder({ "instrument", "voucherHeaderId", "receiptHeaderId" }) -public class InstrumentVoucherContract { - - /* - * instrumentHeaderId is the reference of the instrument attached to a voucher - */ - private String instrument; - - /* - * voucherHeaderId is the reference of the voucher attached to a instrument. - */ - private String voucherHeaderId; - - /* - * receiptHeaderId is the reference of the receipt attached to a instrument. - */ - private String receiptHeaderId; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MasterDetail.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MasterDetail.java deleted file mode 100644 index 02b213501a3..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MasterDetail.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.io.Serializable; - -import org.springframework.stereotype.Component; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Component -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class MasterDetail implements Serializable{ - private String name; - private String filter; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsCriteria.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsCriteria.java deleted file mode 100644 index 5289cd8521b..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsCriteria.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import org.springframework.stereotype.Component; -@Component -public class MdmsCriteria { - - private String tenantId; - - private List moduleDetails; - - public MdmsCriteria(String tenantId, List moduleDetails) { - this.tenantId = tenantId; - this.moduleDetails = moduleDetails; - } - - public MdmsCriteria(){} - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public List getModuleDetails() { - return moduleDetails; - } - - public void setModuleDetails(List moduleDetails) { - this.moduleDetails = moduleDetails; - } - - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsCriteriaReq.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsCriteriaReq.java deleted file mode 100644 index 87aa1c2801d..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsCriteriaReq.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import org.springframework.stereotype.Component; -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Component -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class MdmsCriteriaReq { - @JsonProperty("RequestInfo") - private RequestInfo requestInfo; - @JsonProperty("MdmsCriteria") - private MdmsCriteria mdmsCriteria; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsResponse.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsResponse.java deleted file mode 100644 index b90f04b7db4..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/MdmsResponse.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.Map; -import org.springframework.stereotype.Component; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import net.minidev.json.JSONArray; - -@Component -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class MdmsResponse { - @JsonProperty("ResponseInfo") - private ResponseInfo responseInfo; - @JsonProperty("MdmsRes") - private Map> mdmsRes; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ModuleDetail.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ModuleDetail.java deleted file mode 100644 index 5163ca76ec7..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ModuleDetail.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import org.springframework.stereotype.Component; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Component -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class ModuleDetail { - private String moduleName; - private List masterDetails; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/OnlineGLCodeMapping.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/OnlineGLCodeMapping.java deleted file mode 100644 index 0db3eefb811..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/OnlineGLCodeMapping.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Setter -@Getter -@ToString -@NoArgsConstructor -@AllArgsConstructor -public class OnlineGLCodeMapping { -private String servicecode; -private String glcode; -private Long validFrom; -private Long validTo; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ProcessStatus.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ProcessStatus.java deleted file mode 100644 index 13ecdd50213..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ProcessStatus.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -public enum ProcessStatus { -FAILED,SUCCESS,NA -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Purpose.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Purpose.java deleted file mode 100644 index 2ae48bc1229..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Purpose.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public enum Purpose { - - ARREAR("ARREAR"), - - CURRENT("CURRENT"), - - ADVANCE("ADVANCE"), - - EXEMPTION("EXEMPTION"), - - ARREAR_LATEPAYMENT_CHARGES("ARREAR_LATEPAYMENT_CHARGES"), - - CURRENT_LATEPAYMENT_CHARGES("CURRENT_LATEPAYMENT_CHARGES"), - - CHEQUE_BOUNCE_PENALTY("CHEQUE_BOUNCE_PENALTY"), - - REBATE("REBATE"), - - OTHERS("OTHERS"); - - private String value; - - Purpose(String value) { - this.value = value; - } - - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static Purpose fromValue(String text) { - for (Purpose b : Purpose.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Receipt.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Receipt.java deleted file mode 100644 index fdf4225b5c0..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Receipt.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.ArrayList; -import java.util.List; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@NoArgsConstructor -@AllArgsConstructor -@Builder -@Setter -@Getter -@ToString -@EqualsAndHashCode(of = {"receiptNumber"}) -public class Receipt { - - @NotNull - private String tenantId; - - private String transactionId; - - // Read only, populated during search - private String receiptNumber; - - // Read only, populated during search - private String consumerCode; - - // Read only, populated during search - private Long receiptDate; - - @NotNull - @Size(min = 1, max = 1) - @Valid - @JsonProperty("Bill") - private List bill = new ArrayList<>(); - - private AuditDetails auditDetails; - - @Valid - private Instrument instrument; - - @JsonIgnore - private String paymentId; - - @JsonIgnore - private String paymentDetailId; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ReceiptReq.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ReceiptReq.java deleted file mode 100644 index c6fd1154392..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ReceiptReq.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.*; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import java.util.List; - -@Setter -@Getter -@ToString -@Builder -@EqualsAndHashCode -@AllArgsConstructor -@NoArgsConstructor -public class ReceiptReq { - - @NotNull - @JsonProperty("RequestInfo") - private RequestInfo requestInfo; - - @NotNull - @JsonProperty("Receipt") - @Valid - private List receipt = null; - - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ReceiptResponse.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ReceiptResponse.java deleted file mode 100644 index 968b179c4b3..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ReceiptResponse.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Setter -@Getter -@ToString -@Builder -@EqualsAndHashCode -@AllArgsConstructor -@NoArgsConstructor -public class ReceiptResponse { - - @JsonProperty("Receipt") - private List receipts; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/RequestInfo.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/RequestInfo.java deleted file mode 100644 index d60d8e662cc..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/RequestInfo.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import org.egov.common.contract.request.User; -import org.springframework.stereotype.Component; - - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Component -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class RequestInfo { - private String apiId; - private String ver; - private Long ts; - private String action; - private String did; - private String key; - private String msgId; - private String authToken; - private String correlationId; - private User userInfo; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/RequestInfoWrapper.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/RequestInfoWrapper.java deleted file mode 100644 index 08354d8ca94..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/RequestInfoWrapper.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class RequestInfoWrapper { - - @JsonProperty("RequestInfo") - private RequestInfo requestInfo; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ResponseInfo.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ResponseInfo.java deleted file mode 100644 index ae205d690e1..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/ResponseInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import org.springframework.stereotype.Component; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Component -@Setter -@Getter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class ResponseInfo { - private String apiId; - private String ver; - private String ts; - private String resMsgId; - private String msgId; - private String status; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Scheme.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Scheme.java deleted file mode 100644 index 2aa5ff9e408..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Scheme.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class Scheme { - - private Long id; - - private String code; - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SubScheme.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SubScheme.java deleted file mode 100644 index 6800fda5b86..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SubScheme.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.util.Date; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class SubScheme { - - private String id; - - private Scheme scheme; - - private String code; - - private String name; - - private Date validFrom; - - private Date validTo; - - private Boolean active; - - private String departmentId; - - public SubScheme(String id) { - this.id = id; - } - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SubledgerDetail.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SubledgerDetail.java deleted file mode 100644 index 7730e18aa13..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SubledgerDetail.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ - -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class SubledgerDetail { - - private Long id; - - private AccountDetailType accountDetailType; - - private AccountDetailKey accountDetailKey; - - private Double amount; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SurrenderReason.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SurrenderReason.java deleted file mode 100644 index 67ff62548ef..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/SurrenderReason.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import javax.validation.constraints.Size; -import org.hibernate.validator.constraints.NotBlank; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@NoArgsConstructor -@AllArgsConstructor -@Getter -@Setter -@Builder -@ToString -public class SurrenderReason{ - /** - * id is the unique Identifier of the reason - */ - private String id; - /** - * name is the reason of instrument surrender. Example "Damaged cheque","Cheque to be scrapped" etc - */ - @NotBlank - @Size(max=50,min=5) - private String name; - /** - * description is detailed description of the surrender of a instrument - */ - @NotBlank - @Size(max=250) - private String description; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TaxAndPayment.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TaxAndPayment.java deleted file mode 100644 index ad5d4530cc2..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TaxAndPayment.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import java.math.BigDecimal; - -import javax.validation.constraints.NotNull; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode -public class TaxAndPayment { - - @NotNull - private String businessService; - - private BigDecimal taxAmount; - - @NotNull - private BigDecimal amountPaid; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TaxHeadMaster.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TaxHeadMaster.java deleted file mode 100644 index 32040214563..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TaxHeadMaster.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class TaxHeadMaster { - private String billingservicecode; - private String taxhead; - private String glcode; - private Long validFrom; - private Long validTo; - private String serviceAttribute; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Tenant.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Tenant.java deleted file mode 100644 index 49aa34729fa..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Tenant.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class Tenant { -private String code; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TransactionType.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TransactionType.java deleted file mode 100644 index 9a7ba127eb1..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/TransactionType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.model; - -public enum TransactionType { - Debit,Credit -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Voucher.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Voucher.java deleted file mode 100644 index d6ae427b165..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/Voucher.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import java.util.ArrayList; -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class Voucher { - - private Long id; - - private String name; - - private String type; - - private String voucherNumber; - - private String description; - - private String voucherDate; - - private Fund fund; - - private Function function; - - private FiscalPeriod fiscalPeriod; - - private EgwStatus status; - - private Long originalVhId; - - private Long refVhId; - - private String cgvn; - - private Long moduleId; - - private String department; - - private String source; - - private Scheme scheme; - - private SubScheme subScheme; - - private Functionary functionary; - - private Fundsource fundsource; - - private List ledgers = new ArrayList<>(0); - - private String tenantId; - - private String referenceDocument; - - private String serviceName; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherRequest.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherRequest.java deleted file mode 100644 index 22c5d704e06..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherRequest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class VoucherRequest { - - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("RequestInfo") - private RequestInfo requestInfo; - - @JsonProperty("vouchers") - private List vouchers = new ArrayList<>(0); - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherResponse.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherResponse.java deleted file mode 100644 index 1a810d56edf..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherResponse.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Builder -@Getter -@Setter -@AllArgsConstructor -@NoArgsConstructor -public class VoucherResponse { - - @JsonProperty("Vouchers") - private List vouchers = new ArrayList<>(0); - @JsonProperty("ResponseInfo") - private ResponseInfo responseInfo; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherSearchCriteria.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherSearchCriteria.java deleted file mode 100644 index 64a69094b34..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherSearchCriteria.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.egov.receipt.consumer.model; - -import java.util.Set; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; - -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -@Builder -public class VoucherSearchCriteria { - private Set ids; - private String sortBy; - private Integer pageSize; - private Integer offset; - private Set voucherNumbers; - private Long voucherFromDate; - private Long voucherToDate; - private String voucherType; - private String voucherName; - private String fundId; - private String deptCode; - private String tenantId; -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherSearchRequest.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherSearchRequest.java deleted file mode 100644 index 2184e0f31a2..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/model/VoucherSearchRequest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2017 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * Further, all user interfaces, including but not limited to citizen facing interfaces, - * Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any - * derived works should carry eGovernments Foundation logo on the top right corner. - * - * For the logo, please refer http://egovernments.org/html/logo/egov_logo.png. - * For any further queries on attribution, including queries on brand guidelines, - * please contact contact@egovernments.org - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - * - */ -package org.egov.receipt.consumer.model; -import javax.validation.constraints.NotNull; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class VoucherSearchRequest { - - @NotNull - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("RequestInfo") - private RequestInfo requestInfo; - - private String voucherNumbers; - - - - public String getVoucherNumbers() { - return voucherNumbers; - } - - public void setVoucherNumbers(String voucherNumbers) { - this.voucherNumbers = voucherNumbers; - } - - public void setRequestInfo(RequestInfo requestInfo) { - this.requestInfo = requestInfo; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public RequestInfo getRequestInfo() { - return requestInfo; - } - - - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/ServiceRequestRepository.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/ServiceRequestRepository.java deleted file mode 100644 index 9a90503614b..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/ServiceRequestRepository.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.repository; - -import java.lang.reflect.Field; -import java.util.Map; - -import org.egov.mdms.service.TokenService; -import org.egov.receipt.consumer.model.ProcessStatus; -import org.egov.receipt.consumer.model.RequestInfo; -import org.egov.receipt.consumer.model.VoucherRequest; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Repository; -import org.springframework.util.ReflectionUtils; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.RestTemplate; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -import lombok.extern.slf4j.Slf4j; - -@Repository -@Slf4j -public class ServiceRequestRepository { - - private static final String SEARCHER_EXCEPTION_MESSAGE = "Exception while fetching from searcher: "; - - @Autowired - private RestTemplate restTemplate; - @Autowired - private TokenService tokenService; - @Autowired - private ObjectMapper mapper; - - /** - * Fetches results from searcher framework based on the uri and request that define what is to be searched. - * - * @param requestInfo - * @param serviceReqSearchCriteria - * @return Object - * @author atique - */ - public Object fetchResult(StringBuilder uri, Object request, String tenantId) throws VoucherCustomException { - mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - Object response = null; - - try { - populateWithAdminToken(uri, request, tenantId); - response = restTemplate.postForObject(uri.toString(), request, Map.class); - } catch (HttpClientErrorException e) { - if (e.getStatusCode().equals(HttpStatus.UNAUTHORIZED)) { - log.error("Unauthorized accessed : Retrying http uri {} with SYSTEM auth token.", uri.toString()); - response = this.retryHttpCallOnUnauthorizedAccess(uri, request, tenantId); - } else { - log.error(SEARCHER_EXCEPTION_MESSAGE, e.getResponseBodyAsString()); - throw new VoucherCustomException(ProcessStatus.FAILED, e.getResponseBodyAsString()); - } - } catch (Exception e) { - log.error(SEARCHER_EXCEPTION_MESSAGE, e); - throw new VoucherCustomException(ProcessStatus.FAILED, "Exception while fetching from searcher."); - } - return response; - } - - private Object retryHttpCallOnUnauthorizedAccess(StringBuilder uri, Object request, String tenantId) - throws VoucherCustomException { - try { - populateWithAdminToken(uri, request, tenantId); - return restTemplate.postForObject(uri.toString(), request, Map.class); - } catch (HttpClientErrorException e) { - if (e.getStatusCode().equals(HttpStatus.UNAUTHORIZED)) { - log.error("Unauthorized accessed : Even after retrying with SYSTEM auth token."); - throw new VoucherCustomException(ProcessStatus.FAILED, - "Error occurred even after retrying uri " + uri.toString() + " with SYSTEM auth token."); - } - } catch (IllegalArgumentException | IllegalAccessException e) { - log.error(e.getMessage()); - } - return null; - } - - private void populateWithAdminToken(StringBuilder uri, Object request, String tenantId) - throws IllegalAccessException, VoucherCustomException { - RequestInfo requestInfo = null; - Class clazz = request.getClass(); - Field field = ReflectionUtils.findField(clazz, "requestInfo"); - if (field != null) { - ReflectionUtils.makeAccessible(field); - requestInfo = (RequestInfo) field.get(request); - if (requestInfo.getAuthToken() == null) - requestInfo.setAuthToken(tokenService.generateAdminToken(tenantId)); - ReflectionUtils.setField(field, request, requestInfo); - } else { - throw new VoucherCustomException(ProcessStatus.FAILED, - "requestInfo properties is not found in uri " + uri.toString()); - } - } - - public Object fetchResultGet(String uri) throws VoucherCustomException { - mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); - Object response = null; - - try { - response = restTemplate.getForObject(uri, Map.class); - } catch (Exception e) { - log.error(SEARCHER_EXCEPTION_MESSAGE, e); - throw new VoucherCustomException(ProcessStatus.FAILED, "IFSC code is invalid : url : " + uri); - } - return response; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/VoucherIntegartionLogRepository.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/VoucherIntegartionLogRepository.java deleted file mode 100644 index cc533becb21..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/VoucherIntegartionLogRepository.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.repository; - -import org.egov.receipt.consumer.entity.VoucherIntegrationLog; -import static org.egov.receipt.consumer.repository.builder.VoucherIntegrationLogQueryBuilder.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.stereotype.Repository; - -import lombok.extern.slf4j.Slf4j; -@Repository -@Slf4j -public class VoucherIntegartionLogRepository{ - - @Autowired - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - public void saveVoucherIntegrationLog(VoucherIntegrationLog vilog){ - try { - namedParameterJdbcTemplate.update(INSERT_VOUCHER_LOG_SQL, getParametersForVoucherIntegartionLog(vilog)); - } catch (Exception e) { - log.error("Failed to save the log record"+e.getCause()); - } - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/builder/VoucherIntegrationLogQueryBuilder.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/builder/VoucherIntegrationLogQueryBuilder.java deleted file mode 100644 index 41d0c06545b..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/repository/builder/VoucherIntegrationLogQueryBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.repository.builder; - -import java.util.UUID; - -import org.egov.receipt.consumer.entity.VoucherIntegrationLog; -import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; - -public class VoucherIntegrationLogQueryBuilder { - - public static final String INSERT_VOUCHER_LOG_SQL = "INSERT INTO egf_voucher_integration_log(id, referencenumber, status, vouchernumber, TYPE, description, requestjson, tenantid, createddate)" - + "VALUES (:id, :referencenumber, :status, :vouchernumber, :TYPE, :description, cast(:requestjson as jsonb), :tenantid,:createddate)"; - - public static MapSqlParameterSource getParametersForVoucherIntegartionLog(VoucherIntegrationLog log){ - MapSqlParameterSource sqlParameterSource = new MapSqlParameterSource(); - sqlParameterSource.addValue("id", UUID.randomUUID().toString()); - sqlParameterSource.addValue("referencenumber", log.getReferenceNumber()); - sqlParameterSource.addValue("status", log.getStatus()); - sqlParameterSource.addValue("vouchernumber", log.getVoucherNumber()); - sqlParameterSource.addValue("TYPE", log.getType()); - sqlParameterSource.addValue("description", log.getDescription()); - sqlParameterSource.addValue("requestjson", log.getRequestJson()); - sqlParameterSource.addValue("tenantid", log.getTenantId()); - sqlParameterSource.addValue("createddate", log.getCreatedDate()); - return sqlParameterSource; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/EgfKafkaListener.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/EgfKafkaListener.java deleted file mode 100644 index 4851cf49e0f..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/EgfKafkaListener.java +++ /dev/null @@ -1,287 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.service; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import org.apache.kafka.clients.consumer.ConsumerRecord; -import org.egov.receipt.consumer.entity.VoucherIntegrationLog; -import org.egov.receipt.consumer.model.Bill; -import org.egov.receipt.consumer.model.BillDetail; -import org.egov.receipt.consumer.model.EgwStatus; -import org.egov.receipt.consumer.model.FinanceMdmsModel; -import org.egov.receipt.consumer.model.ProcessStatus; -import org.egov.receipt.consumer.model.Receipt; -import org.egov.receipt.consumer.model.ReceiptReq; -import org.egov.receipt.consumer.model.Voucher; -import org.egov.receipt.consumer.model.VoucherResponse; -import org.egov.receipt.consumer.repository.VoucherIntegartionLogRepository; -import org.egov.receipt.consumer.util.PaymentUtils; -import org.egov.receipt.consumer.v2.model.PaymentDetail; -import org.egov.receipt.consumer.v2.model.PaymentRequest; -import org.egov.receipt.consumer.v2.model.PaymentStatusEnum; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.egov.reciept.consumer.config.PropertiesManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class EgfKafkaListener { - @Autowired - private ObjectMapper objectMapper; - @Autowired - private VoucherService voucherService; - @Autowired - private ReceiptService receiptService; - @Autowired - private InstrumentService instrumentService; - @Autowired - private VoucherIntegartionLogRepository voucherIntegartionLogRepository; - @Autowired - private PropertiesManager manager; - @Autowired - private PaymentUtils payUtils; - - public static final Logger LOGGER = LoggerFactory.getLogger(EgfKafkaListener.class); - private static final String RECEIPT_TYPE = "Receipt"; - @Value("${}") - private static final String COLLECTION_VERSION = "V2"; - - @KafkaListener(topics = {"${egov.collection.receipt.voucher.save.topic}","${egov.collection.receipt.voucher.cancel.topic}","${kafka.topics.payment.create.name}","${kafka.topics.payment.cancel.name}"}) - public void process(ConsumerRecord record) { - VoucherResponse voucherResponse = null; - String voucherNumber = ""; - ReceiptReq recRequest = ReceiptReq.builder().build(); - PaymentRequest payRequest = null; - FinanceMdmsModel finSerMdms = new FinanceMdmsModel(); - try { - String topic = record.topic(); - if(topic.equals(manager.getCreatePaymentTopicName()) || topic.equals(manager.getCancelPaymentTopicName())){ - payRequest = objectMapper.readValue(record.value(), PaymentRequest.class); - List receipts = new ArrayList(); - //Wrapper to convert payment request to receipt request - payUtils.getReceiptsFromPayments(Arrays.asList(payRequest.getPayment()), receipts); - recRequest.setRequestInfo(payRequest.getRequestInfo()); - recRequest.setReceipt(receipts); - }else{ - recRequest = objectMapper.readValue(record.value(), ReceiptReq.class); - } - LOGGER.info("topic : {} , request : {}", topic, recRequest); - if(voucherService.isTenantEnabledInFinanceModule(recRequest, finSerMdms)){ - Receipt receipt = recRequest.getReceipt().get(0); - BillDetail billDetail = receipt.getBill().get(0).getBillDetails().get(0); - String description = ""; - ProcessStatus status = ProcessStatus.SUCCESS; - //Fetching the voucher details for the combination of service code and reference document in ERP - if(topic.equals(manager.getVoucherCreateTopic())){ - VoucherResponse voucherByServiceAndRefDoc = voucherService.getVoucherByServiceAndRefDoc(recRequest.getRequestInfo(), receipt.getTenantId(), billDetail.getBusinessService(), billDetail.getReceiptNumber()); - if (voucherService.isVoucherCreationEnabled(recRequest.getReceipt().get(0), recRequest.getRequestInfo(), finSerMdms)) { - /* Checking existed voucher status if any present - * if voucher is present with status != 4 then terminate the process and printing specific log. - */ - if(!voucherByServiceAndRefDoc.getVouchers().isEmpty() && !voucherByServiceAndRefDoc.getVouchers().get(0).getStatus().getCode().equals("4")){ - voucherNumber = voucherByServiceAndRefDoc.getVouchers().get(0).getVoucherNumber(); - throw new VoucherCustomException(ProcessStatus.NA, "Already voucher exists ("+voucherNumber+") for service "+billDetail.getBusinessService()+" with reference number "+billDetail.getReceiptNumber()+"."); - } - voucherResponse = voucherService.createReceiptVoucher(recRequest, finSerMdms, null); - voucherNumber = voucherResponse.getVouchers().get(0).getVoucherNumber(); - receiptService.updateReceipt(recRequest, voucherResponse); - instrumentService.createInstrument(recRequest, voucherResponse, finSerMdms, null); - description = "Voucher created successfully with VoucherNumber : "+voucherNumber; - status = ProcessStatus.SUCCESS; - }else{ - //Todo : Status should be different - description = "Voucher creation is not enabled for business service code : "+recRequest.getReceipt().get(0).getBill().get(0).getBillDetails().get(0).getBusinessService(); - status = ProcessStatus.SUCCESS; - } - this.getBackupToDB(recRequest,status,description,voucherNumber); - }else if(topic.equals(manager.getVoucherCancelTopic())){ - /* Checking voucher existence in ERP for the combination. - * if not found then throwing exception with Not Found - * if voucher found cross checking the request voucher number and erp existed voucher number.if both are same then based on status it will proceed ahead. - * if status!=4 then proceed ahead to cancel the erp existed voucher. - * if status=4 then terminating execution and feeding data to table with specific message. - */ - VoucherResponse voucherByServiceAndRefDoc = voucherService.getVoucherByServiceAndRefDoc(recRequest.getRequestInfo(), receipt.getTenantId(), billDetail.getBusinessService(), billDetail.getReceiptNumber()); - if(!voucherByServiceAndRefDoc.getVouchers().isEmpty()){ - Voucher voucher = voucherByServiceAndRefDoc.getVouchers().get(0); - String erpVoucherNumber = voucher.getVoucherNumber(); - String reqVoucherNumber = recRequest.getReceipt().get(0).getBill().get(0).getBillDetails().get(0).getVoucherHeader(); - if(voucher.getStatus().getCode().equals("4")){ - status = ProcessStatus.NA; - description = "Voucher("+erpVoucherNumber+") associated with service "+billDetail.getBusinessService()+" and reference number "+billDetail.getReceiptNumber() - + " is already in Cancelled status."; - if(!reqVoucherNumber.isEmpty() && !erpVoucherNumber.equals(reqVoucherNumber)){ - description += "However, we found that the mapping voucher reference sent("+reqVoucherNumber+") is incorrect."; - } - }else{ - description = "Voucher number : "+erpVoucherNumber+" is CANCELLED successfully!"; - if(!reqVoucherNumber.isEmpty() && !erpVoucherNumber.equals(reqVoucherNumber)){ - description = "Voucher("+erpVoucherNumber+") associated with service "+billDetail.getBusinessService() - + " and reference number "+billDetail.getReceiptNumber()+" is Cancelled. " - + "However, we found that the mapping voucher reference sent("+reqVoucherNumber+") is incorrect."; - } - recRequest.getReceipt().get(0).getBill().get(0).getBillDetails().get(0).setVoucherHeader(erpVoucherNumber); - voucherService.cancelReceiptVoucher(recRequest, this.getTenantId(recRequest), Collections.singleton(erpVoucherNumber)); - instrumentService.cancelInstrument(recRequest,finSerMdms); - } - this.getBackupToDB(recRequest, status, description, erpVoucherNumber); - }else{ - throw new VoucherCustomException(ProcessStatus.FAILED, "Voucher is not exist for service "+billDetail.getBusinessService()+" with reference number "+billDetail.getReceiptNumber()); - } - } else if (topic.equals(manager.getCreatePaymentTopicName())) { - // create voucher for collection v2 - ReceiptReq recRequestTemp = ReceiptReq.builder().requestInfo(recRequest.getRequestInfo()).build(); - for (Receipt recpt : recRequest.getReceipt()) { - recRequestTemp.setReceipt(Arrays.asList(recpt)); - Bill bill = recpt.getBill().get(0); - VoucherResponse voucherByServiceAndRefDoc = voucherService.getVoucherByServiceAndRefDoc(recRequestTemp.getRequestInfo(), recpt.getTenantId(), null, recpt.getPaymentId()); - if (voucherService.isVoucherCreationEnabled(recpt, recRequestTemp.getRequestInfo(), finSerMdms)) { - if(!voucherByServiceAndRefDoc.getVouchers().isEmpty() && !voucherByServiceAndRefDoc.getVouchers().get(0).getStatus().getCode().equals("4")){ - voucherNumber = voucherByServiceAndRefDoc.getVouchers().get(0).getVoucherNumber(); - throw new VoucherCustomException(ProcessStatus.NA, String.format("Already voucher exists (%1$s) for service %2$s with reference number: %3$s.", voucherNumber, bill.getBusinessService(), recpt.getPaymentId())); - } - VoucherResponse createReceiptVoucher = voucherService.createReceiptVoucher(recRequestTemp, finSerMdms, COLLECTION_VERSION); - if(voucherResponse == null){ - voucherResponse = createReceiptVoucher; - }else{ - voucherResponse.getVouchers().addAll(createReceiptVoucher.getVouchers()); - } - if(voucherNumber.isEmpty()){ - voucherNumber = voucherResponse.getVouchers().get(0).getVoucherNumber(); - }else{ - voucherNumber = ", " + voucherNumber; - } -// receiptService.updateReceipt(recRequest, voucherResponse); - } - } - instrumentService.createInstrument(recRequest, voucherResponse, finSerMdms, COLLECTION_VERSION); - description = String.format("Voucher created successfully with VoucherNumber : %1$s", voucherNumber); - status = ProcessStatus.SUCCESS; - this.getBackupToDB(payRequest,status,description,voucherNumber); - }else if (topic.equals(manager.getCancelPaymentTopicName()) && payRequest.getPayment().getPaymentStatus().equals(PaymentStatusEnum.CANCELLED)) { - String paymentId = payRequest.getPayment().getId(); - VoucherResponse voucherByServiceAndRefDoc = voucherService.getVoucherByServiceAndRefDoc(recRequest.getRequestInfo(), receipt.getTenantId(), null, paymentId); - if(!voucherByServiceAndRefDoc.getVouchers().isEmpty()){ - Set voucherNumbers = voucherByServiceAndRefDoc.getVouchers().stream().map(Voucher::getVoucherNumber).collect(Collectors.toSet()); - if(voucherByServiceAndRefDoc.getVouchers().stream().map(Voucher::getStatus).anyMatch(stat -> Integer.parseInt(stat.getCode())!=4)){ - voucherService.cancelReceiptVoucher(recRequest, this.getTenantId(recRequest), voucherNumbers); - instrumentService.cancelInstrumentForPayment(payRequest, finSerMdms); - description = String.format("Voucher number : %1$s is CANCELLED successfully for Payment id: %2$s", voucherNumbers, paymentId); - this.getBackupToDB(payRequest, ProcessStatus.SUCCESS, description, voucherNumbers.toString()); - }else{ - String format = String.format("One/All of the Vouchers(%1$s) associated with Payment id %2$s is/are already in Cancelled state.",voucherNumbers,paymentId); - throw new VoucherCustomException(ProcessStatus.FAILED, format); - } - }else{ - throw new VoucherCustomException(ProcessStatus.FAILED, String.format("Vouchers is not exist for Payment id: %1$s", paymentId)); - } - } else if (topic.equals(manager.getCancelPaymentTopicName()) - && payRequest.getPayment().getPaymentStatus().equals(PaymentStatusEnum.DISHONOURED)) { - LOGGER.info("Payment dishonoured successfully."); - } - } - }catch(VoucherCustomException e){ - this.getBackupToDB(recRequest,e.getStatus(),e.getMessage(),voucherNumber); - LOGGER.error(e.getMessage()); - }catch (Exception e) { - this.getBackupToDB(recRequest,ProcessStatus.FAILED,e.getMessage(),voucherNumber); - LOGGER.error(e.getMessage()); - } - } - - private String getTenantId(ReceiptReq recRequest) { - return recRequest.getReceipt().get(0).getTenantId(); - } - - /** - * function use to take a backup to DB after success/failure of voucher creation process. - */ - private void getBackupToDB(Object request,ProcessStatus status, String description, String voucherNumber){ - try { - VoucherIntegrationLog voucherIntegrationLog = new VoucherIntegrationLog(); - voucherIntegrationLog.setStatus(status.name()); - voucherIntegrationLog.setDescription(description); - this.prepareVoucherIntegrationLog(voucherIntegrationLog, request, voucherNumber); - voucherIntegartionLogRepository.saveVoucherIntegrationLog(voucherIntegrationLog); - LOGGER.debug(String.format("[Status : %1$s, message : %2$s]",status,description)); - } catch (Exception e) { - LOGGER.error("ERROR occurred while doing a backup to databases. "+e.getMessage()); - } - } - - private void prepareVoucherIntegrationLog(VoucherIntegrationLog voucherIntegrationLog, Object request, String voucherNumber){ - if(request instanceof PaymentRequest){ - PaymentRequest payReq = (PaymentRequest)request; - Set voucherNumbers = payReq.getPayment().getPaymentDetails().stream().map(PaymentDetail::getReceiptNumber).collect(Collectors.toSet()); - voucherIntegrationLog.setReferenceNumber(voucherNumbers.toString()); - voucherIntegrationLog.setTenantId(payReq.getPayment().getTenantId()); - }else{ - ReceiptReq request1 = (ReceiptReq)request; - voucherIntegrationLog.setReferenceNumber(request1.getReceipt().get(0).getBill().get(0).getBillDetails().get(0).getReceiptNumber()); - voucherIntegrationLog.setTenantId(request1.getReceipt().get(0).getTenantId()); - } - ObjectMapper mappper = new ObjectMapper(); - try { - String jsonReq = mappper.writeValueAsString(request); - voucherIntegrationLog.setRequestJson(jsonReq); - } catch (JsonProcessingException e) { - LOGGER.error("ERROR occurred while parsing the ReceiptRequest "+e.getMessage()); - } - voucherIntegrationLog.setVoucherNumber(voucherNumber); - voucherIntegrationLog.setType(RECEIPT_TYPE); - voucherIntegrationLog.setCreatedDate(new Date()); - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/InstrumentService.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/InstrumentService.java deleted file mode 100644 index 44b71ac8f65..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/InstrumentService.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.service; - -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; - -import org.egov.mdms.service.MicroServiceUtil; -import org.egov.receipt.consumer.model.AccountDetail; -import org.egov.receipt.consumer.model.FinanceMdmsModel; -import org.egov.receipt.consumer.model.FinancialStatus; -import org.egov.receipt.consumer.model.Instrument; -import org.egov.receipt.consumer.model.InstrumentContract; -import org.egov.receipt.consumer.model.InstrumentRequest; -import org.egov.receipt.consumer.model.InstrumentResponse; -import org.egov.receipt.consumer.model.InstrumentSearchContract; -import org.egov.receipt.consumer.model.InstrumentVoucherContract; -import org.egov.receipt.consumer.model.ProcessStatus; -import org.egov.receipt.consumer.model.Receipt; -import org.egov.receipt.consumer.model.ReceiptReq; -import org.egov.receipt.consumer.model.RequestInfo; -import org.egov.receipt.consumer.model.Voucher; -import org.egov.receipt.consumer.model.VoucherResponse; -import org.egov.receipt.consumer.model.VoucherSearchCriteria; -import org.egov.receipt.consumer.repository.ServiceRequestRepository; -import org.egov.receipt.consumer.v2.model.PaymentRequest; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.egov.reciept.consumer.config.PropertiesManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; - - -@Service -public class InstrumentService { - - public static final Logger LOGGER = LoggerFactory.getLogger(InstrumentService.class); - - private static final String FINANCE_STATUS_NEW = "New"; - - private static final String FINANCE_STATUS_CANCELLED = "Cancelled"; - - final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy"); - - @Autowired - private PropertiesManager propertiesManager; - - @Autowired - private ServiceRequestRepository serviceRequestRepository; - - @Autowired - private ObjectMapper mapper; - - @Autowired - private MicroServiceUtil microServiceUtil; - - @Autowired - private VoucherService voucherService; - - /** - * - * @param receiptRequest - * @param voucherResponse - * @return - * Function is used to create the instrument for created voucher. - * @throws VoucherCustomException - */ - public InstrumentResponse createInstrument(ReceiptReq receiptRequest, VoucherResponse voucherResponse, FinanceMdmsModel finSerMdms, String collectionVersion) throws VoucherCustomException { - - Receipt receipt = receiptRequest.getReceipt().get(0); - - FinancialStatus status = microServiceUtil.getFinancialStatusByCode(receipt.getTenantId(), receiptRequest.getRequestInfo(), finSerMdms, FINANCE_STATUS_NEW); - Instrument instrument = receipt.getInstrument(); - String receiptNumber = collectionVersion != null && collectionVersion.equalsIgnoreCase("V2") ? instrument.getPaymentId() : receipt.getBill().get(0).getBillDetails().get(0).getReceiptNumber(); - InstrumentContract instrumentContract = instrument.toContract(); - instrumentContract.setFinancialStatus(status); - if (voucherResponse != null) { - prepareInstrumentVoucher(instrumentContract, voucherResponse, receiptNumber); - } - StringBuilder url = new StringBuilder(propertiesManager.getInstrumentHostUrl() + propertiesManager.getInstrumentCreate()); - InstrumentRequest request = new InstrumentRequest(); - request.setInstruments(Collections.singletonList(instrumentContract)); - request.setRequestInfo(receiptRequest.getRequestInfo()); - LOGGER.info("request : {}, Instrument : {}", request, instrumentContract); - LOGGER.info("InstrumentType : {}", instrumentContract.getInstrumentType().getName()); - return mapper.convertValue(serviceRequestRepository.fetchResult(url, request, receipt.getTenantId()), InstrumentResponse.class); - - } - - private void prepareInstrumentVoucher(InstrumentContract instrumentContract, VoucherResponse voucherResponse, - String receiptNumber) { - - voucherResponse.getVouchers().stream().forEach(voucher -> { - InstrumentVoucherContract ivContract = new InstrumentVoucherContract(); - ivContract.setReceiptHeaderId(receiptNumber); - ivContract.setVoucherHeaderId(voucher.getVoucherNumber()); - instrumentContract.getInstrumentVouchers().add(ivContract); - }); - } - - /** - * - * @param receipt - * Function is used to cancel the instruments - * @throws VoucherCustomException - */ - public void cancelInstrument(ReceiptReq receiptReq, FinanceMdmsModel finSerMdms) throws VoucherCustomException { - RequestInfo requestInfo = receiptReq.getRequestInfo(); - Receipt receipt = receiptReq.getReceipt().get(0); - FinancialStatus status = microServiceUtil.getFinancialStatusByCode(receipt.getTenantId(), requestInfo , finSerMdms, FINANCE_STATUS_CANCELLED); - Instrument instrument = receipt.getInstrument(); - InstrumentContract instrumentContract = instrument.toContract(); - if(instrument.getTransactionDateInput() != null){ - instrumentContract.setTransactionDate(new Date(instrument.getTransactionDateInput())); - } - instrumentContract.setFinancialStatus(status); - String voucherNumber = receipt.getBill().get(0).getBillDetails().get(0).getVoucherHeader(); - // prepareInstrumentVoucher(instrumentContract, receipt.getBill().get(0).getBillDetails().get(0).getVoucherHeader(), receipt.getReceiptNumber()); - prepareInstrumentVoucher(instrumentContract, VoucherResponse.builder().vouchers(Collections.singletonList(Voucher.builder().voucherNumber(voucherNumber).build())).build(), receipt.getReceiptNumber()); - StringBuilder url = new StringBuilder(propertiesManager.getInstrumentHostUrl() + propertiesManager.getInstrumentCancel()); - InstrumentRequest request = new InstrumentRequest(); - request.setInstruments(Collections.singletonList(instrumentContract)); - request.setRequestInfo(requestInfo); - mapper.convertValue(serviceRequestRepository.fetchResult(url, request, receipt.getTenantId()), InstrumentResponse.class); - } - - public void cancelInstrumentForPayment(PaymentRequest payRequest, FinanceMdmsModel finSerMdms) throws VoucherCustomException { - - RequestInfo requestInfo = payRequest.getRequestInfo(); - String paymentId = payRequest.getPayment().getId(); - String tenantId = payRequest.getPayment().getTenantId(); - FinancialStatus cancelStatus = microServiceUtil.getFinancialStatusByCode(tenantId, requestInfo , finSerMdms, FINANCE_STATUS_CANCELLED); - FinancialStatus newStatus = microServiceUtil.getFinancialStatusByCode(tenantId, requestInfo , finSerMdms, FINANCE_STATUS_NEW); - List instruments = microServiceUtil.getInstruments(InstrumentSearchContract.builder().receiptIds(paymentId).build(), requestInfo, tenantId); - if(instruments != null && !instruments.isEmpty()){ - InstrumentContract instrumentContract = instruments.get(0); - if(instrumentContract.getFinancialStatus().getCode().equalsIgnoreCase(newStatus.getCode())){ - instrumentContract .setFinancialStatus(cancelStatus); - StringBuilder url = new StringBuilder(propertiesManager.getInstrumentHostUrl() + propertiesManager.getInstrumentCancel()); - InstrumentRequest request = new InstrumentRequest(); - request.setInstruments(Collections.singletonList(instrumentContract)); - request.setRequestInfo(requestInfo); - mapper.convertValue(serviceRequestRepository.fetchResult(url, request, tenantId), InstrumentResponse.class); - }else{ - throw new VoucherCustomException(ProcessStatus.FAILED, String.format("Instrument for Payment : %1$s is already in %2$s state. So we can not process further to cancel the payment.", paymentId, instrumentContract.getFinancialStatus().getCode())); - } - }else{ - throw new VoucherCustomException(ProcessStatus.FAILED, String.format("Instrument for Payment : %1$s is not exist", paymentId)); - } - } - - public void processDishonorIntruments(InstrumentRequest request) throws IllegalArgumentException, VoucherCustomException { - List instruments = request.getInstruments(); - VoucherResponse reversalVoucher = voucherService.processReversalVoucher(instruments, request.getRequestInfo()); - instruments.get(0).getDishonor().setReversalVoucherId(reversalVoucher.getVouchers().get(0).getVoucherNumber()); - this.updateInstruments(instruments, request.getRequestInfo()); - } - - private void updateInstruments(List instruments, RequestInfo requestInfo) throws IllegalArgumentException, VoucherCustomException { - StringBuilder url = new StringBuilder(propertiesManager.getInstrumentHostUrl() + propertiesManager.getInstrumentCancel()); - InstrumentRequest request = new InstrumentRequest(); - request.setInstruments(instruments); - request.setRequestInfo(requestInfo); - mapper.convertValue(serviceRequestRepository.fetchResult(url, request, instruments.get(0).getTenantId()), InstrumentResponse.class); - } - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/InstrumentUpdateConsumer.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/InstrumentUpdateConsumer.java deleted file mode 100644 index b045e4c1152..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/InstrumentUpdateConsumer.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.egov.receipt.consumer.service; - -import java.io.IOException; -import java.util.Map; - -import org.apache.kafka.clients.consumer.ConsumerRecord; -import org.egov.receipt.consumer.model.InstrumentContract; -import org.egov.receipt.consumer.model.InstrumentRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class InstrumentUpdateConsumer { - @Autowired - private ObjectMapper objectMapper; - @Autowired - private InstrumentService instrumentService; - - public static final Logger LOGGER = LoggerFactory.getLogger(InstrumentUpdateConsumer.class); - - @KafkaListener(topics = {"${kafka.topics.egf.instrument.completed.topic}"}) - public void process(ConsumerRecord record){ - Map mastersMap; - try { - mastersMap = objectMapper.readValue(record.value(), Map.class); - if(mastersMap.get("instrument_persisted") != null){ - InstrumentRequest request = objectMapper.convertValue(mastersMap.get("instrument_persisted"), InstrumentRequest.class); - InstrumentContract contract = request.getInstruments().get(0); - if(request.getRequestInfo().getAction().equals("update") && - contract.getFinancialStatus().getCode().equals("Dishonored") && - contract.getDishonor() != null && - contract.getDishonor().getReversalVoucherId() == null){ - LOGGER.error("instrument with id {} is got requested to dishonored", contract.getId()); - instrumentService.processDishonorIntruments(request); - } - } - } catch (Exception e) { - // TODO Auto-generated catch block - LOGGER.error("Exception occurred while listening to record: " + e.getMessage()); - } - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/ReceiptService.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/ReceiptService.java deleted file mode 100644 index 598563ebc7d..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/ReceiptService.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.service; -import org.egov.receipt.consumer.model.Receipt; -import org.egov.receipt.consumer.model.ReceiptReq; -import org.egov.receipt.consumer.model.ReceiptResponse; -import org.egov.receipt.consumer.model.VoucherResponse; -import org.egov.receipt.consumer.repository.ServiceRequestRepository; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.egov.reciept.consumer.config.PropertiesManager; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class ReceiptService { - - @Autowired - private PropertiesManager propertiesManager; - - @Autowired - private ServiceRequestRepository serviceRequestRepository; - - @Autowired - private ObjectMapper mapper; - - /** - * - * @param receiptRequest - * @param voucherResponse - * @return - * Function is used to send the update of receipt with voucher number to collection service. - * @throws VoucherCustomException - * @throws - */ - public ReceiptResponse updateReceipt(ReceiptReq receiptRequest, VoucherResponse voucherResponse) throws VoucherCustomException { - Receipt receipt = receiptRequest.getReceipt().get(0); - StringBuilder url = new StringBuilder(propertiesManager.getCollectionsHostUrl() + propertiesManager.getReceiptsUpdate()); - receipt.getBill().get(0).getBillDetails().get(0) - .setVoucherHeader(voucherResponse.getVouchers().get(0).getVoucherNumber()); - receiptRequest.getRequestInfo().setUserInfo(propertiesManager.getSiUserInfo()); - return mapper.convertValue(serviceRequestRepository.fetchResult(url, receiptRequest, receipt.getTenantId()), ReceiptResponse.class); - } - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/VoucherService.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/VoucherService.java deleted file mode 100644 index f9b02963260..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/VoucherService.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.service; - -import java.io.UnsupportedEncodingException; -import java.util.List; -import java.util.Set; - -import org.egov.receipt.consumer.model.FinanceMdmsModel; -import org.egov.receipt.consumer.model.InstrumentContract; -import org.egov.receipt.consumer.model.Receipt; -import org.egov.receipt.consumer.model.ReceiptReq; -import org.egov.receipt.consumer.model.RequestInfo; -import org.egov.receipt.consumer.model.Voucher; -import org.egov.receipt.consumer.model.VoucherResponse; -import org.egov.receipt.consumer.model.VoucherSearchCriteria; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.egov.tracer.model.CustomException; - -public interface VoucherService { - public VoucherResponse createReceiptVoucher(ReceiptReq req, FinanceMdmsModel finSerMdms, String collectionVersion) throws CustomException; - public VoucherResponse cancelReceiptVoucher(ReceiptReq req, String tenantId, Set voucherNumbers) throws CustomException, VoucherCustomException; - public boolean isVoucherCreationEnabled(Receipt receipt, RequestInfo req, FinanceMdmsModel finSerMdms) throws CustomException; - public boolean isTenantEnabledInFinanceModule(ReceiptReq req, FinanceMdmsModel finSerMdms) throws VoucherCustomException; - VoucherResponse getVoucherByServiceAndRefDoc(RequestInfo requestInfo, String tenantId, String serviceCode, - String referenceDoc) throws VoucherCustomException, UnsupportedEncodingException; - VoucherResponse getVouchers(VoucherSearchCriteria criteria, RequestInfo requestInfo, String tenantId) - throws VoucherCustomException; - VoucherResponse createVoucher(List vouchers, RequestInfo requestInfo, String tenantId) - throws VoucherCustomException; - VoucherResponse processReversalVoucher(List instruments, RequestInfo requestInfo); -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/VoucherServiceImpl.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/VoucherServiceImpl.java deleted file mode 100644 index 400f89d803c..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/service/VoucherServiceImpl.java +++ /dev/null @@ -1,633 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.consumer.service; - -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; -import java.net.URLEncoder; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -import org.egov.mdms.service.MicroServiceUtil; -import org.egov.receipt.consumer.model.AccountDetail; -import org.egov.receipt.consumer.model.AppConfigValues; -import org.egov.receipt.consumer.model.Bill; -import org.egov.receipt.consumer.model.BillAccountDetail; -import org.egov.receipt.consumer.model.BillDetail; -import org.egov.receipt.consumer.model.BusinessService; -import org.egov.receipt.consumer.model.EgModules; -import org.egov.receipt.consumer.model.FinanceMdmsModel; -import org.egov.receipt.consumer.model.Function; -import org.egov.receipt.consumer.model.Functionary; -import org.egov.receipt.consumer.model.Fund; -import org.egov.receipt.consumer.model.InstrumentContract; -import org.egov.receipt.consumer.model.InstrumentVoucherContract; -import org.egov.receipt.consumer.model.ProcessStatus; -import org.egov.receipt.consumer.model.Receipt; -import org.egov.receipt.consumer.model.ReceiptReq; -import org.egov.receipt.consumer.model.RequestInfo; -import org.egov.receipt.consumer.model.Scheme; -import org.egov.receipt.consumer.model.TaxHeadMaster; -import org.egov.receipt.consumer.model.Tenant; -import org.egov.receipt.consumer.model.Voucher; -import org.egov.receipt.consumer.model.VoucherRequest; -import org.egov.receipt.consumer.model.VoucherResponse; -import org.egov.receipt.consumer.model.VoucherSearchCriteria; -import org.egov.receipt.consumer.model.VoucherSearchRequest; -import org.egov.receipt.consumer.repository.ServiceRequestRepository; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.egov.reciept.consumer.config.PropertiesManager; -import org.egov.tracer.model.CustomException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class VoucherServiceImpl implements VoucherService { - - private static final String ADVANCE = "advance"; - @Autowired - private PropertiesManager propertiesManager; - @Autowired - private MicroServiceUtil microServiceUtil; - @Autowired - private ServiceRequestRepository serviceRequestRepository; - @Autowired - private ObjectMapper mapper; - - final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd/MM/yyyy"); - final SimpleDateFormat ddMMMyyyyFormatter = new SimpleDateFormat("dd-MMM-yyyy"); - - private static final String RECEIPTS_VOUCHER_TYPE = "Receipt"; - private static final String COLLECTIONS_EG_MODULES_ID = "10"; - private static final Logger LOGGER = LoggerFactory.getLogger(VoucherServiceImpl.class); - private static final String COLLECTION_MODULE_NAME = "Collections"; - private LinkedHashMap amountMapwithGlcode; - private static final String REVERSAL_VOUCHER_NAME = "JVGeneral"; - private static final String REVERSAL_VOUCHER_TYPE = "Journal Voucher"; - - @Override - /** - * This method is use to create the voucher specifically for receipt - * request. - */ - public VoucherResponse createReceiptVoucher(ReceiptReq receiptRequest, FinanceMdmsModel finSerMdms, String collectionVersion) - throws CustomException { - Receipt receipt = receiptRequest.getReceipt().get(0); - String tenantId = receipt.getTenantId(); -// final StringBuilder voucher_create_url = new StringBuilder(propertiesManager.getErpURLBytenantId(tenantId) -// + propertiesManager.getVoucherCreateUrl()); -// VoucherRequest voucherRequest = new VoucherRequest(); - Voucher voucher = new Voucher(); - voucher.setTenantId(tenantId); - try { - this.setVoucherDetails(voucher, receipt, tenantId, receiptRequest.getRequestInfo(), finSerMdms, collectionVersion); - } catch (Exception e) { - throw new CustomException(e.toString(),e.toString()); - } -// voucherRequest.setVouchers(Collections.singletonList(voucher)); -// voucherRequest.setRequestInfo(receiptRequest.getRequestInfo()); -// voucherRequest.setTenantId(tenantId); - try { - return createVoucher(Collections.singletonList(voucher), receiptRequest.getRequestInfo(), tenantId); - } catch (VoucherCustomException e) { - throw new CustomException(e.toString(),e.toString()); - } -// return mapper.convertValue(serviceRequestRepository.fetchResult(voucher_create_url, voucherRequest, tenantId), VoucherResponse.class); - } - - @Override - public VoucherResponse createVoucher(List vouchers, RequestInfo requestInfo, String tenantId) throws VoucherCustomException{ - final StringBuilder voucher_create_url = new StringBuilder(propertiesManager.getErpURLBytenantId(tenantId) - + propertiesManager.getVoucherCreateUrl()); - VoucherRequest voucherRequest = new VoucherRequest(); - voucherRequest.setVouchers(vouchers); - voucherRequest.setRequestInfo(requestInfo); - voucherRequest.setTenantId(tenantId); - return mapper.convertValue(serviceRequestRepository.fetchResult(voucher_create_url, voucherRequest, tenantId), VoucherResponse.class); - } - - /** - * Function which is used to check whether the voucher creation is set to - * true or false in business mapping file. - */ - @Override - public boolean isVoucherCreationEnabled(Receipt receipt, RequestInfo req, FinanceMdmsModel finSerMdms) throws CustomException { -// Receipt receipt = req.getReceipt().get(0); - String tenantId = receipt.getTenantId(); - Bill bill = receipt.getBill().get(0); - String bsCode = bill.getBillDetails().get(0).getBusinessService(); - List serviceByCode = null; - try { - serviceByCode = this.getBusinessServiceByCode(tenantId, bsCode, req, finSerMdms); - } catch (Exception e) { - throw new CustomException(e.toString(),e.toString()); - } - return serviceByCode != null && !serviceByCode.isEmpty() ? serviceByCode.get(0).isVoucherCreationEnabled() - : false; - } - - /** - * Function is for cancelling the voucher based on voucher number - */ - @Override - public VoucherResponse cancelReceiptVoucher(ReceiptReq receiptRequest, String tenantId, Set voucherNumbers) throws VoucherCustomException { - final StringBuilder voucher_cancel_url = new StringBuilder(propertiesManager.getErpURLBytenantId(tenantId) - + propertiesManager.getVoucherCancelUrl()); - try { - VoucherSearchRequest vSearchReq = this.getVoucherSearchReq(receiptRequest, voucherNumbers, tenantId); - return mapper.convertValue(serviceRequestRepository.fetchResult(voucher_cancel_url, vSearchReq, tenantId), VoucherResponse.class); - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED, "Failed to cancel voucher"); - } - } - - /** - * - * @param receiptRequest - * @return This function is use to set the voucher search params and return - * the setted request - */ - private VoucherSearchRequest getVoucherSearchReq(ReceiptReq receiptRequest, Set voucherNumbers, String tenantId) { - VoucherSearchRequest vSearchReq = new VoucherSearchRequest(); - StringBuilder vouNumberBuilder = new StringBuilder(); - voucherNumbers.stream().forEach(vn -> vouNumberBuilder.append(vn).append(",")); - vSearchReq.setVoucherNumbers(vouNumberBuilder.toString()); - vSearchReq.setTenantId(tenantId); - RequestInfo requestInfo = receiptRequest.getRequestInfo(); -// requestInfo.setAuthToken(propertiesManager.getSiAuthToken()); - vSearchReq.setRequestInfo(requestInfo); - return vSearchReq; - } - - /** - * - * @param voucher - * @param receipt - * @param tenantId - * @throws Exception - * Function is use to set the specific details of voucher which - * is mendatory to create the voucher. - */ - private void setVoucherDetails(Voucher voucher, Receipt receipt, String tenantId, RequestInfo requestInfo, - FinanceMdmsModel finSerMdms, String collectiobVersion) throws CustomException, VoucherCustomException { - BillDetail billDetail = receipt.getBill().get(0).getBillDetails().get(0); - String receiptNumber = null; - String consumerCode = null; - if (collectiobVersion != null && collectiobVersion.equalsIgnoreCase("V2")) { - receiptNumber = receipt.getPaymentId(); - consumerCode = receipt.getConsumerCode(); - } else { - receiptNumber = billDetail.getReceiptNumber(); - consumerCode= billDetail.getConsumerCode(); - } - String bsCode = billDetail.getBusinessService(); - List serviceByCode = this.getBusinessServiceByCode(tenantId, bsCode, requestInfo, finSerMdms); - List taxHeadMasterByBusinessServiceCode = this.getTaxHeadMasterByBusinessServiceCode(tenantId, - bsCode, requestInfo, finSerMdms); - BusinessService businessService = serviceByCode.get(0); - String businessServiceName = microServiceUtil.getBusinessServiceName(tenantId, bsCode, requestInfo, finSerMdms); - voucher.setName(businessServiceName); - voucher.setType(RECEIPTS_VOUCHER_TYPE); - voucher.setFund(new Fund()); - voucher.getFund().setCode(businessService.getFund()); - voucher.setFunction(new Function()); - voucher.getFunction().setCode(businessService.getFunction()); - voucher.setDepartment(businessService.getDepartment()); - voucher.setFunctionary(new Functionary()); - voucher.setServiceName(bsCode); - voucher.setReferenceDocument(receiptNumber); - String functionaryCode = businessService.getFunctionary() != null - & !StringUtils.isEmpty(businessService.getFunctionary()) ? businessService.getFunctionary() : null; - voucher.getFunctionary().setCode(functionaryCode); - voucher.setScheme(new Scheme()); - String schemeCode = businessService.getScheme() != null & !StringUtils.isEmpty(businessService.getScheme()) - ? businessService.getScheme() : null; - voucher.getScheme().setCode(schemeCode); - voucher.setDescription(businessServiceName + " Receipt"); - // checking Whether manualReceipt date will be consider as - // voucherdate - if (billDetail.getManualReceiptDate() != null && billDetail.getManualReceiptDate().longValue() != 0 - && isManualReceiptDateEnabled(tenantId, requestInfo)) { - voucher.setVoucherDate(dateFormatter.format(new Date(billDetail.getManualReceiptDate()))); - } else { - voucher.setVoucherDate(dateFormatter.format(new Date(billDetail.getReceiptDate()))); - } - EgModules egModules = this.getModuleIdByModuleName(COLLECTION_MODULE_NAME, tenantId, requestInfo); - voucher.setModuleId(Long.valueOf(egModules != null ? egModules.getId().toString() : COLLECTIONS_EG_MODULES_ID)); - - voucher.setSource( - propertiesManager.getReceiptViewSourceUrl() + "?selectedReceipts=" + receiptNumber + "&serviceTypeId=" + bsCode); - - voucher.setLedgers(new ArrayList<>()); - final String serviceAttribute = getServiceAttributeByBusinessService(tenantId, requestInfo, businessService, consumerCode); - LOGGER.info("Service Attribute ::: {}", serviceAttribute); - amountMapwithGlcode = new LinkedHashMap<>(); - // Setting glcode and amount in Map as key value pair. - for (BillAccountDetail bad : billDetail.getBillAccountDetails()) { - BigDecimal adjustedAmount = bad.getAdjustedAmount(); - if (bad.getTaxHeadCode().toLowerCase().contains(ADVANCE)) - adjustedAmount = bad.getAmount().abs(); - if (bad.getTaxHeadCode().toLowerCase().contains(ADVANCE) - || adjustedAmount.compareTo(new BigDecimal(0)) != 0) { - String taxHeadCode = bad.getTaxHeadCode(); - List findFirst = taxHeadMasterByBusinessServiceCode.stream() - .filter(tx -> serviceAttribute != null - && businessService.getServiceAttributeTaxHead().equals(taxHeadCode) - ? tx.getTaxhead().equals(taxHeadCode) - && serviceAttribute.equals(tx.getServiceAttribute()) - : tx.getTaxhead().equals(taxHeadCode)) - .collect(Collectors.toList()); - if (findFirst != null && findFirst.isEmpty()) { - StringBuilder exception = new StringBuilder("Taxhead code ").append(taxHeadCode) - .append(" is not mapped with BusinessServiceCode ").append(bsCode); - if (serviceAttribute != null) - exception.append("and Service Attribute ").append(serviceAttribute); - throw new VoucherCustomException(ProcessStatus.FAILED, exception.toString()); - } - String glcode = findFirst.get(0).getGlcode(); - if (amountMapwithGlcode.get(glcode) != null) { - amountMapwithGlcode.put(glcode, amountMapwithGlcode.get(glcode).add(adjustedAmount)); - } else { - amountMapwithGlcode.put(glcode, adjustedAmount); - } - } - } - - this.setNetReceiptAmount(receipt, requestInfo, tenantId, bsCode, finSerMdms); - LOGGER.debug("amountMapwithGlcode ::: {}", amountMapwithGlcode); - // Iterating map and setting the ledger details to voucher. - if(amountMapwithGlcode.isEmpty()){ - throw new VoucherCustomException(ProcessStatus.NA, "This receipt does not require voucher creation."); - } - amountMapwithGlcode.entrySet().stream().forEach(entry -> { - AccountDetail accountDetail = new AccountDetail(); - accountDetail.setGlcode(entry.getKey()); - if (entry.getValue().compareTo(new BigDecimal(0)) == 1) { - accountDetail.setCreditAmount(entry.getValue().doubleValue()); - accountDetail.setDebitAmount(0d); - } else { - accountDetail.setDebitAmount(-entry.getValue().doubleValue()); - accountDetail.setCreditAmount(0d); - } - accountDetail.setFunction(new Function()); - accountDetail.getFunction().setCode(businessService.getFunction()); - voucher.getLedgers().add(accountDetail); - }); - } - - private String getServiceAttributeByBusinessService(String tenantId, RequestInfo requestInfo, - BusinessService businessService, String consumerCode) throws VoucherCustomException { - if (businessService.isServiceAttributeMappingEnabled()) { - try { - final List list = Arrays.asList(consumerCode.split(":")); - String formattedUrl = null; - if (list.size() > 1) - formattedUrl = String.format(businessService.getServiceAttributeUrl(), tenantId, list.get(0), - list.get(1)); - else - formattedUrl = String.format(businessService.getServiceAttributeUrl(), tenantId, list.get(0)); - - final StringBuilder businessServiceUrl = new StringBuilder( - propertiesManager.getBusinessServiceHostUrl()).append(formattedUrl); - VoucherRequest request = new VoucherRequest(); - request.setRequestInfo(requestInfo); - request.setTenantId(tenantId); - LOGGER.info("Business service :: {}, Consumercode :: {}", businessService, consumerCode); - Map apiResponse = (Map) serviceRequestRepository.fetchResult(businessServiceUrl, request, - tenantId); - LOGGER.info("Business service api response :: {}", apiResponse); - Map responseSource = apiResponse; - Object response = null; - for (String str : Arrays.asList(businessService.getServiceAttributeKey().split("\\."))) { - if (str.contains("~")) - response = getResponse(responseSource, str); - else - response = responseSource.get(str); - if (response instanceof Collection) { - response = ((ArrayList) response).get(0); - responseSource = (Map) response; - } - } - return (String) response; - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED, "Failed to fetch service attribute: " + e.getMessage()); - } - } - return null; - } - - private Object getResponse(Map responseSource, String str) { - Object response; - StringBuilder res = new StringBuilder(); - for (String key : Arrays.asList(str.split("~"))) { - if (responseSource.get(key) != null) { - res.append(responseSource.get(key)).append("."); - } - } - response = res.length() != 0 ? res.deleteCharAt(res.length() - 1).toString() : null; - return response; - } - - /** - * - * @param tenantId - * @return Function is used to check the config value for manual receipt - * date consideration. - * @throws VoucherCustomException - */ - private boolean isManualReceiptDateEnabled(String tenantId, RequestInfo requestInfo) throws VoucherCustomException { -// requestInfo.setAuthToken(propertiesManager.getSiAuthToken()); - VoucherRequest request = new VoucherRequest(tenantId, requestInfo, null); - StringBuilder url = new StringBuilder(propertiesManager.getErpURLBytenantId(tenantId) - + propertiesManager.getManualReceiptDateConfigUrl()); - AppConfigValues convertValue = null; - try { - convertValue = mapper.convertValue(serviceRequestRepository.fetchResult(url, request, tenantId), AppConfigValues.class); - } catch (Exception e) { - if (LOGGER.isErrorEnabled()) - LOGGER.error( - "ERROR while checking the consideration of manual receipt date. So the receipt date will be consider as the voucher date"); - } - return convertValue != null ? convertValue.getValue().equalsIgnoreCase("Yes") : false; - } - - /** - * - * @param receipt - * @param tenantId - * @param businessCode - * @param finSerMdms - * @throws VoucherCustomException - * Function is used to set the paid amount as debit in finance - * system. - */ - private void setNetReceiptAmount(Receipt receipt, RequestInfo requestInfo, String tenantId, String businessCode, FinanceMdmsModel finSerMdms) - throws VoucherCustomException { - BigDecimal amountPaid = receipt.getBill().get(0).getBillDetails().get(0).getAmountPaid(); - if (amountPaid != null && amountPaid.compareTo(new BigDecimal(0)) != 0) { - String instrumentType = receipt.getInstrument().getInstrumentType().getName();; - String glcode = microServiceUtil.getGlcodeByInstrumentType(tenantId, businessCode, requestInfo, finSerMdms, instrumentType); - if(glcode == null){ - throw new VoucherCustomException(ProcessStatus.FAILED, "Account code mapping is missing for Instrument Type " + instrumentType); - } - amountMapwithGlcode.put(glcode, new BigDecimal(-amountPaid.doubleValue())); - } - } - - /** - * - * @param tenantId - * @param bsCode - * @return - * @throws Exception - * Function is used to get the Business Services based on - * business service code which is mapped in json file - */ - private List getBusinessServiceByCode(String tenantId, String bsCode, RequestInfo requestInfo, - FinanceMdmsModel finSerMdms) throws CustomException, VoucherCustomException { - List businessServices = null; - try { - businessServices = microServiceUtil.getBusinessService(tenantId, bsCode, - requestInfo, finSerMdms); - } catch (VoucherCustomException e) { - throw new CustomException(e.toString(),e.toString()); - } - if (businessServices.isEmpty()) { - throw new VoucherCustomException(ProcessStatus.FAILED, "Business service is not mapped with business code : " + bsCode); - } - List collect = businessServices.stream().filter(bs -> bs.getCode().equals(bsCode)) - .collect(Collectors.toList()); - return collect; - } - - /** - * - * @param tenantId - * @param bsCode - * @return - * @throws Exception - * Function is used to get the TaxHeadMaster data which is - * mapped to business service code - */ - private List getTaxHeadMasterByBusinessServiceCode(String tenantId, String bsCode, - RequestInfo requestInfo, FinanceMdmsModel finSerMdms) throws CustomException { - List taxHeadMasters = null; - try { - taxHeadMasters = microServiceUtil.getTaxHeadMasters(tenantId, bsCode, requestInfo, - finSerMdms); - } catch (VoucherCustomException e) { - throw new CustomException(e.toString(),e.toString()); - } - return taxHeadMasters; - } - - /** - * - * @param moduleName - * @param tenantId - * @return Function is used to return the module id which is configure in - * erp setup based on module name - * @throws VoucherCustomException - */ - private EgModules getModuleIdByModuleName(String moduleName, String tenantId, RequestInfo requestInfo) throws VoucherCustomException { -// requestInfo.setAuthToken(propertiesManager.getSiAuthToken()); - VoucherRequest request = new VoucherRequest(tenantId, requestInfo, null); - StringBuilder url = new StringBuilder(propertiesManager.getErpURLBytenantId(tenantId) - + propertiesManager.getModuleIdSearchUrl() + "?moduleName=" + moduleName); - try { - return mapper.convertValue(serviceRequestRepository.fetchResult(url, request, tenantId), EgModules.class); - } catch (Exception e) { - LOGGER.error("ERROR while checking the module id for module name {}, default value 10 is considered.", - moduleName); - } - return null; - } - - /** - * (non-Javadoc) - * @see org.egov.receipt.consumer.service.VoucherService#isTenantEnabledInFinanceModule(org.egov.receipt.consumer.model.ReceiptReq, org.egov.receipt.consumer.model.FinanceMdmsModel) - * Method which is used to check whether Tenant is enabled in Finance module or not. - */ - @Override - public boolean isTenantEnabledInFinanceModule(ReceiptReq req, FinanceMdmsModel finSerMdms) throws VoucherCustomException{ - Receipt receipt = req.getReceipt().get(0); - String tenantId = receipt.getTenantId(); - Bill bill = receipt.getBill().get(0); - String bsCode = req.getReceipt().stream().map(Receipt::getBill).flatMap(List::stream) - .map(Bill::getBusinessService).filter(Objects::nonNull).collect(Collectors.joining(",")); - bsCode = bsCode != null && !bsCode.isEmpty() ? bsCode : bill.getBillDetails().get(0).getBusinessService(); - List tenantList = microServiceUtil.getFinanceTenantList(tenantId, bsCode, req.getRequestInfo(), finSerMdms); - List collect = tenantList.stream().filter(tenant -> tenant.getCode().equals(tenantId)).collect(Collectors.toList()); - if(collect.isEmpty()){ - throw new VoucherCustomException(ProcessStatus.NA, "TenantId "+tenantId+" is not enabled in Finance module."); - } - return true; - } - /** - * (non-Javadoc) - * @see org.egov.receipt.consumer.service.VoucherService#getVoucherByServiceAndRefDoc(org.egov.receipt.consumer.model.RequestInfo, java.lang.String, java.lang.String, java.lang.String) - * Method which is used to fetch the voucher details associated with business service and reference documents. - */ - @Override - public VoucherResponse getVoucherByServiceAndRefDoc(RequestInfo requestInfo, String tenantId, String serviceCode, String referenceDoc) throws VoucherCustomException, UnsupportedEncodingException{ -// requestInfo.setAuthToken(propertiesManager.getSiAuthToken()); - VoucherRequest request = new VoucherRequest(tenantId, requestInfo, null); - StringBuilder url = new StringBuilder(propertiesManager.getErpURLBytenantId(tenantId)) - .append(propertiesManager.getVoucherSearchByRefUrl()).append("?"); - if(serviceCode != null && !serviceCode.isEmpty()){ - url.append("servicecode=").append(serviceCode); - } - if(referenceDoc != null & !referenceDoc.isEmpty()){ - url.append("&referencedocument=").append(URLEncoder.encode(referenceDoc,"UTF-8")); - } - - try { - return mapper.convertValue(serviceRequestRepository.fetchResult(url, request, tenantId), VoucherResponse.class); - } catch (Exception e) { - LOGGER.error("ERROR while fetching the voucher based on Service and Reference document"); - } - return null; - } - - @Override - public VoucherResponse getVouchers(VoucherSearchCriteria criteria, RequestInfo requestInfo, String tenantId) throws VoucherCustomException{ - VoucherSearchRequest request = new VoucherSearchRequest(); - request.setRequestInfo(requestInfo); - request.setTenantId(tenantId); - criteria.setTenantId(tenantId); - StringBuilder url = new StringBuilder(propertiesManager.getErpURLBytenantId(tenantId)).append(propertiesManager.getVoucherSearchUrl()).append("?"); - prepareQueryString(url, criteria); - try { - return mapper.convertValue(serviceRequestRepository.fetchResult(url, request, tenantId), VoucherResponse.class); - } catch (Exception e) { - LOGGER.error("ERROR while fetching the voucher based on Service and Reference document"); - } - return null; - } - - @Override - public VoucherResponse processReversalVoucher(List instruments, RequestInfo requestInfo) { - Set receiptVoucherNumbers = instruments.stream().map(InstrumentContract::getInstrumentVouchers).flatMap(x -> x.stream()).map(InstrumentVoucherContract::getVoucherHeaderId).collect(Collectors.toSet()); - Set payInSlipIds = instruments.stream().map(InstrumentContract::getPayinSlipId).map(Long::parseLong).collect(Collectors.toSet()); - String tenantId = instruments.get(0).getTenantId(); - VoucherResponse reversalVoucherResponse = null; - try { - Long dishonorDate = instruments.get(0).getDishonor().getDishonorDate(); - VoucherResponse rvResponse = this.getVouchers(new VoucherSearchCriteria().builder().voucherNumbers(receiptVoucherNumbers).build(), requestInfo , tenantId ); - VoucherResponse pisResponse = this.getVouchers(new VoucherSearchCriteria().builder().ids(payInSlipIds).build(), requestInfo , tenantId ); - if(!rvResponse.getVouchers().isEmpty() && !pisResponse.getVouchers().isEmpty()){ - Voucher reversalVoucher = rvResponse.getVouchers().get(0); - Map rvGlcodeMap = rvResponse.getVouchers().get(0).getLedgers().stream().collect(Collectors.toMap(AccountDetail::getGlcode, java.util.function.Function.identity())); - Map pisGlCodeMap = pisResponse.getVouchers().get(0).getLedgers().stream().collect(Collectors.toMap(AccountDetail::getGlcode, java.util.function.Function.identity())); - List ledgerForReversalVoucher = this.prepareLedgerForReversalVoucher(rvGlcodeMap, pisGlCodeMap); - reversalVoucher.setLedgers(ledgerForReversalVoucher); - this.prepareVoucherDetailsForReversalVoucher(reversalVoucher, dishonorDate); - reversalVoucherResponse = this.createVoucher(Collections.singletonList(reversalVoucher), requestInfo, tenantId); - LOGGER.error("reversalVoucherResponse :: {}", reversalVoucherResponse.getVouchers()); - } - - } catch (VoucherCustomException e) { - e.printStackTrace(); - } - return reversalVoucherResponse; - } - - private void prepareQueryString(StringBuilder url, VoucherSearchCriteria criteria) { - if (criteria.getTenantId() != null && !criteria.getTenantId().isEmpty()) { - url.append("tenantId=").append(criteria.getTenantId()); - } - if (criteria.getIds() != null && !criteria.getIds().isEmpty()) { - String collect = criteria.getIds().stream().map(id -> id.toString()).collect(Collectors.joining(", ")); - url.append("&ids=").append(collect); - } - if (criteria.getVoucherNumbers() != null && !criteria.getVoucherNumbers().isEmpty()) { - url.append("&voucherNumbers=").append(String.join(", ", criteria.getVoucherNumbers())); - } - } - - private List prepareLedgerForReversalVoucher(Map rvGlcodeMap, - Map pisGlCodeMap) { - Double drMaountToBank = new Double(0); - Double crMaountToBank = new Double(0); - for(String pis : pisGlCodeMap.keySet()){ - if(rvGlcodeMap.get(pis) != null){ - drMaountToBank = rvGlcodeMap.get(pis).getDebitAmount(); - crMaountToBank = rvGlcodeMap.get(pis).getCreditAmount(); - rvGlcodeMap.remove(pis); - }else{ - AccountDetail value = pisGlCodeMap.get(pis); - value.setCreditAmount(crMaountToBank); - value.setDebitAmount(drMaountToBank); - rvGlcodeMap.put(pis, value); - } - } - rvGlcodeMap.values().stream().forEach(ad -> { - Double creditAmount = ad.getCreditAmount(); - Double debitAmount = ad.getDebitAmount(); - ad.setCreditAmount(debitAmount); - ad.setDebitAmount(creditAmount); - }); - - return rvGlcodeMap.values().stream().collect(Collectors.toList()); - } - - private void prepareVoucherDetailsForReversalVoucher(Voucher reversalVoucher, Long dishonorDate) { - reversalVoucher.setName(REVERSAL_VOUCHER_NAME); - reversalVoucher.setType(REVERSAL_VOUCHER_TYPE); - reversalVoucher.setVoucherNumber(""); - reversalVoucher.setVoucherDate(dateFormatter.format(new Date(dishonorDate))); - reversalVoucher.setReferenceDocument(null); - reversalVoucher.setServiceName(null); - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/util/PaymentUtils.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/util/PaymentUtils.java deleted file mode 100644 index d14d4e1772c..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/util/PaymentUtils.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.util; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import org.egov.receipt.consumer.model.BankContract; -import org.egov.receipt.consumer.model.BankDetails; -import org.egov.receipt.consumer.model.Bill; -import org.egov.receipt.consumer.model.BillAccountDetail; -import org.egov.receipt.consumer.model.BillDetail; -import org.egov.receipt.consumer.model.Instrument; -import org.egov.receipt.consumer.model.InstrumentType; -import org.egov.receipt.consumer.model.Receipt; -import org.egov.receipt.consumer.model.TransactionType; -import org.egov.receipt.consumer.repository.ServiceRequestRepository; -import org.egov.receipt.consumer.v2.model.BillDetailV2; -import org.egov.receipt.consumer.v2.model.BillV2; -import org.egov.receipt.consumer.v2.model.Payment; -import org.egov.receipt.consumer.v2.model.PaymentDetail; -import org.egov.receipt.consumer.v2.model.PaymentModeEnum; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.databind.ObjectMapper; - -@Service -public class PaymentUtils { - - private static final String HTTPS_IFSC_RAZORPAY_URL = "https://ifsc.razorpay.com/"; - - @Autowired - private ServiceRequestRepository serviceRequestRepository; - - @Autowired - private ObjectMapper mapper; - /** - * - * @param payments - * @param receipts - * @throws VoucherCustomException - * Method which is used to transform the Payment payload to Receipt payload for collection version-2 - */ - public void getReceiptsFromPayments(List payments, List receipts) throws VoucherCustomException { - // prepare instrument from payment - // prepare receipt from each paymentdetails - for(Payment payment:payments){ - Instrument instrument = new Instrument(); - this.prepareInstrument(payment, instrument); - payment.getPaymentDetails().stream().forEach(paymentDetail -> { - Receipt receipt = new Receipt(); - receipt.setInstrument(instrument); - this.prepareReceipt(payment, paymentDetail, receipt); - receipts.add(receipt); - }); - - } - // Aggregation of receipt based on Business service - this.aggregateReceiptBasedOnService(receipts); - } -/** - * - * @param receipts - * Method which is used to aggregate the paymentdetils based on the service. it will consolidate the billaccount_details in a single receipt based on business service - */ - private void aggregateReceiptBasedOnService(List receipts) { - Map> businessRecptMap = new HashMap<>(); - receipts.stream().forEach(recpt -> { - recpt.getBill().stream().forEach(bill -> { - if(businessRecptMap.containsKey(bill.getBusinessService())){ - businessRecptMap.get(bill.getBusinessService()).add(recpt); - }else{ - List list = new ArrayList<>(); - list.add(recpt); - businessRecptMap.put(bill.getBusinessService(), list); - } - }); - }); - receipts.clear(); - businessRecptMap.entrySet().forEach(entrySet -> { - Receipt receipt = entrySet.getValue().get(0); - - BigDecimal totalAmountPaid = entrySet.getValue().stream().map(Receipt::getBill).flatMap(List::stream).map(Bill::getBillDetails).flatMap(List::stream).map(BillDetail::getAmountPaid).reduce((x,y)->x.add(y)).orElse(BigDecimal.ZERO); - - List billAccDetailList = entrySet.getValue().stream().map(Receipt::getBill).flatMap(List::stream).map(Bill::getBillDetails).flatMap(List::stream).map(BillDetail::getBillAccountDetails).flatMap(List::stream).collect(Collectors.toList()); - - this.aggregateBillAccounDetails(billAccDetailList); - BillDetail billDetail = receipt.getBill().get(0).getBillDetails().get(0); - billDetail.setAmountPaid(totalAmountPaid); - receipt.getBill().get(0).getBillDetails().clear(); - receipt.getBill().get(0).getBillDetails().add(billDetail); - receipt.getBill().get(0).getBillDetails().get(0).getBillAccountDetails().clear(); - receipt.getBill().get(0).getBillDetails().get(0).setBillAccountDetails(billAccDetailList); - receipts.add(receipt); - }); - - } - - private void aggregateBillAccounDetails(List billAccDetailList) { - Map> taxHeadBillAccDetailsMap = new HashMap<>(); - for(BillAccountDetail bad : billAccDetailList){ - if(taxHeadBillAccDetailsMap.containsKey(bad.getTaxHeadCode())){ - taxHeadBillAccDetailsMap.get(bad.getTaxHeadCode()).add(bad); - }else{ - List list = new ArrayList<>(); - list.add(bad); - taxHeadBillAccDetailsMap.put(bad.getTaxHeadCode(), list); - } - } - billAccDetailList.clear(); - for(Entry> set : taxHeadBillAccDetailsMap.entrySet()){ - List value = set.getValue(); - BillAccountDetail bad = value.get(0); - BigDecimal totalAmount = value.stream().map(BillAccountDetail::getAmount).reduce((prevAmount,currAmount)->prevAmount.add(currAmount)).orElse(BigDecimal.ZERO); - BigDecimal adjustedAmount = value.stream().map(BillAccountDetail::getAdjustedAmount).reduce((prevAmount,currAmount)->prevAmount.add(currAmount)).orElse(BigDecimal.ZERO); - bad.setAmount(totalAmount); - bad.setAdjustedAmount(adjustedAmount); - billAccDetailList.add(bad); - } - } - - private void prepareReceipt(Payment payment, PaymentDetail paymentDetail, Receipt receipt) { - receipt.setPaymentDetailId(paymentDetail.getId()); - receipt.setAuditDetails(paymentDetail.getAuditDetails()); - receipt.setConsumerCode(paymentDetail.getBill().getConsumerCode()); - receipt.setReceiptDate(paymentDetail.getReceiptDate()); - receipt.setReceiptNumber(paymentDetail.getReceiptNumber()); - receipt.setTenantId(paymentDetail.getTenantId()); - receipt.setPaymentId(payment.getId()); -// receipt.setBill(bill); - this.prepareBillData(payment, paymentDetail, receipt); -// receipt.setTransactionId(transactionId); - } - - private void prepareBillData(Payment payment, PaymentDetail paymentDetail, Receipt receipt) { - BillV2 billv2 = paymentDetail.getBill(); - Bill bill = new Bill(); - bill.setAdditionalDetails(billv2.getAdditionalDetails()); - bill.setAuditDetails(billv2.getAuditDetails()); - bill.setId(billv2.getId()); -// bill.setIsActive(isActive); - bill.setIsCancelled(billv2.getIsCancelled()); - bill.setMobileNumber(billv2.getMobileNumber()); - bill.setPaidBy(billv2.getPaidBy() != null ? billv2.getPaidBy() : payment.getPaidBy()); - bill.setPayerAddress(billv2.getPayerAddress()); - bill.setPayerEmail(billv2.getPayerEmail()); - bill.setPayerId(billv2.getPayerId()); - bill.setPayerName(billv2.getPayerName()); -// bill.setTaxAndPayments(taxAndPayments); - bill.setTenantId(billv2.getTenantId()); - bill.setBusinessService(paymentDetail.getBusinessService()); -// bill.setBillDetails(billDetails); - //prepare billdetails - bill.setBillDetails(new ArrayList()); - this.prepareBillDetailsData(paymentDetail,bill); - receipt.getBill().add(bill); - } - - private void prepareBillDetailsData(PaymentDetail paymentDetail, Bill bill) { - // TODO Auto-generated method stub - paymentDetail.getBill().getBillDetails().stream().forEach(bdv1 -> { - BillDetail bd = new BillDetail(); - bd.setAdditionalDetails(bdv1.getAdditionalDetails()); - bd.setAmountPaid(bdv1.getAmountPaid()); -// bd.setBill(bill); - bd.setBillDate(paymentDetail.getBill().getBillDate()); - bd.setBillDescription(bdv1.getBillDescription()); - bd.setBillNumber(paymentDetail.getBill().getBillNumber()); - bd.setBoundary(bdv1.getBoundary()); - bd.setBusinessService(paymentDetail.getBill().getBusinessService()); - bd.setCallBackForApportioning(bdv1.getCallBackForApportioning()); - bd.setCancellationRemarks(bdv1.getCancellationRemarks()); - bd.setChannel(bdv1.getChannel()); -// bd.setCollectedAmount(collectedAmount); - bd.setCollectionModesNotAllowed(paymentDetail.getBill().getCollectionModesNotAllowed()); - bd.setCollectionType(bdv1.getCollectionType()); - bd.setConsumerCode(paymentDetail.getBill().getConsumerCode()); - bd.setDemandId(bdv1.getDemandId()); - bd.setDisplayMessage(bdv1.getDisplayMessage()); - bd.setExpiryDate(bdv1.getExpiryDate()); - bd.setFromPeriod(bdv1.getFromPeriod()); - bd.setId(bdv1.getId()); - bd.setIsAdvanceAllowed(paymentDetail.getBill().getIsAdvanceAllowed()); - bd.setManualReceiptDate(bdv1.getManualReceiptDate()); - bd.setManualReceiptNumber(bdv1.getManualReceiptNumber()); - bd.setMinimumAmount(paymentDetail.getBill().getMinimumAmountToBePaid()); - bd.setPartPaymentAllowed(paymentDetail.getBill().getPartPaymentAllowed()); - bd.setReasonForCancellation(paymentDetail.getBill().getReasonForCancellation()); - bd.setReceiptDate(paymentDetail.getReceiptDate()); - bd.setReceiptNumber(paymentDetail.getReceiptNumber()); - bd.setReceiptType(paymentDetail.getReceiptType()); -// bd.setStateId(stateId); - bd.setStatus(paymentDetail.getBill().getStatus().name()); - bd.setTenantId(bdv1.getTenantId()); - bd.setToPeriod(bdv1.getToPeriod()); - bd.setTotalAmount(paymentDetail.getBill().getTotalAmount()); - bd.setVoucherHeader(bdv1.getVoucherHeader()); - bd.setBillAccountDetails(new ArrayList<>()); - this.preapreBillAccountDetails(bd,bdv1); - bill.getBillDetails().add(bd); - }); - } - - private void preapreBillAccountDetails(BillDetail bd, BillDetailV2 bdv1) { - bd.setBillAccountDetails(bdv1.getBillAccountDetails()); -// bdv1.getBillAccountDetails().stream(). - } - - private void prepareInstrument(Payment payment, Instrument instrument) throws VoucherCustomException { - instrument.setAmount(payment.getTotalAmountPaid()); - instrument.setIfscCode(payment.getIfscCode()); - if(payment.getIfscCode() != null && !payment.getIfscCode().isEmpty()){ - populateBankDetails(instrument,payment.getIfscCode()); - } - instrument.setPaymentId(payment.getId()); - instrument.setInstrumentDate(payment.getInstrumentDate()); - instrument.setInstrumentNumber(payment.getInstrumentNumber()); - instrument.setInstrumentStatus(payment.getInstrumentStatus()); - InstrumentType instrumentType = new InstrumentType(); - if (payment.getPaymentMode().name().equalsIgnoreCase("DD")) - instrumentType.setName(payment.getPaymentMode().name().toUpperCase()); - else - instrumentType.setName(this.toCamelCase(payment.getPaymentMode().name())); - instrument.setInstrumentType(instrumentType); - instrument.setTenantId(payment.getTenantId()); - instrument.setTransactionDate(new Date(payment.getTransactionDate())); - instrument.setTransactionNumber(payment.getTransactionNumber()); - instrument.setTransactionType(TransactionType.Debit); - } - - /** - * Method which is used to populate the Bank Details based on ifsc code - * @param instrument - * @param ifscCode - * @throws VoucherCustomException - */ - private void populateBankDetails(Instrument instrument, String ifscCode) throws VoucherCustomException { - Object resultGet = serviceRequestRepository.fetchResultGet(HTTPS_IFSC_RAZORPAY_URL+ifscCode); - BankDetails bankDetails = mapper.convertValue(resultGet, BankDetails.class); - BankContract bank = BankContract.builder().name(bankDetails.getBankName()).code(bankDetails.getBankCode()).build(); - instrument.setBank(bank ); - instrument.setBranchName(bankDetails.getBranchName()); - } - - private String toCamelCase(String str){ - return new StringBuilder(str.toUpperCase().substring(0,1)).append(str.substring(1).toLowerCase()).toString(); - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillAccountDetailV2.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillAccountDetailV2.java deleted file mode 100644 index ecadae109c5..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillAccountDetailV2.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import java.math.BigDecimal; - -import org.egov.receipt.consumer.model.AuditDetails; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * BillAccountDetail - */ - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -public class BillAccountDetailV2 { - - @JsonProperty("id") - private String id; - - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("billDetailId") - private String billDetailId; - - @JsonProperty("demandDetailId") - private String demandDetailId; - - @JsonProperty("order") - private Integer order; - - @JsonProperty("amount") - private BigDecimal amount; - - @JsonProperty("adjustedAmount") - private BigDecimal adjustedAmount; - - @JsonProperty("taxHeadCode") - private String taxHeadCode; - - @JsonProperty("additionalDetails") - private Object additionalDetails; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails; -} - - diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillDetailV2.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillDetailV2.java deleted file mode 100644 index 133be058199..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillDetailV2.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.validation.constraints.NotNull; - -import org.egov.receipt.consumer.model.AuditDetails; -import org.egov.receipt.consumer.model.BillAccountDetail; -import org.egov.receipt.consumer.model.CollectionType; -import org.springframework.util.CollectionUtils; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Setter -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode(of = {"id"}) -public class BillDetailV2 { - - @JsonProperty("id") - private String id = null; - - @JsonProperty("tenantId") - private String tenantId = null; - - @JsonProperty("demandId") - private String demandId = null; - - @JsonProperty("billId") - private String billId = null; - - @JsonProperty("amount") - @NotNull - private BigDecimal amount = null; - - @JsonProperty("amountPaid") - private BigDecimal amountPaid = null; - - @NotNull - @JsonProperty("fromPeriod") - private Long fromPeriod = null; - - @NotNull - @JsonProperty("toPeriod") - private Long toPeriod = null; - - @JsonProperty("additionalDetails") - private JsonNode additionalDetails = null; - - @JsonProperty("channel") - private String channel = null; - - @JsonProperty("voucherHeader") - private String voucherHeader = null; - - @JsonProperty("boundary") - private String boundary = null; - - @JsonProperty("manualReceiptNumber") - private String manualReceiptNumber = null; - - @JsonProperty("manualReceiptDate") - private Long manualReceiptDate = null; - - - @JsonProperty("billAccountDetails") - private List billAccountDetails = null; - - @NotNull - @JsonProperty("collectionType") - private CollectionType collectionType = null; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails = null; - - - private String billDescription; - - @NotNull - @JsonProperty("expiryDate") - private Long expiryDate; - - private String displayMessage; - - private Boolean callBackForApportioning; - - private String cancellationRemarks; - - public Boolean addBillAccountDetail(BillAccountDetail billAccountDetail) { - - if (CollectionUtils.isEmpty(billAccountDetails)) { - - billAccountDetails = new ArrayList<>(); - return billAccountDetails.add(billAccountDetail); - } else { - - if (!billAccountDetails.contains(billAccountDetail)) - return billAccountDetails.add(billAccountDetail); - else - return false; - } - } - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillV2.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillV2.java deleted file mode 100644 index 47fb0bb831f..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/BillV2.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.validation.Valid; - -import org.egov.receipt.consumer.model.AuditDetails; -import org.springframework.util.CollectionUtils; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.JsonNode; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -@Getter -@Setter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@EqualsAndHashCode -public class BillV2 { - // TODO some of the fields are mandatory in yml, lets discuss billdetail and billaccountdetail also for more clarity - - @JsonProperty("id") - private String id = null; - - @JsonProperty("mobileNumber") - private String mobileNumber = null; - - @JsonProperty("paidBy") - private String paidBy = null; - - @JsonProperty("payerName") - private String payerName = null; - - @JsonProperty("payerAddress") - private String payerAddress = null; - - @JsonProperty("payerEmail") - private String payerEmail = null; - - @JsonProperty("payerId") - private String payerId = null; - - @JsonProperty("status") - private StatusEnum status = null; - - @JsonProperty("reasonForCancellation") - private String reasonForCancellation = null; - - @JsonProperty("isCancelled") - private Boolean isCancelled = null; - - @JsonProperty("additionalDetails") - private JsonNode additionalDetails = null; - - @JsonProperty("billDetails") - @Valid - private List billDetails = null; - - @JsonProperty("tenantId") - private String tenantId = null; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails = null; - - @JsonProperty("collectionModesNotAllowed") - private List collectionModesNotAllowed = null; - - @JsonProperty("partPaymentAllowed") - private Boolean partPaymentAllowed = null; - - @JsonProperty("isAdvanceAllowed") - private Boolean isAdvanceAllowed; - - @JsonProperty("minimumAmountToBePaid") - private BigDecimal minimumAmountToBePaid = null; - - @JsonProperty("businessService") - private String businessService = null; - - @JsonProperty("totalAmount") - private BigDecimal totalAmount = null; - - @JsonProperty("consumerCode") - private String consumerCode = null; - - @JsonProperty("billNumber") - private String billNumber = null; - - @JsonProperty("billDate") - private Long billDate = null; - - @JsonProperty("amountPaid") - private BigDecimal amountPaid; - - - - public enum StatusEnum { - ACTIVE("ACTIVE"), - - CANCELLED("CANCELLED"), - - PAID("PAID"), - - EXPIRED("EXPIRED"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - public static boolean contains(String test) { - for (StatusEnum val : StatusEnum.values()) { - if (val.name().equalsIgnoreCase(test)) { - return true; - } - } - return false; - } - - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - - } - - public Boolean addBillDetail(BillDetailV2 billDetail) { - - if (CollectionUtils.isEmpty(billDetails)) { - - billDetails = new ArrayList<>(); - return billDetails.add(billDetail); - } else { - - if (!billDetails.contains(billDetail)) - return billDetails.add(billDetail); - else - return false; - } - } - - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/Payment.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/Payment.java deleted file mode 100644 index aceb67e6700..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/Payment.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.receipt.consumer.model.AuditDetails; -import org.egov.receipt.consumer.model.InstrumentStatusEnum; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -@EqualsAndHashCode -public class Payment { - - @Size(max=64) - @JsonProperty("id") - private String id; - - @NotNull - @Size(max=64) - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("totalDue") - private BigDecimal totalDue; - - @NotNull - @JsonProperty("totalAmountPaid") - private BigDecimal totalAmountPaid; - - @Size(max=128) - @JsonProperty("transactionNumber") - private String transactionNumber; - - @JsonProperty("transactionDate") - private Long transactionDate; - - @NotNull - @JsonProperty("paymentMode") - private PaymentModeEnum paymentMode; - - - @JsonProperty("instrumentDate") - private Long instrumentDate; - - @Size(max=128) - @JsonProperty("instrumentNumber") - private String instrumentNumber; - - @JsonProperty("instrumentStatus") - private InstrumentStatusEnum instrumentStatus; - - @Size(max=64) - @JsonProperty("ifscCode") - private String ifscCode; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails; - - @JsonProperty("additionalDetails") - private JsonNode additionalDetails; - - @JsonProperty("paymentDetails") - @Valid - private List paymentDetails; - - @Size(max=128) - @NotNull - @JsonProperty("paidBy") - private String paidBy = null; - - @Size(max=64) - @NotNull - @JsonProperty("mobileNumber") - private String mobileNumber = null; - - @Size(max=128) - @JsonProperty("payerName") - private String payerName = null; - - @Size(max=1024) - @JsonProperty("payerAddress") - private String payerAddress = null; - - @Size(max=64) - @JsonProperty("payerEmail") - private String payerEmail = null; - - @Size(max=64) - @JsonProperty("payerId") - private String payerId = null; - - @JsonProperty("paymentStatus") - private PaymentStatusEnum paymentStatus; - - - public Payment addpaymentDetailsItem(PaymentDetail paymentDetail) { - if (this.paymentDetails == null) { - this.paymentDetails = new ArrayList<>(); - } - this.paymentDetails.add(paymentDetail); - return this; - } - - - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentDetail.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentDetail.java deleted file mode 100644 index dc376fdd1e4..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentDetail.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import java.math.BigDecimal; - -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - -import org.egov.receipt.consumer.model.AuditDetails; -import org.egov.receipt.consumer.model.Bill; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.JsonNode; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -@Builder -@EqualsAndHashCode -public class PaymentDetail { - - @Size(max=64) - @JsonProperty("id") - private String id; - - @Size(max=64) - @JsonProperty("tenantId") - private String tenantId; - - @JsonProperty("totalDue") - private BigDecimal totalDue; - - @NotNull - @JsonProperty("totalAmountPaid") - private BigDecimal totalAmountPaid; - - @Size(max=64) - @JsonProperty("receiptNumber") - private String receiptNumber; - - @Size(max=64) - @JsonProperty("manualReceiptNumber") - private String manualReceiptNumber; - - @JsonProperty("manualReceiptDate") - private Long manualReceiptDate; - - @JsonProperty("receiptDate") - private Long receiptDate = null; - - @JsonProperty("receiptType") - private String receiptType = null; - - @JsonProperty("businessService") - private String businessService; - - @NotNull - @Size(max=64) - @JsonProperty("billId") - private String billId; - - @JsonProperty("bill") - private BillV2 bill; - - @JsonProperty("additionalDetails") - private JsonNode additionalDetails; - - @JsonProperty("auditDetails") - private AuditDetails auditDetails; - -} - diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentModeEnum.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentModeEnum.java deleted file mode 100644 index a7a60d8259d..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentModeEnum.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public enum PaymentModeEnum { - CASH("CASH"), - CHEQUE("CHEQUE"), - DD("DD"), - ONLINE("ONLINE"), - CARD("CARD"); - - - private String value; - - PaymentModeEnum(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - public static boolean contains(String test) { - for (PaymentModeEnum val : PaymentModeEnum.values()) { - if (val.name().equalsIgnoreCase(test)) { - return true; - } - } - return false; - } - - @JsonCreator - public static PaymentModeEnum fromValue(String text) { - for (PaymentModeEnum b : PaymentModeEnum.values()) { - if (String.valueOf(b.value).equalsIgnoreCase(text)) { - return b; - } - } - return null; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentRequest.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentRequest.java deleted file mode 100644 index b1ba77804d8..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentRequest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import javax.validation.Valid; -import javax.validation.constraints.NotNull; - -import org.egov.receipt.consumer.model.RequestInfo; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class PaymentRequest { - - @NotNull - @Valid - @JsonProperty("RequestInfo") - private RequestInfo requestInfo; - - @NotNull - @Valid - @JsonProperty("Payment") - private Payment payment; - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentStatusEnum.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentStatusEnum.java deleted file mode 100644 index 1290a524424..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/consumer/v2/model/PaymentStatusEnum.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ - -package org.egov.receipt.consumer.v2.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -public enum PaymentStatusEnum { - NEW("NEW"), - DEPOSITED("DEPOSITED"), - CANCELLED("CANCELLED"), - DISHONOURED("DISHONOURED"), - RECONCILED("RECONCILED"); - - - private String value; - - PaymentStatusEnum(String value) { - this.value = value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static PaymentStatusEnum fromValue(String text) { - for (PaymentStatusEnum b : PaymentStatusEnum.values()) { - if (String.valueOf(b.value).equalsIgnoreCase(text)) { - return b; - } - } - return null; - } - - public static boolean contains(String test) { - for (PaymentStatusEnum val : PaymentStatusEnum.values()) { - if (val.name().equalsIgnoreCase(test)) { - return true; - } - } - return false; - } -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/custom/exception/VoucherCustomException.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/custom/exception/VoucherCustomException.java deleted file mode 100644 index f9e9250e600..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/receipt/custom/exception/VoucherCustomException.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) <2015> eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.egovernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any Long of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org. - */ -package org.egov.receipt.custom.exception; - -import org.egov.receipt.consumer.model.ProcessStatus; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class VoucherCustomException extends Exception{ - ProcessStatus status; - String message; -public VoucherCustomException(String message) { - super(message); -} -@Override -public String getMessage() { - return "[status : "+status+", message : "+message+"]"; -} - -} diff --git a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/reciept/consumer/config/PropertiesManager.java b/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/reciept/consumer/config/PropertiesManager.java deleted file mode 100644 index bbf07c6d26f..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/java/org/egov/reciept/consumer/config/PropertiesManager.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * eGov suite of products aim to improve the internal efficiency,transparency, - * accountability and the service delivery of the government organizations. - * - * Copyright (C) 2016 eGovernments Foundation - * - * The updated version of eGov suite of products as by eGovernments Foundation - * is available at http://www.empernments.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ or - * http://www.gnu.org/licenses/gpl.html . - * - * In addition to the terms of the GPL license to be adhered to in using this - * program, the following additional terms are to be complied with: - * - * 1) All versions of this program, verbatim or modified must carry this - * Legal Notice. - * - * 2) Any misrepresentation of the origin of the material is prohibited. It - * is required that all modified versions of this material be marked in - * reasonable ways as different from the original version. - * - * 3) This license does not grant any rights to any user of the program - * with regards to rights under trademark law for use of the trade names - * or trademarks of eGovernments Foundation. - * - * In case of any queries, you can reach eGovernments Foundation at contact@empernments.org. - */ - -package org.egov.reciept.consumer.config; - -import java.util.regex.Pattern; - -import org.egov.common.contract.request.User; -import org.egov.receipt.consumer.model.ProcessStatus; -import org.egov.receipt.custom.exception.VoucherCustomException; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; - -@Component -@Getter -@Setter -@NoArgsConstructor -@AllArgsConstructor -@ToString -public class PropertiesManager { - - @Value("${egov.services.egov.user.host}") - private String userHostUrl; - - @Value("${egov.services.egf.voucher.create}") - private String voucherCreateUrl; - - @Value("${egov.services.egf.voucher.cancel}") - private String voucherCancelUrl; - - @Value("${si.microservice.user}") - private String siUser; - - @Value("${si.microservice.password}") - private String siPassword; - - @Value("${si.microservice.usertype}") - private String siUserType; - - @Value("${si.microservice.scope}") - private String siScope; - - @Value("${si.microservice.granttype}") - private String siGrantType; - - @Value("${egov.services.user.token.url}") - private String tokenGenUrl; - - @Value("${egov.services.egf.master.financialstatuses.search}") - private String financialStatusesSearch; - - @Value("${egov.services.egf.instrument.instruments.create}") - private String instrumentCreate; - - @Value("${egov.services.collection.services.receipts.update}") - private String receiptsUpdate; - - @Value("${egov.services.instrument.search.accountcodes.uri}") - private String instrumentAccountCodeUrl; - - @Value("${egov.services.egf.voucher.search.by.service.reference}") - private String voucherSearchByRefUrl; - - @Value("${egov.services.egf.voucher.search}") - private String voucherSearchUrl; - - @Value("${egov.services.egf.voucher.manualreceiptdate.config.url}") - private String manualReceiptDateConfigUrl; - - @Value("${egov.services.master.mdms.search.url}") - private String mdmsSearchUrl; - - @Value("${egov.services.egf.instrument.instruments.cancel}") - private String instrumentCancel; - - @Value("${fin.coe.erp.domain.name}") - private String finCoeErpDomainName; - - @Value("${fin.coe.erp.environment.name}") - private String finCoeErpEnvName; - - @Value("${fin.coe.erp.http.protocol}") - private String httpProtocol; - - @Value("${egov.services.egf.voucher.moduleid.search}") - private String moduleIdSearchUrl; - - @Value("${egov.services.collection.receipts.view.source.url}") - private String receiptViewSourceUrl; - - @Value("${egov.services.mdms.hostname}") - private String mdmsHostUrl; - - @Value("${egov.services.egfinstrument.hostname}") - private String instrumentHostUrl; - - @Value("${egov.services.collections.hostname}") - private String collectionsHostUrl; - - @Value("${egov.services.businessservice.hostname}") - private String businessServiceHostUrl; - - @Value("${egov.services.egfmaster.hostname}") - private String egfMasterHostUrl; - - @Value("${token.authorization.key}") - private String tokenAuhorizationtKey; - - @Value("${egov.collection.receipt.voucher.save.topic}") - private String voucherCreateTopic; - - @Value("${egov.collection.receipt.voucher.cancel.topic}") - private String voucherCancelTopic; - - @Value("${kafka.topics.payment.create.name}") - private String createPaymentTopicName; - - @Value("${kafka.topics.payment.cancel.name}") - private String cancelPaymentTopicName; - - private String siAuthToken; - private User siUserInfo; - - @Value("${egov.services.egf.instrument.instruments.search}") - private String instrumentSearch; - - public String getErpURLBytenantId(String tenantId) throws VoucherCustomException { - try { - tenantId = tenantId.split(Pattern.quote("."))[1]; - if(finCoeErpEnvName != null && finCoeErpEnvName.equalsIgnoreCase("local")){ - return "http://jalandhar.lgpunjab.com:8080/"; - } - if(finCoeErpEnvName != null && !finCoeErpEnvName.isEmpty()){ - return httpProtocol+"://"+tenantId+"-"+finCoeErpEnvName+"."+finCoeErpDomainName+"/"; - }else{ - //considered as the production url - return httpProtocol+"://"+tenantId+"."+finCoeErpDomainName+"/"; - } - } catch (Exception e) { - throw new VoucherCustomException(ProcessStatus.FAILED,"ERROR occured while generating ERP url to interact with the finance coexistence. Please check the configuration in properties file."); - } - } - -} \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/resources/application.properties b/business-services/finance-collections-voucher-consumer/src/main/resources/application.properties deleted file mode 100644 index 5efb46de782..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/resources/application.properties +++ /dev/null @@ -1,100 +0,0 @@ -app.timezone=UTC - -#datasource configuration -spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.url=jdbc:postgresql://localhost:5432/egf-collectionvoucher -spring.datasource.username=postgres -spring.datasource.password=psql - -spring.flyway.enabled=true -spring.flyway.user=postgres -spring.flyway.password=psql -spring.flyway.outOfOrder=true -#spring.flyway.table=egf-collectionvoucher_schema_version -spring.flyway.baseline-on-migrate=true -spring.flyway.url=jdbc:postgresql://localhost:5432/egf-collectionvoucher -spring.flyway.locations=classpath:/db/migration/main - -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl -spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl - -spring.jackson.deserialization.fail-on-unknown-properties=false -#Kafka general config -spring.kafka.consumer.properties.spring.json.use.type.headers=false -spring.kafka.listener.missing-topics-fatal=false -management.endpoints.web.base-path=/ -spring.main.allow-bean-definition-overriding=false - -spring.kafka.consumer.group-id=fin-collection-receipt-voucher-consumer -spring.kafka.producer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer -spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer - - -#Kafka Topic config for Receipt -egov.collection.receipt.voucher.save.topic=egov.collection.receipt-create -egov.collection.receipt.voucher.save.group=egov.collection.receipt-create.group -egov.collection.receipt.voucher.save.id=egov.collection.receipt-create.id - -egov.collection.receipt.voucher.cancel.topic=egov.collection.receipt-cancel -egov.collection.receipt.voucher.cancel.group=egov.collection.receipt-cancel.group -egov.collection.receipt.voucher.cancel.id=egov.collection.receipt-cancel.id - -kafka.topics.egf.instrument.completed.topic=egov.egf.instrument.completed -kafka.topics.egf.instrument.completed.group=egov.egf.instrument.completed.group - -#Kafka Topic for Payment -kafka.topics.payment.create.name=egov.collection.payment-create -kafka.topics.payment.create.key=payment-create -kafka.topics.payment.cancel.name=egov.collection.payment-cancel -kafka.topics.payment.cancel.key=payment-cancel -kafka.topics.payment.update.name=egov.collection.payment-update -kafka.topics.payment.update.key=payment-update - -#Config key for tenant based url -fin.coe.erp.domain.name=digit.org -#this is not required for production. keep it blank -fin.coe.erp.environment.name=dev -# i.e http or https -fin.coe.erp.http.protocol=https - -token.authorization.key= - -#egov-user -egov.services.egov.user.host = https://dev.digit.org/ -#egov-mdms-service -egov.services.mdms.hostname = https://dev.digit.org/ -#egf-instrument -egov.services.egfinstrument.hostname = https://dev.digit.org/ -#egf-master -egov.services.egfmaster.hostname = https://dev.digit.org/ -#collection-services -egov.services.collections.hostname = https://dev.digit.org/ -#business-services -egov.services.businessservice.hostname = https://dev.digit.org/ - - -egov.services.instrument.search.accountcodes.uri=egf-instrument/instrumentaccountcodes/_search -egov.services.master.mdms.search.url = /egov-mdms-service/v1/_search -egov.services.user.token.url=user/oauth/token -egov.services.egf.voucher.create=services/EGF/rest/voucher/_create -egov.services.egf.voucher.cancel=services/EGF/rest/voucher/_cancel -egov.services.egf.voucher.search=services/EGF/rest/voucher/v2/_search -egov.services.egf.voucher.search.by.service.reference=services/EGF/rest/voucher/_searchbyserviceandreference -egov.services.egf.voucher.moduleid.search=services/EGF/rest/voucher/_getmoduleidbyname -egov.services.egf.voucher.manualreceiptdate.config.url=services/EGF/rest/voucher/_ismanualreceiptdateenabled -egov.services.egf.master.financialstatuses.search=egf-master/financialstatuses/_search -egov.services.egf.instrument.instruments.create=egf-instrument/instruments/_create -egov.services.egf.instrument.instruments.cancel=egf-instrument/instruments/_update -egov.services.egf.instrument.instruments.search=egf-instrument/instruments/_search -egov.services.collection.services.receipts.update=collection-services/receipts/_update -egov.services.collection.receipts.view.source.url=/services/collection/receipts/receipt-viewReceipts.action - - -logging.level.*=DEBUG -logging.pattern.console=%clr(%X{CORRELATION_ID:-}) %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} -#this credential is overridden in yml file -si.microservice.user= -si.microservice.password= -si.microservice.usertype=SYSTEM -si.microservice.scope=read -si.microservice.granttype=password diff --git a/business-services/finance-collections-voucher-consumer/src/main/resources/db/Dockerfile b/business-services/finance-collections-voucher-consumer/src/main/resources/db/Dockerfile deleted file mode 100644 index a5699ff7d99..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/resources/db/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM egovio/flyway:4.1.2 - -COPY ./migration/main /flyway/sql - -COPY migrate.sh /usr/bin/migrate.sh - -RUN chmod +x /usr/bin/migrate.sh - -CMD ["/usr/bin/migrate.sh"] diff --git a/business-services/finance-collections-voucher-consumer/src/main/resources/db/migrate.sh b/business-services/finance-collections-voucher-consumer/src/main/resources/db/migrate.sh deleted file mode 100644 index 54d07c0940a..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/resources/db/migrate.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -flyway -url=$DB_URL -table=$SCHEMA_TABLE -user=$FLYWAY_USER -password=$FLYWAY_PASSWORD -locations=$FLYWAY_LOCATIONS -baselineOnMigrate=true -outOfOrder=true -ignoreMissingMigrations=true migrate diff --git a/business-services/finance-collections-voucher-consumer/src/main/resources/db/migration/main/V20190513113515__voucher_integration_query.sql b/business-services/finance-collections-voucher-consumer/src/main/resources/db/migration/main/V20190513113515__voucher_integration_query.sql deleted file mode 100644 index 0f236c37186..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/resources/db/migration/main/V20190513113515__voucher_integration_query.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE IF EXISTS egf_voucher_integration_log; - -CREATE TABLE egf_voucher_integration_log( -id varchar(250), -referenceNumber varchar(50), -status varchar(20), -voucherNumber varchar(30), -type varchar(50), -description text, -requestJson JSONB, -tenantId varchar(50) -); \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/main/resources/db/migration/main/V20190526203409__voucher_integration_query_modified_table.sql b/business-services/finance-collections-voucher-consumer/src/main/resources/db/migration/main/V20190526203409__voucher_integration_query_modified_table.sql deleted file mode 100644 index bbefc229a46..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/main/resources/db/migration/main/V20190526203409__voucher_integration_query_modified_table.sql +++ /dev/null @@ -1,13 +0,0 @@ -DROP TABLE IF EXISTS egf_voucher_integration_log; - -CREATE TABLE egf_voucher_integration_log( -id varchar(250), -referenceNumber varchar(50), -status varchar(20), -voucherNumber varchar(30), -type varchar(50), -description text, -requestJson JSONB, -tenantId varchar(50), -createddate TIMESTAMP not null default now() -); \ No newline at end of file diff --git a/business-services/finance-collections-voucher-consumer/src/test/java/org/egov/egfcollectionreceiptvoucherconsumer/EgfCollectionReceiptVoucherConsumerApplicationTests.java b/business-services/finance-collections-voucher-consumer/src/test/java/org/egov/egfcollectionreceiptvoucherconsumer/EgfCollectionReceiptVoucherConsumerApplicationTests.java deleted file mode 100644 index 72f0d63a3ee..00000000000 --- a/business-services/finance-collections-voucher-consumer/src/test/java/org/egov/egfcollectionreceiptvoucherconsumer/EgfCollectionReceiptVoucherConsumerApplicationTests.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.egov.egfcollectionreceiptvoucherconsumer; - -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; - -@RunWith(SpringRunner.class) -@SpringBootTest -public class EgfCollectionReceiptVoucherConsumerApplicationTests { - - @Ignore - @Test - public void contextLoads() { - } - -} diff --git a/business-services/finance-collections-voucher-consumer/start.sh b/business-services/finance-collections-voucher-consumer/start.sh deleted file mode 100644 index 3b4b97e3199..00000000000 --- a/business-services/finance-collections-voucher-consumer/start.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [[ -z "${JAVA_OPTS}" ]];then - export JAVA_OPTS="-Xmx64m -Xms64m" -fi - -java ${JAVA_OPTS} -jar /opt/egov/finance-collections-voucher-consumer.jar \ No newline at end of file