Trade License - State DSS - Technical Documentation
Trade License Documentation
DSS has two sides to it. One being the process in which the Data is pooled to ElasticSearch and the other being the way it is fetched, aggregated, computed, transformed and sent across.
As this revolves around a variety of Data Set, there is a need for making this configurable. So that, tomorrow, given a new scenario is introduced, then it is just a configuration away from getting the newly introduced scenario involved in this flow of process.
This document explains the steps on how to define the configurations for Analytics Side Of DSS for W&S.
What is analytics?
Analytics : Micro Service which is responsible for building, fetching, aggregating and computing the Data on ElasticSearch to a consumable Data Response. Which shall be later used for visualizations and graphical representations.
Analytics Configurations:
Analytics contains multiple configurations. we need to add the changes related to mCollect in this dashboard-analytics.
Here is the location : https://github.com/egovernments/configs/tree/qa/egov-dss-dashboards/dashboard-analytics
Below is a list of configurations that need to be changed to run W&S successfully.
Chart API Configuration
Master Dashboard Configuration
Role Dashboard Mappings Configuration
Description :
Chart API Configuration :
Each Visualization has its own properties. Each Visualization comes from different data sources (Sometimes it is a combination of different data sources)
In order to configure each visualization and their properties, we have a Chart API Configuration Document.
In this, Visualization Code, which happens to be the key, will be having its properties configured as a part of configuration and are easily changeable.
Here is the sample ChartApiConfiguration.json data for the trade license.
"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" : "year"
},
"_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.city.districtCode\"}",
"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.applicationNumber.keyword\"}}}}}}}}"
}
],
"chartType": "pie",
"valueType": "number",
"action": "",
"documentType": "_doc",
"drillChart": "none",
"aggregationPaths": [
"Status"
],
"insight": {
},
"_comment": " License Application which are issued by License Type"
}
Click here for complete configuration
Master Dashboard Configuration:
Master Dashboard Configuration is the main configuration which defines as which are the Dashboards which are to be painted on screen.
It includes all the Visualizations, their groups, the charts which comes within them and even their dimensions as what should be their height and width.
{
"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": "todaysCollection",
"name": "DSS_TOTAL_COLLECTION_TODAY",
"code": "",
"chartType": "metric",
"filter": {"title": "TODAY"},
"headers": []
},
{
"id": "totalCollection",
"name": "DSS_TOTAL_COLLECTION",
"code": "",
"chartType": "metric",
"filter": "",
"headers": []
},
{
"id": "targetCollection",
"name": "DSS_TARGET_COLLECTION",
"code": "",
"chartType": "metric",
"filter": "",
"headers": []
},
{
"id": "targetAchieved",
"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": "cumulativeCollection",
"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": "topPerformingUlbs",
"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": "bottomPerformingUlbs",
"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": true,
"isCollapsible": false,
"charts": [
{
"id": "licenseByLicenseType",
"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": "licenseIssuedDDRRevenue",
"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": "licenceTaxHeadsBreakupDDR",
"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"
}
]
}
]
}
]
}
Click here for complete configuration
Role Dashboard Mappings Configuration:
Master Dashboard Configuration which was explained earlier hold the list of Dashboards which are available.
Given the instance where Role Action Mapping is not maintained in the Application Service, this configuration will act as Role - Dashboard Mapping Configuration
In this, each Role is mapped against the Dashboard which they are authorised to see.
This was used earlier when the Role Action Mapping of eGov was not integrated.
Later, when the Role Action Mapping started controlling the Dashboards to be seen on the client side, this configuration was just used to enable the Dashboards for viewing.
{
"_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": 6,
"roleName" : "Admin",
"isSuper" : "",
"orgId": "",
"dashboards": [
{
"name": "Trade License",
"id": "tradeLicense"
}
]
},
{
"_comment":"This role is super role which can access all the available dashboards: [other/new roles are suppose to be added]",
"roleId": 7,
"roleName" : "Commissioner",
"isSuper" : "",
"orgId": "",
"dashboards": [
{
"id": "ulb-tradeLicense"
}
]
}
]
}
Click here for complete configuration
MDMS Configuration to be added:
common-masters/uiCommonConstants.json
MDMS Configuration to be added:
common-masters/uiCommonConstants.json
Click here for complete configuration
roleaction.json
Click here for complete configuration
Action test.json
Click here for complete configuration
mCollect-DSS Consists of multiple graphs which represent the data of Trade License. Each graph has its own configuration which will describe the chart and its type.
DSS Consists of following charts in trade license:
Revenue Tab
Overview
Total Cumulative Collection
Top 3 performing ULBs
Bottom 3 performing ULBs
Collection By Trade Type
Key Financial Indicators
Tax Heads Breakup
Service Tab
Overview
Total Cumulative Licenses Issued
Top 3 performing ULBs (sla)
Bottom 3 performing ULBs (sla)
Trade License by Status
Status By Boundary
Overview
Todays' Collection : Shows today’s collection for trade license
Total Collection : Shows total collection in the financial year for trade license
Target Collection : Shows target collection for the financial year
Target Achievement : Ratio of total collection to target collection
Total Cumulative Collection
This Graph contains the trade license collection amount information in the monthly base as a cumulative line graph. This will change as per the denomination amount filter selection.
line - this graph/chart is data representation on date histograms or date groupings.
Top 3 performing ULBs
The metric shows the top 3 performing ulbs according to target achievement.
Bottom 3 performing ULBs
The metric shows bottom 3 performing ULBs according to target achievement.
Collection By Trade Type
The metric shows the collection grouped according to the trade type
Key Financial Indicators
This table show the key financial indicators of the trade license service such as total collection, target collection, target achievement, total licenses issued and total transactions.
Clicking on any district shows a drill down of all the ULBs in that district.
Clicking on any ULB drills down to the ward level information.
Tax Heads Breakup
This table shows the data such as tax, penalty, rebate and total amount in a tabular format.
Clicking on a district drills down to ULB level information
Overview (Service)
Total applications : Shows a count of the total applications issued in that financial year
Total Licenses Issued : Shows a total count of licenses issued in that financial year.
Total active ULBs : Count of the total active ULBs
Total Cumulative Licenses Issued
Shows the monthly cumulative data of total applications created and total licenses issued.
Top 3 performing ULBs (sla)
Shows the top 3 performing ULBs according to sla achieved (# of licenses issued within sla / # of licenses issued)
Bottom 3 performing ULBs (sla)
Shows the bottom 3 performing ULBs according to sla achieved (# of licenses issued within sla / # of licenses issued)
Trade Licenses By Status
This metric shows the total trade licenses issued grouped according to their status
Status By Boundary.
This metric shows the total licenses issued by status in a tabular format.
Common Properties available:
Key(eg: fsmTotalrequest) : This is the Visualization Code. This key will be referred to in further visualization configurations.
This is the key which will be used by the client application to indicate which visualization is needed for display.
chartName : The name of the Chart which has to be used as a label on the Dashboard. The name of the Chart will be a detailed name.
In this configuration, the Name of the Chart will be the code of Localization which will be used by Client Side.
queries : Some visualizations are derived from a specific data source. While some others are derived from different data sources and are combined together to get a meaningful representation.
The queries of aggregation which are to be used to fetch out the right data in the right aggregated format are configured here.
queries.module : The module / domain level, on which the query should be applied on.
queries.indexName : The name of the index upon which the query has to be executed is configured here.
queries.aggrQuery : The aggregation query in itself is added here. Based on the Module and the Index name specified, this query is attached to the filter part of the complete search request and then executed against that index
queries.requestQueryMap : Client Request would carry certain fields which are to be filtered. The parameters specified in the Client Request are different from the parameters in each of these indexed documents.
In order to map the parameters of the request to the parameters of the ElasticSearch Document, this mapping is maintained.
queries.dateRefField : Each of these modules have separate indexes. And all of them have their own date fields.
When there is a date filter applied against these visualizations, each of them has to apply it against their own date reference fields.
In order to maintain what is the date field in which index, we have this configured in this configuration parameter.
chartType : As there are different types of visualizations, this field defines what is the type of chart / visualization that this data should be used to represent.
Chart types available are:
metric - this represents the aggregated amount/value for records filter by the aggregate es query
pie - this represents the aggregated data on grouping. This is can be used to represent any line graph, bar graph, pie chart or donuts
line - this graph/chart is data representation on date histograms or date groupings
perform - this chart represents groping data as performance wise.
table - represents a form of plots and value with headers as grouped on and list of its key, values pairs.
xtable - represents a advanced feature of table, it has addition capabilities for dynamic adding header values.
valueType : In any case of data, the values which are sent to plot, might be a percentage, sometimes an amount and sometimes it is just a count.
In order to represent them and differentiate the numbers from amount from percentage, this field is used to indicate the type of value that this Visualization will be sending.
action : Some of the visualizations are not just aggregation on data source. There might be some cases where we have to do a post aggregation computation.
documentType : The type of document upon which the query has to be executed is defined here.
drillChart : If there is a drill down on the visualization, then the code of the Drill Down Visualization is added here. This will be used by Client Service to manage drill downs.
aggregationPaths : All the queries will be having Aggregation names in it. In order to fetch the value out of each Aggregation Responses, the name of the aggregation in the query will be an easy bet. These aggregation paths will have the names of Aggregation in it.
insights : It is to show the data with the comparison of last year with arrow symbols, it will show the data in how much % is increased or decreased.
_comment : In order to display information on the “i” symbol of each visualization, Visualization Information is maintained in this field.