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.
Prior Knowledge of Java/J2EE.
Prior Knowledge of Spring and Hibernate
Prior knowledge of Maven
Prior knowledge of Git.
Maven v3.2.x
PostgreSQL v9.6
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
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
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.
The default application configurations of the finance service are present in the application configuration file. To enable or disable any feature, either update the values in the application configuration file or the override configuration file.
The override configuration is the template and the values for the template are present either in the finance service values yaml file or in the environment named yaml file. The finance service values yaml is the common file to override the default values and the changes made to this file are applicable for all environments (dev, qa, uat, prod etc).
Any specific configuration change is required for any specific environment then update the environment named yaml file.
Sample environment named yaml files for your reference
Add or update the db url in the environment specific file using the below property
Update the db username and password, which are configured in the environment named secrets yaml file.
For example, for the qa environment, update the qa-secrets.yaml
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.
Enable multi-tenancy by enabling the following property
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)
The default tenants are configured in the finance service yaml file using the below configuration.
To override and have separate tenants for a specific environment then update the environment-specific file like below.
Here citya.egovernments.org, cityb.egovernments.org are the domains and citya, cityb are the schemas/tenants.
Example environment specific configuration file for your reference.
Update the domainurl in the eg_city table.
Domain URL value should be the same as configured tenant domain_name Ex:
The default database migration configurations are present in the application configuration file.
Override the default values by updating the properties either in the finance service values yaml file or the environment-specific yaml file. The following are different properties.
Configure the following property either in the finance service values yaml file or the environment-specific yaml file.
Add one user in the system for system integration - SIFINANCE mapped with role SYS_INTEGRATOR_FINANCE by using the user service createnovalidate API.
Find the createnovalidate API details below
To enable or disable an event to push the bills and vouchers to the elastic search indexer the below need to be configured either in the finance service values yaml file or the environment-specific yaml file.
Configure the following property either in the finance service values yaml file or the environment-specific yaml file.
Configure the following property either in the finance service values yaml file or the environment-specific yaml file.
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.
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.
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.
MDMS serach url is configured in the Application Configuration file.
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.
Title
Link
API Contracts
Co-existence finance code available
Sample client implementation repository
Configuring MDMS
Adding new service and CI/CD
The objective of this service is to listen to the Kafka topics, validate the data based on the configuration, make the voucher API call to create the voucher in finance ERP and update the backend data. It also creates vouchers and instruments for the receipts collected through the collection service.
Prior Knowledge of Java/J2EE
Prior Knowledge of SpringBoot
Prior Knowledge of REST APIs and related concepts like path parameters, headers, JSON, etc
Prior Knowledge of Kafka and related concepts like Producer, Consumer, Topic, etc.
Create vouchers and instruments for the receipts collected.
Listen to Kafka topics and validate the data.
Update the data in finance ERP.
Step 1: Start the service present in the following repo:
Step 2: Start the egov-mdms service present in the following repo:
Following are the properties in the application.properties file in the egov-user-events service that is configurable.
This service is implemented to listen to the specific Kafka topic, fetch the data and perform activities like creating vouchers, cancelling vouchers or reversing vouchers on dishonouring.
Create Voucher:
Once the collection-service will generate collection/payment,it will push the data to egov.collection.receipt-create/egov.collection.payment-create topic.
Listener will be listening to the topic egov.collection.receipt-create/egov.collection.payment-create.
Making MDMS calls based on the services to get the configuration data and validate i.e whether voucher creation is enabled for the service or not. If voucher creation is enabled then perform the following
Prepare the voucher contract like master data i.e Dept, Fund, Function etc.
Prepare the account-specific data i.e glocode, amount etc.
Then making a rest call to create a voucher to finance ERP.
Once the voucher is created successfully then it will prepare the instrument contract by adding the voucher reference, instrument type, status etc and will make a call to create the instrument.
Once the instrument is created later it will make the call to collection receipt update API to back update the receipt by adding the voucher reference in the contract.
And finally, it will store the logs i.e fetched data, status, message to log table egf_voucher_integration_log.
If anywhere any exception occurs then errors are handled by the Exception Handler. Exception Handler will store the fetched data and the error cause to log table egf_voucher_integration_log.
Cancel Voucher:
Once collection service cancels the payment/collections, it pushes the data to egov.collection.payment-cancel/egov.collection.receipt-cancel
Listeners are listening to the topicegov.collection.payment-cancel/egov.collection.receipt-cancel.
Making MDMS calls based on the services to get the configuration data and validate i.e whether voucher creation is enabled for the service or not. If voucher creation is enabled then perform the following.
Try to fetch the voucher based on the voucher number(which might be present inside the receipt contract) and the business service reference document.
If Voucher is present inside the finance ERP then it makes a call to cancel the voucher.
Later it cancels the corresponding instrument.
And keep the log inside the table egf_voucher_integration_log.
Add MDMS configs required for Finance Collection Voucher Consumer service and restart MDMS service.
Deploy the latest version of the Finance Collection Voucher Consumer service.
Add Finance Collection Voucher Consumer service persister yaml path in persister configuration and restart persister service
Add Role-Action mapping for APIs.
Can perform service-specific business logic without impacting the other modules.
In the future, if we want to expose the application to citizens then it can be done easily.
The workflows or service-specific workflows can be enabled at the service level at any time without changing the design.
All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.
The business service and tax headmaster which are active in needs to be mapped with Finance related data.
The business service-related data is mapped with the finance-related data in .
: This is used to map the taxhead data to glcodes. This holds one more property InstrumentGLcodeMapping, which is used to hold the mapping for transaction type i.e Cash/Cheque/DD to glcodes.
: This is used to map the business service to finance specific master data like Department, Fund and Function, etc. even it can manage to enable and disable the voucher creation for specific service by setting the property voucherCreationEnabled=true/false.
: This holds the status of Instruments.
Property
Value
Remarks
egov.collection.receipt.voucher.save.topic
egov.collection.receipt-create
The topic which is listened only for collection version v1 to process further to create the voucher.
egov.collection.receipt.voucher.cancel.topic
egov.collection.receipt-cancel
The topic which is listened only for collection version v1 to cancel the voucher
kafka.topics.egf.instrument.completed.topic
egov.egf.instrument.completed
This is listened to trace the activity of instrument updation.
If Instrument gets dishonor then it tries to create the dishonor voucher.
egov.collection.payment-create
The topic which is listened when the data gets published from collection version -2 to create the voucher
egov.collection.payment-cancel
The topic which is listened when the data gets published from collection version -2 to cancel the voucher
egov.collection.payment-update
The topic which is listened when the data gets published from collection version -2 to cancel the voucher
dev/qa/uat
This is used to form the dynamic url for finance erp call.For Dev/QA/UAT env value is dev/qa/uat.
for production keep it blank.
token.authorizaton.key
Basic baicAuthKey
Pass the Basic authorization key to generate the Admin Token for SIFINANCE user.
egov.services.egov.user.host
Pass the host url where egov-user service is running
egov.services.mdms.hostname
Pass the host url where egov-mdms service is running
egov.services.egfinstrument.hostname
Pass the host url where egf-instrument service is running
egov.services.collections.hostname
Pass the host url where collections service is running
egov.services.businessservice.hostname
Pass the host url where business services are running
si.microservice.user
******
Keep the System Finance Username
si.microservice.password
*******
Keep System Finance Password
Example : if name is mSeva