...
Maven v3.2.x
PostgreSQL v9.6
JBoss Customized Wildfly v11.xImage
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 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 to all environments (dev, qa, uat, prod etc).
Any specific configuration change is required for any specific environment then update the environment named yaml file.
...
Code Block | ||
---|---|---|
| ||
https://github.com/egovernments/eGovTrain-infraOpsInfraOps/blob/master/helm/environments/dev.yaml https://github.com/egovernments/eGov-infraOps/blob/master/helm/environments/qa.yaml |
Database configuration
Add or update the db url in the environment specific file using the below 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 below configuration.
...
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:Code Block language java For citya, domain url should be citya.egovernments.org For cityb, domain url should be cityb.egovernments.org
...
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 the different properties.
...
Configure the following property either in the finance service values yaml file or the environment specific yaml file.
Code Block | ||
---|---|---|
| ||
Systemintegration: | si.microservice.user=${si-microservice-user} si.microservice.password=${si-microservice-password} si.microservice.usertype=SYSTEM si.microservice.scope=read si.microservice.granttype=password env: | - name: si-microservice-password valueFrom: secretKeyRef: name: egov-si-microservice key: si-microservice-password - name: si-microservice-user valueFrom: secretKeyRef: name: egov-si-microservice key: si-microservice-user |
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 either in the finance service values yaml file or the environment specific yaml file.
Code Block |
---|
finance: true |
File store Configuration
Configure the following property either in the finance service values yaml file or the environment specific yaml file.
Code Block | ||
---|---|---|
| ||
filestore: /tmp/egovfilestore |
SMS and Email Configuration
Configure the following property either in the finance service values yaml file or the environment specific yaml file.
Code Block | ||
---|---|---|
| ||
sms: true
mail: true
smc_config: |
# Add/update the sms related properties
mail_config: |
# Add/update the mail related properties |
Quartz Scheduler Configuration
Configure the following property either in the finance service values yaml file or the environment specific yaml file.
Code Block | ||
---|---|---|
| ||
scheduler: true |
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.
Code Block |
---|
microservice: |
egov.default.services.endpoint=https://egov-micro-dev.egovernments.org/
egov.hrms.service.endpoint=http://egov-hrms.egov:8080/
egov.accesscontrol.service.endpoint=http://egov-accesscontrol.egov:8080/
egov.hr.masters.service.endpoint=http://hr-masters.egov:8080/
egov.user.service.endpoint=http://egov-user.egov:8080/
egov.common.masters.endpoint=http://egov-common-masters.egov:8080/
egov.billing.service.endpoint=http://billing-service.egov:8080/
egov.collection.service.endpoint=http://collection-services.egov:8080/
egov.egf.master.service.endpoint=http://egf-master.egov:8080/
egov.egf.instrument.service.endpoint=http://egf-instrument.egov:8080/
egov.mdms.service.endpoint=http://egov-mdms-service.egov:8080/
egov.indexer.service.endpoint=http://egov-indexer.egov:8080/
egov.services.billing.service.bill.generate=billing-service/bill/v2/_fetchbill
egov.filestore.service.endpoint=http://egov-filestore.egov:8080/ |
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
...
language | json |
---|
...
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
Code Block |
---|
{ "info": { "_postman_id": "81469f7c-793c-43b2-8e05-9ce6c8174cd4", "name": "SIUSER_Creation", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "createnovalidate", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"RequestInfo\": {\n \"api_id\": \"1\",\n \"ver\": \"1\",\n \"ts\": null,\n \"action\": \"create\",\n \"did\": \"\",\n \"key\": \"\",\n \"msg_id\": \"\",\n \"requester_id\": \"\",\n \"auth_token\": \"12e8753e-099f-42cb-b2ec-402b10215610\"\n },\n \"User\": {\n \"userName\": \"SIFINANCE\",\n \"name\": \"SYS INTG FINANCE\",\n \"gender\": \"Male\",\n \"mobileNumber\": \"\",\n \"active\": true,\n \"type\": \"SYSTEM\",\n \"password\": \"sifinance123@\",\n \"tenantId\":\"pg.citya\",\n \"roles\": [\n {\n "code": "pb.jalandhar" }, \"tenantId\": \"pg.citya\",\n { \"code\": "pb.nawanshahr"\"SYS_INTEGRATOR_FINANCE\",\n } ] }, |
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.
...
\"name\": \"System Integrator Finance\"\n }\n ]\n }\n}\n"
},
"url": {
"raw": "https://egov-micro-qa.egovernments.org/user/users/_createnovalidate",
"protocol": "https",
"host": [
"egov-micro-qa",
"egovernments",
"org"
],
"path": [
"user",
"users",
"_createnovalidate"
]
},
"description": "user create with no OTP validation"
},
"response": []
}
]
} |
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 either in the finance service values yaml file or the environment specific yaml file.
Code Block |
---|
finance: true |
File store Configuration
Configure the following property either in the finance service values yaml file or the environment specific yaml file.
Code Block | ||
---|---|---|
| ||
filestore: /tmp/egovfilestore |
Quartz Scheduler Configuration
Configure the following property either in the finance service values yaml file or the environment specific yaml file.
Code Block | ||
---|---|---|
| ||
scheduler: true |
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.
Code Block |
---|
microservice: |
egov.default.services.endpoint=https://egov-micro-dev.egovernments.org/
egov.hrms.service.endpoint=http://egov-hrms.egov:8080/
egov.accesscontrol.service.endpoint=http://egov-accesscontrol.egov:8080/
egov.hr.masters.service.endpoint=http://hr-masters.egov:8080/
egov.user.service.endpoint=http://egov-user.egov:8080/
egov.common.masters.endpoint=http://egov-common-masters.egov:8080/
egov.billing.service.endpoint=http://billing-service.egov:8080/
egov.collection.service.endpoint=http://collection-services.egov:8080/
egov.egf.master.service.endpoint=http://egf-master.egov:8080/
egov.egf.instrument.service.endpoint=http://egf-instrument.egov:8080/
egov.mdms.service.endpoint=http://egov-mdms-service.egov:8080/
egov.indexer.service.endpoint=http://egov-indexer.egov:8080/
egov.services.billing.service.bill.generate=billing-service/bill/v2/_fetchbill
egov.filestore.service.endpoint=http://egov-filestore.egov:8080/ |
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
Code Block | ||
---|---|---|
| ||
{
"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.
MDMS serach url is configured in the Application Configuration file.
Sub domain formation logic in front end employee app
Finance coexistence follows schema per ulb structure and each city requires one sub domain. Sub domain formation for the different environments is happening dynamically by reading the environment value from the FIN_ENV environment variable in the js file.
The following code snippet shows the sub domain formation logic
Code Block | ||
---|---|---|
| ||
locale = localStorage.getItem("locale"),
menuUrl = this.props.location.pathname,
loc = window.location,
subdomainurl,
domainurl,
finEnv,
hostname = loc.hostname,
winheight = window.innerHeight - 100,
erp_url,
tenantId = getTenantId();
domainurl = hostname.substring(hostname.indexOf(".") + 1);
finEnv = this.globalConfigExists() ? window.globalConfigs.getConfig("FIN_ENV") : process.env.REACT_APP_FIN_ENV;
subdomainurl = !!(finEnv) ? "-" + finEnv + "." + domainurl : "." + domainurl;
erp_url = loc.protocol + "//" + getTenantId().split(".")[1] + subdomainurl + menuUrl;
console.log("ERP URL : " + erp_url); |
The FIN_ENV variable is configurable and configured in the globalConfigs.js which is present (to be created if not present) in the S3 Bucket. The following code snippet shows the same.
Code Block |
---|
var globalConfigs = (function() {
var stateTenantId = 'pb'
var finEnv = 'dev'
var getConfig = function(key) {
if(key === 'STATE_LEVEL_TENANT_ID'){
return stateTenantId;
} else if(key === 'FIN_ENV'){
return finEnv;
}
};
return {
getConfig
};
}()); |
The following are some examples
Code Block | ||
---|---|---|
| ||
EX 1:
Domain url : citya.digit.org
Sub domain url: citya-uat.digit.org
Then configure the FIN_ENV variable as 'uat' like below
FIN_ENV='uat'
EX 2:
Domain url : staging.digit.org
Sub domain url: citya.digit.org
Then configure the FIN_ENV variable as 'uat' like below
FIN_ENV=''
EX 3:
Domain url : dev.digit.org
Sub domain url: amritsar-dev.digit.org
Then configure the FIN_ENV variable as 'uat' like below
FIN_ENV='dev'
|
The globalConfigs.js file is custom injected in the environment specific yaml files. The following code snippet shows the same.
Code Block | ||
---|---|---|
| ||
employee:
custom-js-injection: |
sub_filter.conf: "
sub_filter '<head>' '<head>
<script src=https://s3.ap-south-1.amazonaws.com/egov-telemetry-data/egov-telemetry-1557467338.js type=text/javascript></script>
<script src=https://s3.ap-south-1.amazonaws.com/egov-dev-assets/globalConfigs.js type=text/javascript></script>
<link rel=stylesheet href=https://egov-dev-assets.s3.ap-south-1.amazonaws.com/dashboard-iframe-fix.css>
';"
|
The sample environment yaml files for your reference
Code Block | ||
---|---|---|
| ||
https://github.com/egovernments/Train-InfraOps/blob/master/helm/environments/dev.yaml |
Changes required to setup workspace in local machine
...
Title | Link |
---|---|
API Contracts | |
Co-existence finance code available | |
Sample client implementation repository | |
Configuring MDMS | |
Adding new service and CI/CD |