Overview
This document describes the steps to be followed to set up a new instance of Finance. When a new state or city is to be set up, there are some activities to be executed in a defined order. Setting up an instance of an application server and configuration changes etc are a few of the key activities.
Technical Prerequisites
Prior Knowledge of Java/J2EE.
Prior Knowledge of Spring and Hibernate
Prior knowledge of Maven
Prior knowledge of Git.
Hardware/Software Prerequisites
Maven v3.2.x
PostgreSQL v9.6
JBoss Wildfly v11.x
Git 2.8.3
JDK 8 update 112 or higher
Create subdomains under the main domain for each of the cities that are to be set up
Create a schema per city in the database
Configurations and Setup
The Co-existence repository is the base repository for the finance product and the client-specific data needs to be defined in the Client implementation repository
How to set up a client implementation repository
Fork and create a client implementation repository from Client implementation repository to keep client-specific data and configurations.
Any configurations and data specific to the client should be added in the client repository.
Application Configuration
Set up a schema-based multi-tenant database
Finance co-existence service uses schema-based multi-tenancy, this means there will be one schema present for a city. The following are the configuration changes to set up this kind of database.
The configurations to be done in the /egov-egi/src/main/resources/config/application-config.properties or in the ${HOME_DIR}/wildfly-11.0.0.Final/modules/system/layers/base/org/egov/settings/main/config/egov-erp-override.properties
Enable multi tenancy by enabling the following property
multitenancy.enabled=true
The state schema is configured by adding the following property
statewide.schema.name=generic
generic is the statewide schema name.
Default schema name and the statewide schema name should be same. The default schema name is configured using the following property
default.schema.name=generic
CurrentTenantIdentifierResolver will take the default schema if no schema is present in the ApplicationThreadLocals.
Each ULB is enabled by adding a schema name and domain name. Schema names should follow a naming standard, It should be the same as that of the city name.
Each ULB can be configured by adding an entry like tenant.<domain_name>=schema_name (city_name)
Ex:
tenant.citya.egovernments.org=citya tenant.cityb.egovernments.org=cityb
Insert data into eg_city, in the city table, domain URL value should be the same as configured tenant domain_name
Ex:
For citya, domain url should be citya.egovernments.org For cityb, domain url should be cityb.egovernments.org
Database migration settings
Enable flyway DB migration by adding the following property. The SQL scripts will be executed if the below property is enabled.
db.migration.enabled=true
The following are the SQL file locations to pick and execute according to the properties configured in the properties file.
The SQL files present in the following locations will be executed on all the schemas present in the database.
db.flyway.main.migration.file.path=classpath:/db/migration/main/
Sample scripts will be executed if dev.mode is set as true.
db.flyway.sample.migration.file.path=classpath:/db/migration/sample/
City wise scripts will be executed on the city’s schema
db.flyway.tenant.migration.file.path=classpath:/db/migration/%s/
Statewide scripts will be executed on the configured statewide schema if the statewide migration is enabled.
statewide.schema.name=generic statewide.migration.required=true db.flyway.statewide.migration.file.path=classpath:/db/migration/statewide/
System Integration User Details Configuration
Add the following System integrator user details
si.microservice.user=SIFINANCE si.microservice.password=sifinance123@ si.microservice.usertype=SYSTEM si.microservice.scope=read si.microservice.granttype=password
Elastic Dashboard Configuration
To enable or disable an event to push the bills and vouchers to the elastic search indexer the below need to be configured.
finance.esk.dashboard.event.enabled=false
DIGIT integration configuration
Finance service reads data from multiple other DIGIT services. The following are the different services finance system reads data from. Update the domain URL of the respective service based on the service where it is running.
egov.default.services.endpoint=https://egov-micro-dev.egovernments.org/ egov.hrms.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.accesscontrol.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.hr.masters.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.user.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.common.masters.endpoint=https://egov-micro-dev.egovernments.org/ egov.billing.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.collection.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.egf.master.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.egf.instrument.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.mdms.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.indexer.service.endpoint=https://egov-micro-dev.egovernments.org/ egov.filestore.service.endpoint=https://egov-micro-dev.egovernments.org/
Changes required to setup workspace in local machine
Setup Finance service workspace by following the instructions provided in README.
After set up is done, make the changes to the host file in the local machine, by mapping the domain URLs with a local IP address and save the changes. Restart your local machine to make the host mapping effective.
$ vim /etc/hosts 127.0.0.1 egov-micro-dev.egovernments.org
MDMS Configuration
The following master data is present in the MDMS repository.
Department
Designation
BusinessServiceMapping
TaxHeadMasterGlCodeMapping
InstrumentGLcodeMapping
AccountCodeTemplate
FinanceInstrumentStatusMapping
tenants
OnlineGLCodeMapping
Define all the departments in the Departments json
Define all the designations in the Designations json
Configure finance tenants in the Citymodule json to enable finance module in the ULB
{ "module": "Finance", "code": "Finance", "tenants": [ { "code": "pb.jalandhar" }, { "code": "pb.nawanshahr" } ] },
Define business services mapping in the Business Service Mapping json to integrate different business services like Property Tax, Trade License and FireNOC etc with Finance and to post vouchers like demand and receipt vouchers. Enabling and disabling voucher posting for any service can be configured here.
Define the Tax head and instrument glcode mappings in the Account Head Mapping json. This file contains each tax head wise glcode mapping and each instrument wise glcode mappings.
Different instrument statuses can be defined in the Instrument Status Mapping json file.
Different types of contractor bill templates are defined in the AccountCode Template file. These templates will be used in the contractor bill creation screen to auto-populate the account codes.
Service-wise glcode mapping for the online instrument type for the particular city is defined in the Online Instrument Type json.
Define the business service wise bank account mappings in the BankAccount Service Mapping json file. These details to be configured city wise as the bank details are specific to a city.
Add the property and update the MDMS search URL
egov.services.master.mdms.search.url=/egov-mdms-service/v1/_search in application-config.properties file or egov-erp-override.properties file
References
Title | Link |
---|---|
API Contracts | https://github.com/egovernments/egov-coexistence/blob/master/docs/voucher_apis.yaml |
Co-existence finance code available | |
Sample client implementation repository | |
Configuring MDMS |
0 Comments