All pages
Powered by GitBook
1 of 20

FSM Core Service Configuration

Learn how to setup and configure FSM service

Overview

Faecal sludge management (FSM) is a system that enables citizens to raise a request for septic tank cleaning with their urban local bodies (ULBs) directly or reaching out to the ULB counter. Citizens can track the application, make a payment for the charges and rate the service. This document contains details on how to set up FSM, and describes the functionalities it provides. It contains the details about the feature enhancements being released as part of FSM v1.3.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met:

  • Java 8

  • Kafka server is up and running

  • egov-persister service is running and has fsm-persister config path added in it

  • PSQL server is running and a database is created to store FSM Application data

  • (Optional) Indexer config for FSM is added in egov-indexer yaml paths to index the generated data. An index is required for data visualisation in kibana or in DSS.

  • Following services should be up and running:

    • egov-user

    • egov-workflow-v2

    • egov-perister

    • egov-localisation

    • egov-notification-sms

    • egov-mdms

    • egov-idgen

    • egov-url-shortening

    • vehicle

    • vendor

    • fsm-calculator

    • billing-service

    • collection-services

Key Functionalities

  • Citizens can file, track and rate the application for cleaning septic tank.

  • A ULB employee can file application for cleaning septic tank on behalf of a citizen.

  • A ULB employee can assign a DSO to the given application with a possible service date.

  • A DSO can accept or reject the application.

  • A DSO or a ULB employee can complete the FSM application after cleaning the septic tank.

  • The FSM admin in a ULB can cancel the application at any stage before completing the application.

  • A ULB employee or an admin can view the audit log of the given application.

  • Capture citizen gender information if not present or pre-populate the gender information when a citizen is creating the FSM application.

  • Add citizen's choice for payment.

  • Introducing pre-pay and post-pay service.

  • Post-pay service: Workflow changes (Desludging application and vehicle trip).

  • Post-pay service: Employee flow enhancements.

  • Add payment selection for DSO.

  • Post-pay service: Number of trips is editable, and price calculation will be now based on the number of trips entered by the DSO.

  • Capture DSO and FSTPO gender.

  • Show citizen gender on FSM DSS.

  • Select vehicle capacity instead of vehicle make.

  • Citizen Notifications | Payment Options | Timeline Enhancements.

  • FSTPO vehicle log inbox enhancements.

  • FSTPO can decline the vehicle trip.

  • Add owner attribute for vehicles.

  • Add ULB contact details in the FSM application flow.

  • DSO can edit pit and property usage details.

  • Show vehicle trip status in employee inbox along with the desludging application.

  • Unrestricted assignment of service requests to a single vehicle.

  • Vehicle logging at FSTP decoupled from the FSM module.

  • Photo and attachment view in the application of the ULB employee UI.

  • Dashboard enhancement.

  • Advance pay service: Employee flow enhancements.

  • Introduced two new workflows in the system:

- FSM_ADVANCE_PAY_SERVICE and FSM_ZERO_PAY_SERVICE .

  • Advance pay service: The number of trips is made editable (increase or decrease based on the requirement), and price calculation will be now based on number of trips entered by the DSO or ULB.

  • Allowed to pay part payment while creating the application.

  • ULB and DSO are allowed to decrease the number of trips if not required and if full payment is not done.

  • ULB and DSO are allowed to increase or decrease the number of trips n number of times.

  • With the updated number of trips, an updated bill will be generated.

  • Delink the payment from DSO in progress state.

  • Zero pay service: Employee flow enhancements.

  • Zero pay service: System now skips the collection, and will not generate the demand for zero price application.

  • Demand generation process: Generating demand every time the trip is updated.

  • Demand generation process: Added validation not to complete the application from ULB side before completing all payment.

  • Enhancement of FSM receipt.

Deployment Details

  1. Deploy the latest version of FSM.

  2. Add fsm-persister.yml file in the config folder in git and add that path in persister (the file path is to be added in environment yaml file in param called persist-yml-path), and restart the egov-persister service.

  3. If index are to be created, add the indexer config path in the indexer service (the file path is to be added in environment yaml file in param called egov-indexer-yaml-repo-path), and restart egov-indexer service.

Configuration Details

Make changes in config accordingly and restart the pdf-services.

1 . pdf-service/format-config/fsm-receipt.json

#SM-1265 FSM V1.2: ULB collecting advance Receipt Page · egovernments/configs@57259f7

#SM-1265 pdf Receipt table alignment · egovernments/configs@1e0625e

https://github.com/egovernments/configs/commit/1b3c14bfcf74ec23e30aed1910dfe0d016439543

https://github.com/egovernments/configs/commit/f6f7f513799dfcae80817fe1f1866d0084291006

2 . pdf-service/data-config/fsm-receipt.json

#SM-1265 FSM V1.2: ULB collecting advance Receipt Page · egovernments/configs@ed9220a

https://github.com/egovernments/configs/commit/2a221ad39756c2ca4476c0669c2f4f79c3ce958e

https://github.com/egovernments/configs/commit/a07318256f21240df71f87af21acd3dc56fb1118

https://github.com/egovernments/configs/commit/e307007a6e9f69f32134caac7d3b571411dfa840

egov-persister/fsm-persister.yaml

#807 updating advance amount column · egovernments/configs@413c9d1

https://github.com/egovernments/configs/commit/89ab16cc3c58d161183a58e85d4d9fdbe32a67f5

https://github.com/egovernments/configs/commit/4c3acfe57d9ef6770a814d9e3d8bd88493e5c4bb

MDMS Configuration

Add master data in MDMS service with module name as FSM and restart the egov-mdms-service. Following is a sample master data for Application Channel (Source).

{
    "tenantId": "pb",
    "moduleName": "FSM",
    "ApplicationChannel": [
        {
            "name": "Telephone",
            "code": "TELEPHONE",
            "active": true,
            "citizenOnly":false
        },
        {
            "name": "Counter",
            "code": "COUNTER",
            "active": true,
            "citizenOnly":false
        },
        {
            "name": "Online",
            "code": "ONLINE",
            "active": true,
            "citizenOnly":true
        }
    ]
}

Checklist (To be answered by a citizen while rating)

{
	"tenantId": "pb",
	"moduleName": "FSM",
	"CheckList": [{
			"code": "SPILAGE",
			"active": true,
			"required": true,
			"type": "SINGLE_SELECT",
			"options": [
				"YES",
				"NO",
				"NA"
			]
		},
		{
			"code": "SAFETY_GEARS_USED",
			"active": true,
			"type": "MULTI_SELECT",
			"required": true,
			"options": [
				"EYE_GEAR",
				"HAND_GLOVES",
				"NOSE_MASK"
			]
		},
		{
			"code": "NUMBER_OF_TRIPS",
			"active": true,
			"type": "DROP_DOWN",
			"required": false,
			"options": [
				"1",
				"2",
				"3",
				"4",
				"5",
				"6",
				"7",
				"8",
				"9",
				"10"
			]
		}
	]
}

Configuration (At the application level)

{
    "tenantId": "pb",
    "moduleName": "FSM",
    "Config": [
        {
            "code":"noOfTrips",
            "override":true,
            "default":1,
            "active":true,
            "description":"override:true indicates, noOfTrips poperty is allowed to override in FSM."
        },
        {
            "code":"additionalDetails.tripAmount",
            "override":false,
            "active":true,
            "description":"override:true indicates, tripAmount poperty is allowed to override in FSM."
        },
        {
            "code":"slumName",
            "override":true,
            "active":true,
            "description":"override:true indicates, tripAmount poperty is allowed to override in FSM."
        },
        {
            "code":"ALLOW_MODIFY",
            "WFState":"CREATED",
            "override":[
                "propertyUsage",
                "vehicleType",
                "sanitationtype",
                "address.pincode",
                "address.city",
                "address.locality",
                "address.street",
                "address.doorNo",
                "address.landmark",
                "pitDetail"
            ],
            "active":true,
            "description":"properties in override allowed to modify when FSM application moving from CREATED Status to next status."
        }
        
    ]
}

FSTP Plant Information (For each city)

{
    "tenantId": "pb",
    "moduleName": "FSM",
    "FSTPPlantInfo": [
        {
            "PlantCode": "AMR001",
            "PlantName": "Amritsar FSTP",
            "active": true,
            "PlantType":"FSTP",
            "PlantLocation":"Amritsar",
            "PlusCode":"JQ2R+7G Khapar Kheri, Punjab",
            "PlantOperationalTimings":"10.00am-08.00pm",
            "PlantOperationalCapacityKLD":"50",
            "ULBS":"pb.jalandhar,pb.amritsar,pb.nayagaon"
        },
        {
            "PlantCode": "MOH002",
            "PlantName": "Mohali SeTPP",
            "active": true,
            "PlantType":"SeTP",
            "PlantLocation":"Mohali",
            "PlusCode":"MPFQ+V2 Sahibzada Ajit Singh Nagar, Punjab",
            "PlantOperationalTimings":"10.00am-06.00pm",
            "PlantOperationalCapacityKLD":"100",
            "ULBS":"pb.mohali,pb.phagwara,pb.nawanshahr,pb.derabassi"
        }
    ]
}

Pit Type (Type of pit)

{
    "tenantId": "pb",
    "moduleName": "FSM",
    "PitType": [
        {
            "name": "Conventional septic tank",
            "code": "CONVENTIONAL_SPECTIC_TANK",
            "active": true,
            "dimension":"lbd"
        },
        {
            "name": "Septic tank with soak pit",
            "code": "SEPTIC_TANK_WITH_SOAK_PIT",
            "active": true,
            "dimension":"dd"
        }
    ]
}

Property Type

{
  "tenantId": "pb",
  "moduleName": "FSM",
  "PropertyType": [
    {
      "name": "Residential",
      "code": "RESIDENTIAL",
      "active": true,
      "minAmount":"100",
      "maxAmount":"500"
    },
     {
      "name": "Independent House",
      "code": "RESIDENTIAL.INDEPENDENT_HOUSE",
      "active": true,
      "propertyType": "RESIDENTIAL",
      "minAmount":"100",
      "maxAmount":"300"
    },
    {
      "name": "Apartment",
      "code": "RESIDENTIAL.APARTMENT",
      "active": true,
      "propertyType": "RESIDENTIAL",
      "minAmount":"400",
      "maxAmount":"600"
    },
    {
      "name": "Row Houses",
      "code": "RESIDENTIAL.ROW_HOUSES",
      "active": true,
      "propertyType": "RESIDENTIAL",
      "minAmount":"700",
      "maxAmount":"900"
    },
    {
      "name": "Commercial",
      "code": "COMMERCIAL",
      "active": true,
      "minAmount":"2000",
      "maxAmount":"5000"
    },
    {
      "name": "Community Toilets",
      "code": "COMMERCIAL.COMMUNITY_TOILETS",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"1000",
      "maxAmount":"1200"
    },
    {
      "name": "Hotel",
      "code": "COMMERCIAL.HOTEL",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"1300",
      "maxAmount":"1500"
    },
    {
      "name": "Restaurant",
      "code": "COMMERCIAL.RESTAURANT",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"1600",
      "maxAmount":"1800"
    },
    {
      "name": "Shopping Mall",
      "code": "COMMERCIAL.SHOPPING_MALL",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"1900",
      "maxAmount":"2100"
    },
    {
      "name": "Community hall",
      "code": "COMMERCIAL.COMMUNITY_HALL",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"2200",
      "maxAmount":"2500"
    },
    {
      "name": "Bank",
      "code": "COMMERCIAL.BANK",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"2600",
      "maxAmount":"2800"
    },
    {
      "name": "Private office",
      "code": "COMMERCIAL.PRIVATE_OFFICE",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"2900",
      "maxAmount":"3200"
    },
    {
      "name": "Market",
      "code": "COMMERCIAL.MARKET",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"3300",
      "maxAmount":"3500"
    },
    {
      "name": "Hostel",
      "code": "COMMERCIAL.HOSTEL",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"3600",
      "maxAmount":"3900"
    },
    {
      "name": "Warehouse",
      "code": "COMMERCIAL.WAREHOUSE",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"400",
      "maxAmount":"4200"
    },
    {
      "name": "Petrol pumps",
      "code": "COMMERCIAL.PETROL_PUMPS",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"4300",
      "maxAmount":"4500"
    },
    {
      "name": "Resort",
      "code": "COMMERCIAL.RESORT",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"4600",
      "maxAmount":"4800"
    },
    {
      "name": "Theme park",
      "code": "COMMERCIAL.THEME_PARK",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"4900",
      "maxAmount":"5100"
    },
    {
      "name": "Sports center",
      "code": "COMMERCIAL.SPORTS_CENTER",
      "active": true,
      "propertyType": "COMMERCIAL",
      "minAmount":"5200",
      "maxAmount":"5500"
    },
     {
      "name": "Institutional",
      "code": "INSTITUTIONAL",
      "active": true,
      "minAmount":"1000",
      "maxAmount":"3000"
    },
     {
      "name": "Temple",
      "code": "INSTITUTIONAL.TEMPLE",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"5600",
      "maxAmount":"5900"
    },
     {
      "name": "Mosque",
      "code": "INSTITUTIONAL.MOSQUE",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"6000",
      "maxAmount":"6200"
    },
     {
      "name": "Church",
      "code": "INSTITUTIONAL.CHURCH",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"6300",
      "maxAmount":"6500"
    },
     {
      "name": "Gurudwara",
      "code": "INSTITUTIONAL.GURUDWARA",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"6600",
      "maxAmount":"6800"
    },
     {
      "name": "Monastery",
      "code": "INSTITUTIONAL.MONASTERY",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"6900",
      "maxAmount":"7200"
    },
     {
      "name": "School",
      "code": "INSTITUTIONAL.SCHOOL",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"7300",
      "maxAmount":"7500"
    },
     {
      "name": "College",
      "code": "INSTITUTIONAL.COLLEGE",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"7600",
      "maxAmount":"7900"
    },
     {
      "name": "University",
      "code": "INSTITUTIONAL.UNIVERSITY",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"8000",
      "maxAmount":"8200"
    },
     {
      "name": "Anganwadi",
      "code": "INSTITUTIONAL.ANGANWADI",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"8300",
      "maxAmount":"8500"
    },
     {
      "name": "Training Institutes",
      "code": "INSTITUTIONAL.TRAINING_INSTITUTES",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"8600",
      "maxAmount":"8800"
    },
     {
      "name": "Hospital",
      "code": "INSTITUTIONAL.HOSPITAL",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"8900",
      "maxAmount":"9200"
    },
     {
      "name": "Nursing home",
      "code": "INSTITUTIONAL.NURSING_HOME",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"9300",
      "maxAmount":"9500"
    },
     {
      "name": "Community health center",
      "code": "INSTITUTIONAL.COMMUNITY_HEALTH_CENTER",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"9400",
      "maxAmount":"9600"
    },
     {
      "name": "Jail",
      "code": "INSTITUTIONAL.JAIL",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"9700",
      "maxAmount":"1000"
    },
     {
      "name": "Police station",
      "code": "INSTITUTIONAL.POLICE_STATION",
      "active": true,
      "propertyType": "INSTITUTIONAL",
      "minAmount":"10100",
      "maxAmount":"10500"
    }
  
  ]
}

Slums (Mapped to the locality of the city)

{
	"tenantId": "pb",
	"moduleName": "FSM",
	"Slum": [{
			"code": "SL0001",
			"active": true,
			"name": "Kathagada juanga sahi",
			"locality": "SUN20"
		},
		{
			"code": "SL0002",
			"active": true,
			"name": "Kathagada Parbatia Sahi",
			"locality": "SUN20"
		},
		{
			"code": "SL0003",
			"active": true,
			"name": "Gangadhar Sahi",
			"locality": "SUN35"
		},
		{
			"code": "SL0004",
			"active": true,
			"name": "Pandab Nagar",
			"locality": "SUN35"
		},
		{
			"code": "SL0005",
			"active": true,
			"name": "Haridakhandi Harijana sahi",
			"locality": "SUN35"
		},
		{
			"code": "SL0006",
			"active": true,
			"name": "Haridakhandi Kadalibada Sahi",
			"locality": "SUN55"
		},
		{
			"code": "SL0007",
			"active": true,
			"name": "Haridakhandi Bada sahi",
			"locality": "SUN55"
		},
		{
			"code": "SL0008",
			"active": true,
			"name": "Haridakhandi Redika Sahi",
			"locality": "SUN55"
		},
		{
			"code": "SL0009",
			"active": true,
			"name": "Golapali Sahi",
			"locality": "SUN18"
		},
		{
			"code": "SL0010",
			"active": true,
			"name": "Surya Nagar",
			"locality": "SUN18"
		},
		{
			"code": "SL0011",
			"active": true,
			"name": "Damba Sahi",
			"locality": "SUN18"
		},
		{
			"code": "SL0012",
			"active": true,
			"name": "Raju Dhoba Sahi",
			"locality": "SUN08"
		}
	]
}

PaymentType (Payment preference type)

{
    "tenantId": "pb",
    "moduleName": "FSM",
    "PaymentType": [
        {
            "name": "Pay Now",
            "code": "PRE_PAY",
            "active": true
        },
        {
            "name": "Pay on Service",
            "code": "POST_PAY",
            "active": true
        }
    ]
}

data/pg/FSM/ReceivedPaymentType.json

https://github.com/egovernments/egov-mdms-data/commit/4c028a70ccb715df9574d86dc99d11d93057d30e

https://github.com/egovernments/egov-mdms-data/commit/5a190371c2305131eac40b87b41c7b3f0eef092c

data/pg/FSM/CommonFieldsConfig.json

https://github.com/egovernments/egov-mdms-data/commit/4fac292e055665e5fbe4bfeaa7991c574a2289dc

FSM Persister YML

Integrate following below changes in fsm-persister.yml https://github.com/egovernments/configs/commit/634a4fdd842ec69bdf735e8c985e36499661512f

data/pb/BillingService/BusinessService.json

Update BusinessService.json · egovernments/egov-mdms-data@96cd829

data/pb/DIGIT-UI/RoleStatusMapping.json

#SM-528 updating the status role for fsm collector · egovernments/egov-mdms-data@0d4b0c7

data/pb/BillingService/BusinessService.json

#SM-1435 added minAmountpayable in fsm · egovernments/egov-mdms-data@13e867b

data/pb/amritsar/FSM/ZeroPricing.json

https://github.com/egovernments/egov-mdms-data/commit/bccf684bd1343b3d280c1b87b1f03dcf62c96159

https://github.com/egovernments/egov-mdms-data/commit/7f3e6a02fc62bfdd9ee38dce2da9572ca9885866

data/pb/ACCESSCONTROL-ACTIONS-TEST/actions-test.json

https://github.com/egovernments/egov-mdms-data/commit/06a1bcaca5693a6037cce52eecd53083dd6bd26fDashboard Analytics Configuration

Following are the changes that need to be integrated in dashboard-analytics, and restart the “dashboard-analytics” service

egov-dss-dashboards/dashboard-analytics/ChartApiConfig.json

https://github.com/egovernments/configs/commit/2ae2feecd343d17b908820b86664cee38293a719

https://github.com/egovernments/configs/commit/18e547df409b625b0934e4dc7251590c5f834f83

https://github.com/egovernments/configs/commit/f05d41d983a9ec5381183d3f26497dc2295ad169

https://github.com/egovernments/configs/commit/47c3592252b4236b9a785adf6dd7d0b4dd66e482

https://github.com/egovernments/configs/commit/5b716c195766a573fb542e41d3ca94b54b6aa248

egov-dss-dashboards/dashboard-analytics/MasterDashboardConfig.json

https://github.com/egovernments/configs/commit/c1c4b2ed5e5eb1b153c2648c3307f006566a5a6b

egov-indexer/egov-vehicle.yaml

https://github.com/egovernments/configs/commit/3d9faae0f42550a4e15dcad69630846ba0482de8

Business Service/Workflow Configuration

Create businessService (workflow configuration) using the /businessservice/_create. Following is the product configuration for FSM:

{
  "RequestInfo": {
    "apiId": "Rainmaker",
    "action": "",
    "did": 1,
    "key": "",
    "msgId": "20170310130900|en_IN",
    "requesterId": "",
    "ts": 1513579888683,
    "ver": ".01",
    "authToken": "{{devAuth}}",
    "userInfo": {
      "id": 73,
      "userName": null,
      "name": null,
      "type": "EMPLOYEE",
      "mobileNumber": null,
      "emailId": null,
      "roles": [
        {
          "id": 2,
          "name": "Customer Support Representative",
          "code": null,
          "tenantId": null
        }
      ],
      "tenantId": null,
      "uuid": "uuid"
    }
  },
  "BusinessServices": [
        {
            "tenantId": "pb",
            "businessService": "FSM",
            "business": "fsm",
            "businessServiceSla": 172800000,
            "states": [
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": null,
                    "applicationStatus": null,
                    "docUploadRequired": false,
                    "isStartState": true,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "action": "APPLY",
                            "nextState": "PENDING_APPL_FEE_PAYMENT",
                            "roles": [
                                "FSM_CREATOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "action": "CREATE",
                            "nextState": "CREATED",
                            "roles": [
                                "CITIZEN"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CREATED",
                    "applicationStatus": "CREATED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "action": "REJECT",
                            "nextState": "REJECTED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "action": "SUBMIT",
                            "nextState": "PENDING_APPL_FEE_PAYMENT",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "PENDING_APPL_FEE_PAYMENT",
                    "applicationStatus": "PENDING_APPL_FEE_PAYMENT",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "action": "REJECT",
                            "nextState": "REJECTED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "action": "SENDBACK",
                            "nextState": "CREATED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "action": "PAY",
                            "nextState": "ASSING_DSO",
                            "roles": [
                                "CITIZEN",
                                "FSM_COLLECTOR"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "ASSING_DSO",
                    "applicationStatus": "ASSING_DSO",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "action": "ASSIGN",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_REJECTED",
                    "applicationStatus": "DSO_REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_INPROGRESS",
                    "applicationStatus": "DSO_INPROGRESS",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "DECLINE",
                            "nextState": "ASSING_DSO",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "COMPLETED",
                            "nextState": "CITIZEN_FEEDBACK_PENDING",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "PENDING_DSO_APPROVAL",
                    "applicationStatus": "PENDING_DSO_APPROVAL",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_REJECT",
                            "nextState": "DSO_REJECTED",
                            "roles": [
                                "FSM_DSO"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_ACCEPT",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                "FSM_DSO"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "COMPLETED",
                    "applicationStatus": "COMPLETED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false
                },
                {
                    "sla": null,
                    "state": "REJECTED",
                    "applicationStatus": "REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CANCELED",
                    "applicationStatus": "CANCELED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CITIZEN_FEEDBACK_PENDING",
                    "applicationStatus": "CITIZEN_FEEDBACK_PENDING",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": false,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "CITIZEN_FEEDBACK_PENDING",
                            "action": "RATE",
                            "nextState": "COMPLETED",
                            "roles": [
                                "CITIZEN"
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

For post-pay new business service, FSM_POST_PAY_SERVICE has been created. Create businessService (workflow configuration) using the /businessservice/_create. Following is the product configuration for FSM_POST_PAY_SERVICE:

{
  "BusinessServices": [
        {
            "tenantId": "pb",
            "businessService": "FSM_POST_PAY_SERVICE",
            "business": "fsm",
            "businessServiceSla": 172800000,
            "states": [
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": null,
                    "applicationStatus": null,
                    "docUploadRequired": false,
                    "isStartState": true,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
							"currentState": null,
                            "action": "APPLY",
                            "nextState": "ASSIGN_DSO",
                            "roles": [
                                "FSM_CREATOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
							"currentState": null,
                            "action": "CREATE",
                            "nextState": "CREATED",
                            "roles": [
                                "CITIZEN"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CREATED",
                    "applicationStatus": "CREATED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
							"currentState": "CREATED",
                            "action": "REJECT",
                            "nextState": "REJECTED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
							"currentState": "CREATED",
                            "action": "SUBMIT",
                            "nextState": "ASSIGN_DSO",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "ASSIGN_DSO",
                    "applicationStatus": "ASSIGN_DSO",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
							"currentState": "ASSIGN_DSO",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
							"currentState": "ASSIGN_DSO",
                            "action": "ASSIGN",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "PENDING_DSO_APPROVAL",
                    "applicationStatus": "PENDING_DSO_APPROVAL",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                       	{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_ACCEPT",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                 "FSM_DSO",
                                 "FSM_EDITOR_EMP"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_REJECT",
                            "nextState": "DSO_REJECTED",
                            "roles": [
                                 "FSM_DSO",
                                 "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
				 {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_REJECTED",
                    "applicationStatus": "DSO_REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ],
							"active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ],
							 "active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ],
							"active": true
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_INPROGRESS",
                    "applicationStatus": "DSO_INPROGRESS",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "DECLINE",
                            "nextState": "ASSIGN_DSO",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ]
                        },
                       
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "SCHEDULE",
                            "nextState": "PENDING_APPL_FEE_PAYMENT",
                            "roles": [
                                "FSM_EDITOR_EMP",
								"FSM_DSO"
							]
                        }
                    ]
                },
				{
                    "tenantId": "pb",
                    "sla": null,
                    "state": "PENDING_APPL_FEE_PAYMENT",
                    "applicationStatus": "PENDING_APPL_FEE_PAYMENT",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_APPL_FEE_PAYMENT",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ],
                            "active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_APPL_FEE_PAYMENT",
                            "action": "SENDBACK",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                "FSM_ADMIN"
                            ],
                            "active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_APPL_FEE_PAYMENT",
                            "action": "PAY",
                            "nextState": "DISPOSAL_IN_PROGRESS",
                            "roles": [
                                "CITIZEN",
                                "FSM_COLLECTOR"
                            ],
                            "active": true
                        }
                    ]
                },
				{
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DISPOSAL_IN_PROGRESS",
                    "applicationStatus": "DISPOSAL_IN_PROGRESS",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DISPOSAL_IN_PROGRESS",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ],
                            "active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DISPOSAL_IN_PROGRESS",
                            "action": "COMPLETED",
                            "nextState": "CITIZEN_FEEDBACK_PENDING",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ],
                            "active": true
                        }
                       
                    ]
                },
				{
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CITIZEN_FEEDBACK_PENDING",
                    "applicationStatus": "CITIZEN_FEEDBACK_PENDING",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": false,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "CITIZEN_FEEDBACK_PENDING",
                            "action": "RATE",
                            "nextState": "COMPLETED",
                            "roles": [
                                "CITIZEN"
                            ],
						    "active": true
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "COMPLETED",
                    "applicationStatus": "COMPLETED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
					"actions": null
                },
                {
                    "tenantId": "pb",
					"sla": null,
                    "state": "REJECTED",
                    "applicationStatus": "REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CANCELED",
                    "applicationStatus": "CANCELED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                }
                
            ]
        }
    ],
	 "RequestInfo": {
    "apiId": "Rainmaker",
    "authToken": "e37d7087-6436-492f-ad5b-692a515cba58",
    "userInfo": {
      "id": 24226,
      "uuid": "11b0e02b-0145-4de2-bc42-c97b96264807",
      "userName": "amr001",
      "name": "leela",
      "mobileNumber": "9814424443",
      "emailId": "leela@llgmail.com",
      "locale": null,
      "type": "EMPLOYEE",
      "roles": [
        {
          "name": "NoC counter employee",
          "code": "NOC_CEMP",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Grievance Routing Officer",
          "code": "GRO",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "WS Document Verifier",
          "code": "WS_DOC_VERIFIER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "autoescalation emp",
          "code": "AUTO_ESCALATE",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "FSM Employee Report Viewer",
          "code": "FSM_REPORT_VIEWER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "PGR Last Mile Employee",
          "code": "PGR_LME",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "TL Field Inspector",
          "code": "TL_FIELD_INSPECTOR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "BPA Field Inspector",
          "code": "BPA_FIELD_INSPECTOR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "TL Approver",
          "code": "TL_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "BPA Services Approver",
          "code": "BPA_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Fire Noc Department Approver",
          "code": "FIRE_NOC_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Field Employee",
          "code": "FEMP",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Counter Employee",
          "code": "CEMP",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "WS Counter Employee",
          "code": "WS_CEMP",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "BPAREG Approver",
          "code": "BPAREG_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "WS Field Inspector",
          "code": "WS_FIELD_INSPECTOR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Collection Operator",
          "code": "COLL_OPERATOR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "TL doc verifier",
          "code": "TL_DOC_VERIFIER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "CSC Collection Operator",
          "code": "CSC_COLL_OPERATOR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Employee",
          "code": "EMPLOYEE",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "TL Counter Employee",
          "code": "TL_CEMP",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "FSM Desluding Operator",
          "code": "FSM_DSO",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "TL Creator",
          "code": "TL_CREATOR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "BPAREG doc verifier",
          "code": "BPAREG_DOC_VERIFIER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Customer Support Representative",
          "code": "CSR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "NoC counter Approver",
          "code": "NOC_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "HRMS Admin",
          "code": "HRMS_ADMIN",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Universal Collection Employee",
          "code": "UC_EMP",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "WS Approver",
          "code": "WS_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "BPA Services verifier",
          "code": "BPA_VERIFIER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "PT Counter Approver",
          "code": "PT_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "NoC Field Inpector",
          "code": "NOC_FIELD_INSPECTOR",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Grievance Officer",
          "code": "GO",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "Super User",
          "code": "SUPERUSER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "NOC Department Approver",
          "code": "NOC_DEPT_APPROVER",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "WS Clerk",
          "code": "WS_CLERK",
          "tenantId": "pb.amritsar"
        },
        {
          "name": "NoC Doc Verifier",
          "code": "NOC_DOC_VERIFIER",
          "tenantId": "pb.amritsar"
        }
      ],
      "active": true,
      "tenantId": "pb.amritsar",
      "permanentCity": null
    },
    "msgId": "1646071179143|en_IN"
  }
}

In the system, the FSM_POST_PAY_SERVICE and FSM (that is, the above two business services) are removed and we have introduced a new Business service for advance payment application and zero price application.

For Advance new Business service, FSM_ADVANCE_PAY_SERVICE has been created.

Create businessService (workflow configuration) using the /businessservice/_create. Following is the product configuration for FSM_ADVANCE_PAY_SERVICE:

{

    "BusinessServices": [

        {

            "tenantId": "pb",

            "businessService": "FSM_ADVANCE_PAY_SERVICE",

            "business": "fsm",

            "businessServiceSla": 172800000,

            "states": [

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": null,

                    "applicationStatus": null,

                    "docUploadRequired": false,

                    "isStartState": true,

                    "isTerminateState": false,

                    "isStateUpdatable": true,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "action": "APPLY",

                            "nextState": "PENDING_APPL_FEE_PAYMENT",

                            "roles": [

                                "FSM_CREATOR_EMP"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "action": "CREATE",

                            "nextState": "CREATED",

                            "roles": [

                                "CITIZEN"

                            ]

                        }

                    ]

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "CREATED",

                    "applicationStatus": "CREATED",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": false,

                    "isStateUpdatable": true,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "action": "REJECT",

                            "nextState": "REJECTED",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "action": "SUBMIT",

                            "nextState": "PENDING_APPL_FEE_PAYMENT",

                            "roles": [

                                "FSM_EDITOR_EMP"

                            ]

                        }

                    ]

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "PENDING_APPL_FEE_PAYMENT",

                    "applicationStatus": "PENDING_APPL_FEE_PAYMENT",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": false,

                    "isStateUpdatable": true,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "action": "REJECT",

                            "nextState": "REJECTED",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "action": "SENDBACK",

                            "nextState": "CREATED",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "action": "PAY",

                            "nextState": "ASSING_DSO",

                            "roles": [

                                "CITIZEN",

                                "FSM_COLLECTOR"

                            ]

                        }

                    ]

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "ASSING_DSO",

                    "applicationStatus": "ASSING_DSO",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": false,

                    "isStateUpdatable": true,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "action": "CANCEL",

                            "nextState": "CANCELED",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "action": "ASSIGN",

                            "nextState": "PENDING_DSO_APPROVAL",

                            "roles": [

                                "FSM_EDITOR_EMP"

                            ]

                        }

                    ]

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "DSO_REJECTED",

                    "applicationStatus": "DSO_REJECTED",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": false,

                    "isStateUpdatable": true,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_REJECTED",

                            "action": "CANCEL",

                            "nextState": "CANCELED",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_REJECTED",

                            "action": "REASSING",

                            "nextState": "PENDING_DSO_APPROVAL",

                            "roles": [

                                "FSM_EDITOR_EMP"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_REJECTED",

                            "action": "SENDBACK",

                            "nextState": "PENDING_DSO_APPROVAL",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        }

                    ]

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "DSO_INPROGRESS",

                    "applicationStatus": "DSO_INPROGRESS",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": false,

                    "isStateUpdatable": true,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_INPROGRESS",

                            "action": "SENDBACK",

                            "nextState": "PENDING_DSO_APPROVAL",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_INPROGRESS",

                            "action": "COMPLETED",

                            "nextState": "CITIZEN_FEEDBACK_PENDING",

                            "roles": [

                                "FSM_DSO",

                                "FSM_EDITOR_EMP"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_INPROGRESS",

                            "action": "CANCEL",

                            "nextState": "CANCELED",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_INPROGRESS",

                            "action": "UPDATE",

                            "nextState": "DSO_INPROGRESS",

                            "roles": [

                                "FSM_DSO",

                                "FSM_EDITOR_EMP"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "action": "PAY",

                            "nextState": "DSO_INPROGRESS",

                            "roles": [

                                "CITIZEN",

                                "FSM_COLLECTOR"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "DSO_INPROGRESS",

                            "action": "REASSING",

                            "nextState": "PENDING_DSO_APPROVAL",

                            "roles": [

                                "FSM_EDITOR_EMP"

                            ]

                        }

                    ]

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "PENDING_DSO_APPROVAL",

                    "applicationStatus": "PENDING_DSO_APPROVAL",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": false,

                    "isStateUpdatable": true,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "currentState": "PENDING_DSO_APPROVAL",

                            "action": "DSO_REJECT",

                            "nextState": "DSO_REJECTED",

                            "roles": [

                                "FSM_DSO",

                                "FSM_EDITOR_EMP"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "PENDING_DSO_APPROVAL",

                            "action": "DSO_ACCEPT",

                            "nextState": "DSO_INPROGRESS",

                            "roles": [

                                "FSM_DSO",

                                "FSM_EDITOR_EMP"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "PENDING_DSO_APPROVAL",

                            "action": "CANCEL",

                            "nextState": "CANCELED",

                            "roles": [

                                "FSM_ADMIN"

                            ]

                        },

                        {

                            "tenantId": "pb",

                            "currentState": "PENDING_DSO_APPROVAL",

                            "action": "REASSING",

                            "nextState": "PENDING_DSO_APPROVAL",

                            "roles": [

                                "FSM_EDITOR_EMP"

                            ]

                        }

                    ]

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "COMPLETED",

                    "applicationStatus": "COMPLETED",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": true,

                    "isStateUpdatable": false

                },

                {

                    "sla": null,

                    "state": "REJECTED",

                    "applicationStatus": "REJECTED",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": true,

                    "isStateUpdatable": false,

                    "actions": null

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "CANCELED",

                    "applicationStatus": "CANCELED",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": true,

                    "isStateUpdatable": false,

                    "actions": null

                },

                {

                    "tenantId": "pb",

                    "sla": null,

                    "state": "CITIZEN_FEEDBACK_PENDING",

                    "applicationStatus": "CITIZEN_FEEDBACK_PENDING",

                    "docUploadRequired": false,

                    "isStartState": false,

                    "isTerminateState": false,

                    "isStateUpdatable": false,

                    "actions": [

                        {

                            "tenantId": "pb",

                            "currentState": "CITIZEN_FEEDBACK_PENDING",

                            "action": "RATE",

                            "nextState": "COMPLETED",

                            "roles": [

                                "CITIZEN"

                            ]

                        }

                    ]

                }

            ]

        }

    ],

    "RequestInfo": {

        "apiId": "Rainmaker",

        "action": "",

        "did": 1,

        "key": "",

        "msgId": "20170310130900|en_IN",

        "requesterId": "",

        "ts": 1513579888683,

        "ver": ".01",

        "authToken": "c6aa4196-0e1b-4634-802b-b85fa13ae6ce",

        "userInfo": {

            "id": 30074,

            "uuid": "5130f2e3-efc1-401a-94fb-b9e60d9fa17d",

            "userName": "XYZ",

            "name": "XYZ",

            "mobileNumber": "8897970021",

            "emailId": null,

            "locale": null,

            "type": "EMPLOYEE",

            "roles": [

                {

                    "name": "FSM Employee Application Viewer",

                    "code": "FSM_VIEW_EMP",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "Employee",

                    "code": "EMPLOYEE",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "National Dashboard Administrator",

                    "code": "NATADMIN",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "TL Field Inspector",

                    "code": "TL_FIELD_INSPECTOR",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "ptcollection emp",

                    "code": "PT_COLLECTION_EMP",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "EMPLOYEE ADMIN",

                    "code": "EMPLOYEE ADMIN",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "HRMS Admin",

                    "code": "HRMS_ADMIN",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "Universal Collection Employee",

                    "code": "UC_EMP",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "State Administrator",

                    "code": "STADMIN",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "Super User",

                    "code": "SUPERUSER",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "FSM Employee Application Creator",

                    "code": "FSM_CREATOR_EMP",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "FSM Employee Dashboard Viewer",

                    "code": "FSM_DASHBOARD_VIEWER",

                    "tenantId": "pb.amritsar"

                },

                {

                    "name": "Anonymous User",

                    "code": "ANONYMOUS",

                    "tenantId": "pb.amritsar"

                }

            ],

            "active": true,

            "tenantId": "pb.amritsar",

            "permanentCity": null

        }

    }

}

For Advance Zero new Business service PAY_LATER_SERVICE has been created

Create businessService (workflow configuration) using the /businessservice/_create. Following is the product configuration for PAY_LATER_SERVICE:

{
    "BusinessServices":[
        {
            "tenantId": "pb",
            "businessService": "PAY_LATER_SERVICE",
            "business": "fsm",
            "businessServiceSla": 172800000,
            "states": [
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": null,
                    "applicationStatus": null,
                    "docUploadRequired": false,
                    "isStartState": true,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": null,
                            "action": "APPLY",
                            "nextState": "ASSING_DSO",
                            "roles": [
                                "FSM_CREATOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": null,
                            "action": "CREATE",
                            "nextState": "CREATED",
                            "roles": [
                                "CITIZEN"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CREATED",
                    "applicationStatus": "CREATED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "CREATED",
                            "action": "REJECT",
                            "nextState": "REJECTED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "CREATED",
                            "action": "SUBMIT",
                            "nextState": "ASSING_DSO",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "ASSING_DSO",
                    "applicationStatus": "ASSING_DSO",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "ASSING_DSO",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "ASSING_DSO",
                            "action": "ASSIGN",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "PENDING_DSO_APPROVAL",
                    "applicationStatus": "PENDING_DSO_APPROVAL",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_ACCEPT",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                 "FSM_DSO",
                                 "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_REJECT",
                            "nextState": "DSO_REJECTED",
                            "roles": [
                                 "FSM_DSO",
                                 "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                 {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_REJECTED",
                    "applicationStatus": "DSO_REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ],
                            "active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ],
                             "active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ],
                            "active": true
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_INPROGRESS",
                    "applicationStatus": "DSO_INPROGRESS",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "COMPLETED",
                            "nextState": "CITIZEN_FEEDBACK_PENDING",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ]
                        },
                       
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "UPDATE",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "action": "PAY",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                "CITIZEN",
                                "FSM_COLLECTOR"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CITIZEN_FEEDBACK_PENDING",
                    "applicationStatus": "CITIZEN_FEEDBACK_PENDING",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": false,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "CITIZEN_FEEDBACK_PENDING",
                            "action": "RATE",
                            "nextState": "COMPLETED",
                            "roles": [
                                "CITIZEN"
                            ],
                            "active": true
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "COMPLETED",
                    "applicationStatus": "COMPLETED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "REJECTED",
                    "applicationStatus": "REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CANCELED",
                    "applicationStatus": "CANCELED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                }
                
            ]
        }
    ],
    "RequestInfo": {
        "apiId": "Rainmaker",
        "action": "",
        "did": 1,
        "key": "",
        "msgId": "20170310130900|en_IN",
        "requesterId": "",
        "ts": 1513579888683,
        "ver": ".01",
        "authToken": "3d828f89-c249-4d4a-9098-8230e6040bf5",
        "userInfo": {
            "id": 30074,
            "uuid": "5130f2e3-efc1-401a-94fb-b9e60d9fa17d",
            "userName": "XYZ",
            "name": "XYZ",
            "mobileNumber": "8897970021",
            "emailId": null,
            "locale": null,
            "type": "EMPLOYEE",
            "roles": [
                {
                    "name": "FSM Employee Application Viewer",
                    "code": "FSM_VIEW_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Employee",
                    "code": "EMPLOYEE",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "National Dashboard Administrator",
                    "code": "NATADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "TL Field Inspector",
                    "code": "TL_FIELD_INSPECTOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "ptcollection emp",
                    "code": "PT_COLLECTION_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "EMPLOYEE ADMIN",
                    "code": "EMPLOYEE ADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "HRMS Admin",
                    "code": "HRMS_ADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Universal Collection Employee",
                    "code": "UC_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "State Administrator",
                    "code": "STADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Super User",
                    "code": "SUPERUSER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "FSM Employee Application Creator",
                    "code": "FSM_CREATOR_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "FSM Employee Dashboard Viewer",
                    "code": "FSM_DASHBOARD_VIEWER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Anonymous User",
                    "code": "ANONYMOUS",
                    "tenantId": "pb.amritsar"
                }
            ],
            "active": true,
            "tenantId": "pb.amritsar",
            "permanentCity": null
        }
    }
}

For Zero Price Application new Business service FSM_ZERO_PAY_SERVICE has been created

Create businessService (workflow configuration) using the /businessservice/_create. Following is the product configuration for FSM_ZERO_PAY_SERVICE:

{
    "BusinessServices": [
        {
            "tenantId": "pb",
            "businessService": "FSM_ZERO_PAY_SERVICE",
            "business": "fsm",
            "businessServiceSla": 172800000,
            "states": [
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": null,
                    "applicationStatus": null,
                    "docUploadRequired": false,
                    "isStartState": true,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
							"currentState": null,
                            "action": "APPLY",
                            "nextState": "ASSING_DSO",
                            "roles": [
                                "FSM_CREATOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
							"currentState": null,
                            "action": "CREATE",
                            "nextState": "CREATED",
                            "roles": [
                                "CITIZEN"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CREATED",
                    "applicationStatus": "CREATED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
							"currentState": "CREATED",
                            "action": "REJECT",
                            "nextState": "REJECTED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
							"currentState": "CREATED",
                            "action": "SUBMIT",
                            "nextState": "ASSING_DSO",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "ASSING_DSO",
                    "applicationStatus": "ASSING_DSO",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
							"currentState": "ASSING_DSO",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
							"currentState": "ASSING_DSO",
                            "action": "ASSIGN",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "PENDING_DSO_APPROVAL",
                    "applicationStatus": "PENDING_DSO_APPROVAL",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                       	{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_ACCEPT",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                 "FSM_DSO",
                                 "FSM_EDITOR_EMP"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "PENDING_DSO_APPROVAL",
                            "action": "DSO_REJECT",
                            "nextState": "DSO_REJECTED",
                            "roles": [
                                 "FSM_DSO",
                                 "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
				 {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_REJECTED",
                    "applicationStatus": "DSO_REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ],
							"active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ],
							 "active": true
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_REJECTED",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ],
							"active": true
                        }
                    ]
                },
                 {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "DSO_INPROGRESS",
                    "applicationStatus": "DSO_INPROGRESS",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "SENDBACK",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "COMPLETED",
                            "nextState": "CITIZEN_FEEDBACK_PENDING",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "CANCEL",
                            "nextState": "CANCELED",
                            "roles": [
                                "FSM_ADMIN"
                            ]
                        },
                        {
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "REASSING",
                            "nextState": "PENDING_DSO_APPROVAL",
                            "roles": [
                                "FSM_EDITOR_EMP"
                            ]
                        },
						{
                            "tenantId": "pb",
                            "currentState": "DSO_INPROGRESS",
                            "action": "UPDATE",
                            "nextState": "DSO_INPROGRESS",
                            "roles": [
                                "FSM_DSO",
                                "FSM_EDITOR_EMP"
                            ]
                        }
                    ]
                },
				{
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CITIZEN_FEEDBACK_PENDING",
                    "applicationStatus": "CITIZEN_FEEDBACK_PENDING",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": false,
                    "isStateUpdatable": false,
                    "actions": [
                        {
                            "tenantId": "pb",
                            "currentState": "CITIZEN_FEEDBACK_PENDING",
                            "action": "RATE",
                            "nextState": "COMPLETED",
                            "roles": [
                                "CITIZEN"
                            ],
						    "active": true
                        }
                    ]
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "COMPLETED",
                    "applicationStatus": "COMPLETED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
					"actions": null
                },
                {
                    "tenantId": "pb",
					"sla": null,
                    "state": "REJECTED",
                    "applicationStatus": "REJECTED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                },
                {
                    "tenantId": "pb",
                    "sla": null,
                    "state": "CANCELED",
                    "applicationStatus": "CANCELED",
                    "docUploadRequired": false,
                    "isStartState": false,
                    "isTerminateState": true,
                    "isStateUpdatable": false,
                    "actions": null
                }
                
            ]
        }
    ],
    "RequestInfo": {
        "apiId": "Rainmaker",
        "action": "",
        "did": 1,
        "key": "",
        "msgId": "20170310130900|en_IN",
        "requesterId": "",
        "ts": 1513579888683,
        "ver": ".01",
        "authToken": "3d828f89-c249-4d4a-9098-8230e6040bf5",
        "userInfo": {
            "id": 30074,
            "uuid": "5130f2e3-efc1-401a-94fb-b9e60d9fa17d",
            "userName": "XYZ",
            "name": "XYZ",
            "mobileNumber": "8897970021",
            "emailId": null,
            "locale": null,
            "type": "EMPLOYEE",
            "roles": [
                {
                    "name": "FSM Employee Application Viewer",
                    "code": "FSM_VIEW_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Employee",
                    "code": "EMPLOYEE",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "National Dashboard Administrator",
                    "code": "NATADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "TL Field Inspector",
                    "code": "TL_FIELD_INSPECTOR",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "ptcollection emp",
                    "code": "PT_COLLECTION_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "EMPLOYEE ADMIN",
                    "code": "EMPLOYEE ADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "HRMS Admin",
                    "code": "HRMS_ADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Universal Collection Employee",
                    "code": "UC_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "State Administrator",
                    "code": "STADMIN",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Super User",
                    "code": "SUPERUSER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "FSM Employee Application Creator",
                    "code": "FSM_CREATOR_EMP",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "FSM Employee Dashboard Viewer",
                    "code": "FSM_DASHBOARD_VIEWER",
                    "tenantId": "pb.amritsar"
                },
                {
                    "name": "Anonymous User",
                    "code": "ANONYMOUS",
                    "tenantId": "pb.amritsar"
                }
            ],
            "active": true,
            "tenantId": "pb.amritsar",
            "permanentCity": null
        }
    }
}

Localisation Setup

Using /localisation/messages/v1/_upsert, add localisation (templates) for notification messages to be sent. Following are the product notification templates:

{
  "messages":[
          {
            "code": "FSM_SMS_CREATED_CREATE",
            "message": "Dear Applicant,Your application for cleaning septic tank/pit is created with application reference no.<2>.You will be notified to make an application fee shortly.Request is expected to be completed within <SLA_HOURS>hrs of making the payment.",
            "module": "rainmaker-common",
            "locale": "en_IN"
        },
          {
            "code": "FSM_SMS_PENDING_APPL_FEE_PAYMENT_SUBMIT",
            "message": "Dear Applicant, Please pay the application fee Rs.<AMOUNT_TO_BE_PAID>/- for cleaning the septic tank/pit with request number <2>.Click this link <PAY_LINK> to make the payment.Request is expected to be completed within <SLA_HOURS>hrs of making the payment.",
            "module": "rainmaker-common",
            "locale": "en_IN"
        },
        {
            "code": "FSM_SMS_PENDING_APPL_FEE_PAYMENT_APPLY",
            "message": "Dear Applicant, Your application for cleaning septic tank /pit is created with application number <2>.Please click this link <PAY_LINK> to pay the application fee for processing the application.Request is expected to be completed within <SLA_HOURS>hrs of making the payment.",
            "module": "rainmaker-common",
            "locale": "en_IN"
        },
        {
            "code": "FSM_SMS_ASSING_DSO_PAY",
            "message": "Dear Applicant, Amount of Rs.<AMOUNT_TO_BE_PAID>/- is received towards the payment of cleaning septic tank /pit with reference no. <RECEIPT_NO>.You will be notified when an operator is assigned to a request. Please click this link <RECEIPT_LINK> to download the receipt",
            "module": "rainmaker-common",
            "locale": "en_IN"
        },
        {
            "code": "FSM_SMS_DSO_INPROGRESS_DSO_ACCEPT",
            "message": "Dear Applicant, Vehicle <VEHICLE_REG_NO> will be reaching your location to clean the septic tank/pit on <POSSIBLE_SERVICE_DATE> with reference to your application number <2>. You can contact the operator in +91 <DSO_MOBILE_NUMBER>.",
            "module": "rainmaker-common",
            "locale": "en_IN"
        },
        {
            "code": "FSM_SMS_CITIZEN_FEEDBACK_PENDING_COMPLETED",
            "message": "Dear Applicant, Your request for cleaning septic tank/pit is completed.Please take some time to rate us using the link <FSM_APPL_LINK>.",
            "module": "rainmaker-common",
            "locale": "en_IN"
        },
        {
            "code": "FSM_SMS_DSO_REJECTED_DSO_REJECT",
            "message": "Dear Applicant, Your request for cleaning the septic tank/pit is rejected with the reason <FSM_DSO_REJECT_REASON> . Please use this link <NEW_FSM_LINK> to create a new request if needed.",
            "module": "rainmaker-common",
            "locale": "en_IN"
        },
        {
            "code": "FSM_SMS_CANCELED_CANCEL",
            "message": "Dear Applicant, Your request for cleaning the septic tank/pit is cancelled with the reason <FSM_CANCEL_REASON> . Please use this link <NEW_FSM_LINK> to create a new request if needed.",
            "module": "rainmaker-common",
            "locale": "en_IN"
        }
    ]
}
{
            "code": "PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_NO_OF_TRIP",
            "message":"No. Of Trips",
            "locale": "en_IN",
            "module": "rainmaker-common"
        },
         {
            "code": "PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_AMOUNT_PER_TRIP",
            "message":"Amount Per Trip",
            "locale": "en_IN",
            "module": "rainmaker-common"
        },
        {
            "code": "PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_TOTAL_AMOUNT_DUE",
            "message":"Total Amount Due",
            "locale": "en_IN",
            "module": "rainmaker-common"
        },
        {
            "code": "PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_BALANCE_AMOUNT_PAID",
            "message":"Balance Amount Paid",
            "locale": "en_IN",
            "module": "rainmaker-common"
        },
        {
            "code": "PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_ADVANCE_AMOUNT_PAID",
            "message":"Advance Amount Paid",
            "locale": "en_IN",
            "module": "rainmaker-common"
        },
        {
            "code": "PDF_STATIC_LABEL_CONSOLIDATED_RECEIPT_TOTAL_AMOUNT",
            "message":"Total Amount",
            "locale": "en_IN",
            "module": "rainmaker-common"
        }

Actions & Role Action Mapping

Add Role-Action mapping for the API’s in MDMS. Following are the required entries. They should be mapped to both CITIZEN and the appropriate employee roles.

Action Configuration

{
      "id": {{PLACEHOLDER1}},
      "name": "Create FSM Application",
      "url": "/fsm/v1/_create",
      "displayName": "Apply FSM",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "FSM",
      "code": "null",
      "path": ""
    },
    {
      "id":  {{PLACEHOLDER2}},
      "name": "Search FSM Application",
      "url": "/fsm/v1/_search",
      "displayName": "Search  FSM Appliacations",
      "orderNumber": 1,
      "enabled": false,
      "serviceCode": "FSM",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER3}},
      "name": "Update FSM Application",
      "url": "/fsm/v1/_update",
      "displayName": "Update FSM",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "FSM",
      "code": "null",
      "path": ""
    },
{
      "id": {{PLACEHOLDER4}},
      "name": "FSM Application Charge Payment Search",
      "url": "/collection-services/payments/FSM.TRIP_CHARGES/_search",
      "displayName": "FSM Application Charge Payment Search",
      "orderNumber": 1,
      "parentModule": "",
      "enabled": false,
      "serviceCode": "",
      "code": "null",
      "path": ""
    },
     {
      "id": {{PLACEHOLDER5}},
      "name": "FSM Application Audit Search",
      "url": "/fsm/v1/_audit",
      "displayName": "FSM Application Audit serach",
      "orderNumber": 1,
      "parentModule": "",
      "enabled": false,
      "serviceCode": "",
      "code": "null",
      "path": ""
    }, 
    {
      "id": {{PLACEHOLDER6}},
      "name": "Search FSM Application",
      "url": "/fsm/v1/_plainsearch",
      "displayName": "Search  FSM Appliacations",
      "orderNumber": 1,
      "enabled": false,
      "serviceCode": "FSM",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER7}},
      "name": "Create FSTP FSTPOperator Mapping",
      "url": "/fsm/plantmap/v1/_create",
      "displayName": "Create FSTP FSTPOperator Map",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "FSM",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER8}},
      "name": "Update FSTP FSTPOperator Mapping",
      "url": "/fsm/plantmap/v1/_update",
      "displayName": "Update FSTP FSTPOperator Map",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "FSM",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER9}},
      "name": "Search FSTP FSTPOperator Mapping",
      "url": "/fsm/plantmap/v1/_search",
      "displayName": "Search FSTP FSTPOperator Map",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "FSM",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PlaceHolder10}},
      "name": "Inbox Search ofr uI",
      "url": "/inbox/v1/_search",
      "displayName": "Inbox Search",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "inbox",
      "code": "null",
      "path": ""
    }

data/pg/ACCESSCONTROL-ACTIONS-TEST/actions-test.json

https://github.com/egovernments/egov-mdms-data/commit/3979963cd0281245c69f015da233a5501fb5f99f

data/pg/ACCESSCONTROL-ACTIONS-TEST/actions-test.json

https://github.com/egovernments/egov-mdms-data/commit/50b83c118d57f49920c51216a2f6596d81d6ed79

data/pg/ACCESSCONTROL-ACTIONS-TEST/actions-test.json

https://github.com/egovernments/egov-mdms-data/commit/0140a43e110d9677ac69de11d1c1fd1344aa12cd

Role Action Mapping

[
 {
    "rolecode": "CITIZEN",
    "actionid": "{{PLACEHOLDER1}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_CREATOR_EMP",
    "actionid": "{{PLACEHOLDER1}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "CITIZEN",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_CREATOR_EMP",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_VIEW_EMP",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DRIVER",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EMP_FSTPO",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_COLLECTOR",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
   {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DRIVER",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "CITIZEN",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
   {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DRIVER",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_COLLECTOR",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "CITIZEN",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_VIEW_EMP",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "CITIZEN",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_CREATOR_EMP",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_VIEW_EMP",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DRIVER",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EMP_FSTPO",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_COLLECTOR",
    "actionid": "{{PLACEHOLDER5}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
      "rolecode": "FSM_EDITOR_EMP",
      "actionid": {{PLACEHOLDER6}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_VIEW_EMP",
      "actionid": {{PLACEHOLDER6}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_ADMIN",
      "actionid": {{PLACEHOLDER6}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_DSO",
      "actionid": {{PLACEHOLDER6}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_DRIVER",
      "actionid": {{PLACEHOLDER6}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_EMP_FSTPO",
      "actionid": {{PLACEHOLDER6}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_COLLECTOR",
      "actionid": {{PLACEHOLDER6}},
      "actioncode": "",
      "tenantId": "pb"
    },
  {
      "rolecode": "FSM_ADMIN",
      "actionid": {{PLACEHOLDER7}},
      "actioncode": "",
      "tenantId": "pb"
    },
     {
      "rolecode": "FSM_ADMIN",
      "actionid": {{PLACEHOLDER8}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_EMP_FSTPO",
      "actionid": {{PLACEHOLDER8}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "PT_CEMP",
      "actionid": {{PLACEHOLDER9}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "CITIZEN",
      "actionid": {{PLACEHOLDER9}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "SUPERUSER",
      "actionid": {{PLACEHOLDER9}},
      "actioncode": "",
      "tenantId": "pb"
    }, 
        {
      "rolecode": "FSM_EMP_FSTPO",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_COLLECTOR",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_EDITOR_EMP",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_VIEW_EMP",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
     {
      "rolecode": "FSM_CREATOR_EMP",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_ADMIN",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "FSM_DSO",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "PT_CEMP",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "PT_DOC_VERIFIER",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "PT_FIELD_INSPECTOR",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
      "rolecode": "PT_APPROVER",
      "actionid": {{PlaceHolder10}},
      "actioncode": "",
      "tenantId": "pb"
    },
    {
    "rolecode": "TL_CEMP",
    "actionid": {{PlaceHolder10}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "TL_DOC_VERIFIER",
    "actionid": {{PlaceHolder10}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "TL_FIELD_INSPECTOR",
    "actionid": {{PlaceHolder10}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "TL_APPROVER",
    "actionid": {{PlaceHolder10}},
    "actioncode": "",
    "tenantId": "pb"
  },
]

data/pg/ACCESSCONTROL-ROLEACTIONS/roleactions.json

https://github.com/egovernments/egov-mdms-data/commit/4d58943d8ab04aa5d8816821406b6e40017ec722

data/pg/ACCESSCONTROL-ROLEACTIONS/roleactions.json

https://github.com/egovernments/egov-mdms-data/commit/1b5962693ac70b7ac56fd312f4b2febab00f9c93

data/pg/ACCESSCONTROL-ROLEACTIONS/roleactions.json

https://github.com/egovernments/egov-mdms-data/commit/9f9b1340b42f25bca44fdcfa474a3413cc21ec03

Infra Ops Configuration

Configurations that we can manage through values.yml fsm-calculator in infraops repo as follows:

Description

name in values.yml

Current Value

id-gen host, to generate the application number

EGOV_IDGEN_HOST

egov-idgen from egov-service-host

Kafka Consumer Group

SPRING_KAFKA_CONSUMER_GROUP_ID

egov-fsm-service

kafka topic to which service push data to save new fsm application

PERSISTER_SAVE_FSM_TOPIC

save-fsm-application

kafka topic to which service push data to save workflow status

PERSISTER_UPDATE_FSM_WORKFLOW_TOPIC

update-fsm-workflow-application

kafka topic to which service push data to update the existing fsm application

PERSISTER_UPDATE_FSM_TOPIC

update-fsm-application

mdms service host

EGOV_MDMS_HOST

egov-mdms-service from egov-service-host

billing-service host

EGOV_BILLINGSERVICE_HOST

billing-service from egov-service-host

fsm-calculator service host

EGOV_FSM_CALCULATOR_HOST

fsm-calculator from egov-service-host

workflow v2 service host

WORKFLOW_CONTEXT_PATH

egov-workflow-v2 from egov-service-host

ui host, to return send the url of new application in sms notification

EGOV_UI_APP_HOST

egov-services-fqdn-name from egov-service-host

vendor service host, to get DSO details

EGOV_VENDOR_HOST

vendor from egov-service-host

Vehicle service host, to get vehicle details and manage vehicleTrip

EGOV_VEHICLE_HOST

vehicle from egov-service-host

Collection service host, to get the payment details

EGOV_COLLECTION_SERVICE_HOST

collection-services from egov-service-host

localization service host, to get the locale data

EGOV_LOCALIZATION_HOST

egov-localization from egov-service-host

user service host, to get the locale data

EGOV_USER_HOST

egov-user from egov-service-host

pdf service host, to get the locale data

EGOV_PDF_HOST

pdf-service from egov-service-host

url shortening service host, to get the short url for the long once

EGOV_URL_SHORTNER_HOST

egov-url-shortening from egov-service-host

Sample values.yml

- name: EGOV_IDGEN_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-idgen
  - name: EGOV_MDMS_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-mdms-service
  - name: EGOV_URL_SHORTNER_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-url-shortening
  - name: EGOV_PDF_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: pdf-service
  - name: EGOV_USER_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-user
  - name: EGOV_LOCATION_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-location
  - name: EGOV_LOCALIZATION_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-localization
  - name: EGOV_BILLINGSERVICE_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: billing-service
  - name: EGOV_COLLECTION_SERVICE_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: collection-services
  - name: EGOV_FSM_CALCULATOR_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: fsm-calculator
  - name: EGOV_VEHICLE_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: vehicle
  - name: EGOV_VENDOR_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: vendor
  - name: EGOV_UI_APP_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-config
        key: egov-services-fqdn-name
  - name: WORKFLOW_CONTEXT_PATH
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-workflow-v2
  - name: WORKFLOW_TRANSITION_PATH
    value: "egov-workflow-v2/egov-wf/process/_transition"
  - name: EGOV_IDGEN_FSM_APPLICATIONNUM_FORMAT
    value: "[CITY.CODE]-FSM-[cy:yyyy-MM-dd]-[SEQ_EGOV_FSM]"
  - name: SPRING_KAFKA_CONSUMER_GROUP_ID
    value: egov-fsm-service
  - name: PERSISTER_SAVE_FSM_TOPIC
    value: save-fsm-application
  - name: PERSISTER_UPDATE_FSM_TOPIC
    value: update-fsm-application
  - name: PERSISTER_UPDATE_FSM_WORKFLOW_TOPIC
    value: update-fsm-workflow-application

Users

User

Role

Description

How to create

FSM Creator

FSM_CREATOR_EMP

  • Can create FSM application on behalf of a citizen

Through HRMS with role

FSM Editor

FSM_EDITOR_EMP

  • Can edit the application created by a citizen for demand generation

  • Assign/re-assign DSO

  • Complete the application

Through HRMS with role

FSM Admin

FSM_ADMIN

  • Can cancel the application at any stage of the workflow

Through HRMS with role

DSO

FSM_DSO

  • Can accept/reject the assigned application

  • can complete the FSM application

Through vendor service, use the create DSO Request from postman Collection

FSTP Operator

FSM_EMP_FSTPO

  • Can mark the vehicle Trip as disposed. Not FSM Service User

Through HRMS with role

Collector

FSM_COLLECTOR

  • Can collect the payment amount for the application based on demand

Through HRMS with role

  • User with userType employee and role FSM_CREATOR_EMP role.

Integration

Integration Scope

FSM can be integrated with any ULB or system which wants to track the FSM application. The organisations can customise the workflow depending on their product requirements.

Integration Benefits

  • Easy tracking and resolution of the FSM application.

  • Configurable workflow according to client requirement.

Steps

  1. Citizen/ULB employee can file application request using the /fsm/v1/_create.

  2. Organisation or system can search the FSM Applications using /fsm/v1/_searchendpoint.

  3. Once the application is filed, the organisation or system can call /fsm/v1/_update endpoint to move the application further in the workflow until it gets resolved.

Inbox API

  • Introduced new inbox service to get the FSM applications in registered ULB employee inbox. With this, a ULB employee can track the application or perform the actions based on employee role.

  • ULB employees can also apply the filter to check the particular state or applications or any other filter as required.

FSM apply as a service

Currently, we provide FSM as an adhoc service.To avoid multiple times, a user has to create the FSM request every time. In the system itself after some days, we will create the same FSM application and if the user wants a service, he/she will pay the amount.

MDMS changes

As mentioned above, we need to define the time parameter in order to create a periodic application. For that, we added the periodic service master where we configure the time limit and whether the schedular is enabled or not. Find the configuration and location below:

Logoegov-mdms-data/PeriodicService.json at DEV · egovernments/egov-mdms-dataGitHub
{ "tenantId": "pb.amritsar",
"moduleName": "FSM",
"PeriodicService":[
{
"timeLimit" : 864000000,
"isSchedularConfiguration":true
}
]
}

cronjob will read the cron job’s configured in the cronjobapiconfig.json, and based on the schedular time, it will call the API which is configured. Find the configuration and file location below:

Logoegov-mdms-data/CronJobAPIConfig.json at DEV · egovernments/egov-mdms-dataGitHub
{ "jobName": "daily",
"active": "true",
"method": "POST",
"url": "http://fsm.egov:8080/fsm/v1/_schedular",
"payload": {
"RequestInfo": "{DEFAULT_REQUESTINFO}" },
"header": { "Content-Type": "application/json"
}

We are using the fsm/v1/_schedular API. This API will read the master data for each tenant and based on the time limit configured for that tenant, it will get all eligible applications and create periodic applications for those FSM applications.

data/pb/FSM/AdvancePayment.json

SM-499 : mdms file for advanceBalance and cancellationfee · egovernments/egov-mdms-data@3b3233e

Update AdvancePayment.json · egovernments/egov-mdms-data@a864a90

Update CancellationFee.json · egovernments/egov-mdms-data@3a614e5

master-config.json

SM-499 adding advancepayment and cancellationfee · egovernments/egov-mdms-data@c4efb2e

Infra changes

We added a new chart called mdms-read-cronjob. Find the chart location below:

https://github.com/egovernments/DIGIT-DevOps/tree/master/deploy-as-code/helm/charts/utilities/mdms-read-cronjob

Interaction Diagram

1. Advance Amount Workflow

2. Zero Price Application Workflow

Reference Docs

Doc Links

Title

Link

Workflow Technical Document

Workflow Service

User Technical Document

User Service

MDMS Technical Document

NEEDS TO BE UPDATED

IDGen Technical Document

NEEDS TO BE UPDATED

Localisation Technical Document

NEEDS TO BE UPDATED

Persister Technical Document

NEEDS TO BE UPDATED

SMS Notification Technical Document

NEEDS TO BE UPDATED

HRMS Technical Document

NEEDS TO BE UPDATED

API Contract

FSM API Contract

Postman Collection

FSM Postman Collection

API List

Title

Link

/fsm/v1/_create

https://api.postman.com/collections/23418568-946a158e-9391-44b2-9d2b-48f30ea8cd63?access_key=PMAT-01GSPRPC338T9RR0GAKTRCRDP8

/fsm/v1/_update

https://api.postman.com/collections/23418568-946a158e-9391-44b2-9d2b-48f30ea8cd63?access_key=PMAT-01GSPRPC338T9RR0GAKTRCRDP8

/fsm/v1/_search

https://www.getpostman.com/collections/a51486db12539a2aa597

/fsm/v1/_audit

https://www.getpostman.com/collections/a51486db12539a2aa597

/fsm/v1/_plainsearch

https://www.getpostman.com/collections/a51486db12539a2aa597

/fsm/plantmap/v1/_create

https://www.getpostman.com/collections/a51486db12539a2aa597

/fsm/plantmap/v1/_update

https://www.getpostman.com/collections/a51486db12539a2aa597

/fsm/plantmap/v1/_search

https://www.getpostman.com/collections/a51486db12539a2aa597

/inbox/v1/_search

https://www.getpostman.com/collections/a51486db12539a2aa597

/fsm/v1/_schedular

https://www.getpostman.com/collections/a51486db12539a2aa597

FSM Implementation Configuration

MDMS Configuration

FSTP Plant Info

The FSTP plant info contains plant operational capacity per day of each ULB and other plant-related information. It is required to calculate the FSTP capacity utilization in percentage form. MDMS file details:

egov-mdms-data/FSTPPlantInfo.json at QA · egovernments/egov-mdms-data``

{
	"MdmsCriteria": {
		"tenantId": "pb",
		"moduleDetails": [{
			"moduleName": "dss-dashboard",
			"masterDetails": [{
				"name": "dashboard-config"
			}]
		}, {
			"moduleName": "FSM",
			"masterDetails": [{
				"name": "FSTPPlantInfo"
			}]
		}]
	}
}

FSM Calculator

Details for setting up FSM calculator sevice

Overview

FSM calculator is a system that enables the FSM admin to create billing slabs for the FSM application(s) with different combinations of property type, slum, tank, and capacity. It generates the demand after calculating the charges for the given application using the billing slab already configured.

This document contains the details on how to set up the FSM calculator service, describes the functionalities it provides, and details the enhancements made to the FSM calculator service.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met:

  • Java 8

  • Kafka server is up and running

  • egov-persister service is running and has fsm-calculator-persister config path added in it

  • PSQL server is running and database is created to store FSM Application data

  • The following services should be up and running-

- egov-perister

- egov-mdms

- fsm

- billing-service

Key Functionalities

EXISTING

  • FSM admin, an employee of ULB with FSM admin role can create, update billing slab(s).

  • ULB employee with FSM_CREATOR and FSM_EDITOR can search billing slab(s).

  • ULB employee citizen can file, track and rate the application for cleaning septic tank.

  • ULB employee can get the estimate for the FSM application.

  • FSM service internally call fsm-calculator to generate a demand.

  • Vehicle type check has been removed from calculator service and the bill amount is calculated based on the number of trips entered while submitting the FSM application.

ENHANCEMENT

  • Bill amount is calculated based on the number of trips entered while updating the number of trips in the FSM application.

  • Added validation for advance payment with the configuration.

  • Added validation for maximum total advance payment.

  • Added cancellation charges for canceling the application.

  • Validation before completing the request with the payment.

  • Minimum part payment is configurable, that is, it should be fixed or percentage calculation, and the calculation should done based on the mdms config value.

  • Minimum cancellation fee is configurable, that is, it should be fixed or percentage calculation, and the calculation should done based on the mdms config value.

  • Demand generation process: Generating demand every time the trip is updates.

  • Demand generation process: Added validation not to complete the application from the ULB side before completing the payment.

Deployment Details

  1. Deploy the latest version of FSM.

  2. Add fsm-calculator-persister.yml file in the config folder in GIT, and add that path in persister (the file path is to be added in environment yaml file in param called persist-yml-path):

https://github.com/egovernments/configs/blob/DEV/egov-persister/fsm-calculator-persister.yaml

Configuration Details

MDMS Configuration

FSM MDMS configuration is sufficient.

Business Service / Workflow Configuration

NA

Actions & Role Action Mapping

Actions

[
  {
    "id": {{PLACEHOLDER1}},
    "name": "FSM BillingSlab Create",
    "url": "/fsm-calculator/v1/billingSlab/_create",
    "displayName": "FSM BillingSlab Create",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  },
  {
    "id": {{PLACEHOLDER2}},
    "name": "FSM BillingSlab Update",
    "url": "/fsm-calculator/v1/billingSlab/_update",
    "displayName": "FSM BillingSlab Update",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  },
  {
    "id": {{PLACEHOLDER3}},
    "name": "FSM BillingSlab Search",
    "url": "/fsm-calculator/v1/billingSlab/_search",
    "displayName": "FSM BillingSlab Search",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  },
  {
    "id": {{PLACEHOLDER4}},
    "name": "FSM Estimate",
    "url": "/fsm-calculator/v1/_estimate",
    "displayName": "FSM Estimate",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  }
]

{
  "id": {{PLACEHOLDER5}},
  "name": "FSM Advance Balance Calculation",
  "url": "/fsm-calculator/v1/_advanceBalanceCalculate",
  "displayName": "FSM Advance Balance Calculation",
  "orderNumber": 1,
  "parentModule": "",
  "enabled": false,
  "serviceCode": "",
  "code": "null",
  "path": ""
},
{
  "id": {{PLACEHOLDER6}},
  "name": "FSM Cancellation Fee Calculation",
  "url": "/fsm-calculator/v1/_cancellationFee",
  "displayName": "FSM Advance Balance Calculation",
  "orderNumber": 1,
  "parentModule": "",
  "enabled": false,
  "serviceCode": "",
  "code": "null",
  "path": ""
}

Role Action Mapping

[
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER1}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_CREATOR_EMP",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_CREATOR_EMP",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  }
]

{
  "rolecode": "CITIZEN",
  "actionid": {{PLACEHOLDER3}},
  "actioncode": "",
  "tenantId": "pb"
} ,
{
  "rolecode": "CITIZEN",
  "actionid": {{PLACEHOLDER5}},
  "actioncode": "",
  "tenantId": "pb"
},
{
  "rolecode": "FSM_EDITOR_EMP",
  "actionid": {{PLACEHOLDER5}},
  "actioncode": "",
  "tenantId": "pb"
},
{
  "rolecode": "FSM_CREATOR_EMP",
  "actionid": {{PLACEHOLDER6}},
  "actioncode": "",
  "tenantId": "pb"
},

Infra Ops Configuration

Configurations that we can manage through values.yml fsm-calculator in infraops repo are as follows. values.yml for fms-calculator can be found here.

Description

name in values.yml

Current Value

contextPath of the api’s

SERVER_CONTEXTPATH

/fsm-calculator

Kafka Consumer Group

SPRING_KAFKA_CONSUMER_GROUP_ID

fsm-calculator

kafka topic to which service push data to save new billing slab

PERSISTER_SAVE_BILLING_SLAB_TOPIC

save-fsm-billing-slab

kafka topic to which service push data to update the existing billing slab

PERSISTER_UPDATE_BILLING_SLAB_TOPIC

update-fsm-billing-slab

mdms service host

EGOV_MDMS_HOST

egov-mdms-service from egov-service-host

billing-service host

EGOV_BILLINGSERVICE_HOST

billing-service from egov-service-host

fsm service host

EGOV_FSM_HOST

fsm from egov-service-host

Configurations sample in Values.yml

 - name: SERVER_CONTEXTPATH
    value: /fsm-calculator
  - name: SPRING_KAFKA_CONSUMER_GROUP_ID
    value: fsm-calculator
  - name: PERSISTER_SAVE_BILLING_SLAB_TOPIC
    value: save-fsm-billing-slab
  - name: PERSISTER_UPDATE_BILLING_SLAB_TOPIC
    value: update-fsm-billing-slab
  - name: SPRING_KAFKA_PRODUCER_KEY_SERIALIZER
    value: org.apache.kafka.common.serialization.StringSerializer
  - name: SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER
    value: org.springframework.kafka.support.serializer.JsonSerializer
  - name: EGOV_MDMS_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-mdms-service
  - name: EGOV_BILLINGSERVICE_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: billing-service
  - name: EGOV_FSM_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: fsm

Data Setup

Billing Slab Setup

Create billing slab with combination of PropertyType, refer values from PropertyType Mdms, Slum (YES/NO), capacityFrom and capacityTo refers to the Vehicle Tank Capacity.

Sample Curl

curl --location --request POST 'http://localhost:9098/fsm-calculator/v1/billingSlab/_create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "RequestInfo": {
        "apiInfo": {
            "id": "string",
            "version": "string",
            "path": "string"
        },
        "deviceDetail": {
            "id": "string",
            "signature": "string"
        },
        "ts": 0,
        "action": "string",
        "key": "string",
        "msgId": "string",
        "requesterId": "string",
        "authToken": "a35b5ba7-2d5f-4272-8a67-0303cfab2c9f"
    },
   "billingSlab":{
          
            "tenantId": "pb.amritsar",
            "capacityFrom": 1000.00,
            "capacityTo": 50000.00,
            "propertyType": "RESIDENTIAL.ROW_HOUSES",
            "slum": "NO",
            "price": 9000.00,
            "status": "ACTIVE"
        },
    "workflow": null
}'

Integration

Integration Scope

The FSM-calculator will be integrated with the FSM application. The FSM application internally will invoke the fsm-calculator service to calculate and generate demand for the charges.

Integration Benefits

  • The calculation and demand generation logic will be separated from the FSM service. For each implementation, the calculation implementation can be changed, if required, without modifying the FSM service.

Steps to Integration

  1. FSM application to call fsm-calulator/v1/_calculate to calculate and generate the demand for the fsm application.

  2. ULB employee can call fsm-calculator/v1/_estimate to get the estimates for the fsm application.

  3. ULB Employee can create billing slab calling fsm-calculator/v1/billingSlab/_create

  4. ULB employee can update billing slab calling fsm-calculator/v1/billingSlab/_update

  5. ULB Employee can search billing slab calling fsm-calculator/v1/billingSlab/_search

  6. FSM application to call fsm-calculator/v1/_cancellationFee to calculate cancellation charge based on the configuration data, that is, either it will be fixed or it will be a percentage.

FSM application to call fsm-calculator/v1/_advanceBalanceCalculate to calculate the advance charge based on the configuration data, that is, either it will be fixed or a percentage.

Interaction Diagram

TBD

Reference Docs

Doc Links

Workflow Technical Document

Workflow Service

User Technical Document

User Service

MDMS Technical Document

NEEDS TO BE UPDATED

IDGen Technical Document

NEEDS TO BE UPDATED

Localization Technical Document

NEEDS TO BE UPDATED

Persister Technical Document

NEEDS TO BE UPDATED

SMS Notification Technical Document

NEEDS TO BE UPDATED

API Contract

API Contract

Postman Scripts

Postman Scripts

API List

Title

Link

fsm-calulator/v1/_calculate

https://www.getpostman.com/collections/8b9eb951a810486f41a4

fsm-calculator/v1/_estimate

https://www.getpostman.com/collections/8b9eb951a810486f41a4

fsm-calculator/v1/billingSlab/_create

https://www.getpostman.com/collections/8b9eb951a810486f41a4

fsm-calculator/v1/billingSlab/_update

https://www.getpostman.com/collections/8b9eb951a810486f41a4

fsm-calculator/v1/billingSlab/_search

https://www.getpostman.com/collections/8b9eb951a810486f41a4

fsm-calculator/v1/_cancellationfee

https://api.postman.com/collections/23418568-77e3f5fb-dd9d-4f05-92e7-b15dcbeecffe?access_key=PMAT-01GN93ZP6B68E0T5TZ62GR02W0

fsm-calculator/v1/_advancebalancecalculate

https://api.postman.com/collections/23418568-77e3f5fb-dd9d-4f05-92e7-b15dcbeecffe?access_key=PMAT-01GN93ZP6B68E0T5TZ62GR02W0

FSM Vendor Registry

Details for registering new vendors

Overview

The vendor registry is a system that enables urban local body (ULB) employees to create and search a vendor, that is, the desludging operator (DSO) and driver entities with appropriate vehicle entities for the FSM application. This document contains the details about how to set up the vendor and describe the functionalities provided.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met:

  • Java 8

  • Kafka server is up and running.

  • egov-persister service is running and has a vendor-persister config path added in it.

  • PSQL server is running and database is created to store FSM application data.

  • Following services should be up and running:

- egov-mdms-service

- egov-user-service

- boundary-service

- vehicle-service

Key Functionalities

EXISTING

  1. Added payment payment preference and agency attributes for DSO.

  2. Added gender attribute in the create and update APIs for vendor.

  3. Updated the vendor search API to add vehicleCapacity in the search parameter to search all vendors matching the vehicle capacity specified in the search parameter.

  4. Introduced the vendor tab.

  5. Option to add/remove/update vendors individually.

  6. User can add vehicle and driver.

  7. Search for the list of all vehicles not associated with any vendors.

  8. Users can enable or disable the vendor.

  9. Introduced the driver tab.

  10. Option to add/remove/update driver individually.

  11. User should be able to create/update/enable/disable a driver from the driver screen.

  12. Functionality to add/remove directly driver to vendor.

ENHANCEMENT

Part Search :

FSM Registry Vendor Tab

The vendor tab now supports part search by vendor name. This means that users can enter a partial vendor name and retrieve all relevant results that contain that specific portion.

For instance, if the vendor name is "Shambala corporation", users can search for any part of the vendor name, such as "sham" or "Shambala", and retrieve all relevant results which contain that specific portion.

FSM Registry Driver Tab

The driver tab now supports part search by driver name. This means that users can enter a partial driver name and retrieve all relevant results which contain that specific portion.

For instance, if the driver name is "Rajesh Ranjan", users can search for any part of the driver name, such as "raj" or "ranjan", and retrieve all relevant results which contain that specific portion.

Updating Registry Information

In the vendor tab, the admin has the ability to update certain vendor information, such as Gender, Mobile number, and Locality/Mohalla.

In the driver tab, the admin has the ability to update certain driver information, such as Gender, Driver, and License Number.

Deployment Details

  1. Deploy the latest version of the vendor.

  2. Add vendor-persister.yml file in the config folder in git and add that path in persister (the file path is to be added in the environment yaml file in param called persist-yml-path), and restart egov-persister-service.

  3. Integrate the following below changes in vendor-persister.yml SAN-1063 and 1064 (SAN-1158 and SAN-1157) - Persister file - Vendor … · egovernments/configs@95dd26f.

  4. SM-801 Not able to create vendor in UAT using api by madan-kumar-eGov · Pull Request #2237 · egovernments/configs.

Configuration Details

SAN-1047 - Added the query map for update vehicle and vendor topics. · egovernments/configs@56da639

SAN-1047: Added the vendor agency and payment preference column in th… · egovernments/configs@1659e4f

SAN-1047: Added new columns for vendor vehicle and driver status · egovernments/configs@2337e21

Added the audit logging for vehicle and vendor · egovernments/configs@482185f

Added new changes for Driver create and update & vendor -vehicle driv… · egovernments/configs@9ee374e

Update the persister for driver updates · egovernments/configs@04368c7

change the VENDOR_ID to VECHILE_ID for changing the vehicle status fo… · egovernments/configs@8a6ec56

updated the column in eg_vendor_driver table in update vendor topic · egovernments/configs@71b5297

changes reversed · egovernments/configs@5b86889

unlinking ofdriver from vendor · egovernments/configs@a36bb6e

SM-766 vendor not getting update in driver Tab · egovernments/configs@ad83851

SM-766 revert back the changes · egovernments/configs@e95bbeb

SM-766 Not able to change the vendor in driver details. · egovernments/configs@6f42ca2

SM-781 Not able to add vehicle in vendor tab · egovernments/configs@2b79b92

MDMS Configuration

SAN-1049: Added role actions for Driver APIs. · egovernments/egov-mdms-data@fb8e530

SAN-1063: Added the permissiosn for Vehicle trip creation · egovernments/egov-mdms-data@632ee94

SAN-1047: Added role action mapping for vendor and vehicle update · egovernments/egov-mdms-data@3e608a8

Business Service / Workflow Configuration

NA

Actions & Role Action Mapping

After adding actions and role action mappings, restart the egov-mdms-service

Actions

{
      "id": {{PLACEHOLDER1}},
      "name": "Create Vendor/DSO",
      "url": "/vendor/v1/_create",
      "displayName": "Create Vehicle",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "vendor",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER2}},
      "name": "Search Vendor/DSO",
      "url": "/vendor/v1/_search",
      "displayName": "Search  Vendor",
      "orderNumber": 1,
      "enabled": false,
      "serviceCode": "vendor",
      "code": "null",
      "path": ""
    },
{
  "id": {{PLACEHOLDER3}},
  "name": "Vendor Driver Create",
  "url": "/Vendor/driver/v1/_create",
  "displayName": "Vendor Driver Create",
  "orderNumber": 1,
  "parentModule": "",
  "enabled": false,
  "serviceCode": "vendor",
  "code": "null",
  "path": ""
},
{
  "id": {{PLACEHOLDER4}},
  "name": "Vendor Driver Update",
  "url": "/Vendor/driver/v1/_update",
  "displayName": "Vendor Driver Update",
  "orderNumber": 1,
  "parentModule": "",
  "enabled": false,
  "serviceCode": "vendor",
  "code": "null",
  "path": ""
},
{
  "id": {{PLACEHOLDER5}},
  "name": "Vendor Driver Search",
  "url": "/Vendor/driver/v1/_search",
  "displayName": "Vendor Driver Search",
  "orderNumber": 1,
  "parentModule": "",
  "enabled": false,
  "serviceCode": "vendor",
  "code": "null",
  "path": ""
},
{
  "id": {{PLACEHOLDER6}},
  "name": "Update Vendor/DSO",
  "url": "/vendor/v1/_update",
  "displayName": "Update Vendor",
  "orderNumber": 0,
  "enabled": false,
  "serviceCode": "vendor",
  "code": "null",
  "path": ""
}

Role Action Mapping

[
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER1}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_VIEW_EMP",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EMP_FSTPO",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "CITIZEN",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  }
]
{
     "rolecode": "FSM_ADMIN",
     "actionid": {{PLACEHOLDER3}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_CREATOR_EMP",
     "actionid": {{PLACEHOLDER3}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_DSO",
     "actionid": {{PLACEHOLDER3}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_EDITOR_EMP",
     "actionid": {{PLACEHOLDER3}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_VIEW_EMP",
     "actionid": {{PLACEHOLDER3}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_EMP_FSTPO",
     "actionid": {{PLACEHOLDER3}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_ADMIN",
     "actionid": {{PLACEHOLDER4}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_CREATOR_EMP",
     "actionid": {{PLACEHOLDER4}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_DSO",
     "actionid": {{PLACEHOLDER4}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_EDITOR_EMP",
     "actionid": {{PLACEHOLDER4}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_VIEW_EMP",
     "actionid": {{PLACEHOLDER4}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_EMP_FSTPO",
     "actionid": {{PLACEHOLDER4}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_ADMIN",
     "actionid": {{PLACEHOLDER5}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_CREATOR_EMP",
     "actionid": {{PLACEHOLDER5}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_DSO",
     "actionid": {{PLACEHOLDER5}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_EDITOR_EMP",
     "actionid": {{PLACEHOLDER5}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_VIEW_EMP",
     "actionid": {{PLACEHOLDER5}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_EMP_FSTPO",
     "actionid": {{PLACEHOLDER5}},
     "actioncode": "",
     "tenantId": "pb"
},
{
     "rolecode": "FSM_ADMIN",
     "actionid": {{PLACEHOLDER6}},
     "actioncode": "",
     "tenantId": "pb"
}

Infra Ops Configuration

Configurations that we can manage through values.yml vehicle in infra-ops repo are listed below. values.yml for the vehicle is available below.

Description

Name in values.yml

Current value

Kafka Consumer Group

SPRING_KAFKA_CONSUMER_GROUP_ID

egov-vendor-services

Kafka topic to which service push data to save new vendor

PERSISTER_SAVE_VENDOR_TOPIC

save-vendor-application

MDMS service host

EGOV_MDMS_HOST

egov-mdms-service from egov-service-host

Vehicle service host

EGOV_VEHICLE_HOST

vehicle from egov-service-host

User service host

EGOV_USER_HOST

egov-user-service from egov-service-host

Location service Host

EGOV_LOCATION_HOST

egov-location from egov-service-host

Configurations sample in Values.yml

# Common Labels
labels:
  app: "vendor"
  group: "rainmaker"


# Ingress Configs
ingress:
  enabled: true
  zuul: true
  context: "vendor"


# Init Containers Configs
initContainers:
  dbMigration:
    enabled: true
    schemaTable: "vendor_schema"
    image:
      repository: "vendor-db"


# Container Configs
image:
  repository: "vendor"
replicas: "1"
healthChecks:
  enabled: true
  livenessProbePath: "/vendor/health"
  readinessProbePath: "/vendor/health"
appType: "java-spring"
tracing-enabled: true
heap: "-Xmx256m -Xms256m"
java-args: "-Dspring.profiles.active=monitoring"


# Additional Container Envs
env: |
  - name: EGOV_VEHICLE_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: vehicle
  - name: EGOV_MDMS_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-mdms-service
  - name: EGOV_USER_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-user
  - name: EGOV_LOCATION_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-location
  - name: EGOV_HRMS_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-hrms
  - name: SPRING_KAFKA_CONSUMER_GROUP_ID
    value: egov-vendor-services
  - name: PERSISTER_SAVE_VENDOR_TOPIC
    value: save-vendor-application
  - name: PERSISTER_UPDATE_VENDOR_TOPIC
    value: update-vendor-application
  - name: SPRING_KAFKA_PRODUCER_KEY_SERIALIZER
    value: org.apache.kafka.common.serialization.StringSerializer
  - name: SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER
    value: org.springframework.kafka.support.serializer.JsonSerializer
  - name: JAVA_OPTS
    value: {{ index .Values "heap" | quote }}
  - name: JAVA_ARGS
    value: {{ index .Values "java-args" | quote }}
  - name: SERVER_PORT
    value: "8080"
  - name: SECURITY_BASIC_ENABLED
    value: "false"  
  - name: MANAGEMENT_SECURITY_ENABLED
    value: "false"
  {{- if index .Values "tracing-enabled" }}
  - name: TRACER_OPENTRACING_ENABLED
    value: "true" 
  {{- end }}

Data Setup

The DSO for the FSM system is a vendor. For every city/ULB, a DSO should be created with the representative details as owner, associated vehicles and drivers.

Sample Curl

curl 'https://dev.digit.org/vendor/driver/v1/_update?tenantId=pb.amritsar' \
  -H 'authority: dev.digit.org' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'content-type: application/json;charset=UTF-8' \
  -H 'cookie: _ga=GA1.2.1852108775.1653914860; intercom-id-xp1951jv=17aa7431-3dc0-4524-9956-a22bb67a637f; __cuid=858e6f9f233c4b2c804d3f81109b48ac; amp_fef1e8=7faa94f4-6926-4f98-ac07-be2414f977c6R...1gkkb64lb.1gkkb6kvh.7p.a.83' \
  -H 'origin: https://dev.digit.org' \
  -H 'referer: https://dev.digit.org/digit-ui/employee/fsm/registry/modify-driver/b967d3ab-4ce4-41eb-931e-343734a673a0' \
  -H 'sec-ch-ua: "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' \
  --data-raw '{"driver":{"id":"b967d3ab-4ce4-41eb-931e-343734a673a0","tenantId":"pb.amritsar","name":"Vinot","owner":{"id":23597,"uuid":"1eaeae8e-e2cb-4736-b0da-2469441c7136","userName":"9876543210","password":null,"salutation":null,"name":"Vinot","gender":"MALE","mobileNumber":"9876543210","emailId":"abc@egov.com","altContactNumber":null,"pan":"","aadhaarNumber":null,"permanentAddress":"xxccc","permanentCity":null,"permanentPinCode":null,"correspondenceCity":null,"correspondencePinCode":null,"correspondenceAddress":"xxccc","active":true,"dob":1575504000000,"pwdExpiryDate":1542493260000,"locale":null,"type":"CITIZEN","signature":null,"accountLocked":false,"roles":[{"id":null,"name":"Citizen","code":"CITIZEN","tenantId":"pb"},{"id":null,"name":"FSM Desluding Operator","code":"FSM_DSO","tenantId":"pb"},{"id":null,"name":"FSM Driver","code":"FSM_DRIVER","tenantId":"pb"}],"fatherOrHusbandName":null,"relationship":"OTHER","bloodGroup":null,"identificationMark":null,"photo":null,"createdBy":"23299","createdDate":1533648094000,"lastModifiedBy":"28452","lastModifiedDate":1655290352000,"otpReference":null,"tenantId":"pb"},"ownerId":"1eaeae8e-e2cb-4736-b0da-2469441c7136","description":null,"licenseNumber":"34567899990","status":"ACTIVE","auditDetails":{"createdBy":"5674253d-9c2a-4d47-88ae-450f3fbbcad2","lastModifiedBy":"5674253d-9c2a-4d47-88ae-450f3fbbcad2","createdTime":1671536878567,"lastModifiedTime":1671536878567},"vendorDriverStatus":null},"RequestInfo":{"apiId":"Rainmaker","authToken":"5aac2f5f-086b-4770-a832-023641a62650","userInfo":{"id":28452,"uuid":"5674253d-9c2a-4d47-88ae-450f3fbbcad2","userName":"BPAFieldInspector","name":"lakshmi","mobileNumber":"8656565343","emailId":null,"locale":null,"type":"EMPLOYEE","roles":[{"name":"FSM Administrator","code":"FSM_ADMIN","tenantId":"pb.amritsar"},{"name":"BPA Services Approver","code":"BPA_APPROVER","tenantId":"pb.amritsar"},{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"},{"name":"FSM Employee Report Viewer","code":"FSM_REPORT_VIEWER","tenantId":"pb.amritsar"},{"name":"BPA Services verifier","code":"BPA_VERIFIER","tenantId":"pb.amritsar"},{"name":"BPA Field Inspector","code":"BPA_FIELD_INSPECTOR","tenantId":"pb.amritsar"},{"name":"BPAREG doc verifier","code":"BPAREG_DOC_VERIFIER","tenantId":"pb.amritsar"}],"active":true,"tenantId":"pb.amritsar","permanentCity":null},"msgId":"1671537564062|en_IN","plainAccessRequest":{}}}' \
  --compressed

Integration

Integration Scope

Any system or DIGIT module can be integrated with the vendor service. It helps to manage the vendor with the vehicles, drivers, and owner for representatives, and login for the representative/owner to login into the system to carry our role-specific operations.

Integration Benefits

  • Validation of DSO/vendor availability.

  • Fetch the vehicle assigned to the DSO.

  • Fetch the drivers assigned to the DSO.

Steps to Integration

  • FSM to call vendor/v1/_search to fetch the DSOs.

  • FSM can call vendor/v1/_search to fetch the DSO’s and the respective vehicles and drivers.

Interaction Diagrams

Reference Docs

Doc Links

Workflow Technical Document

Workflow Service

User technical document

User Service

MDMS technical document

NEEDS TO BE UPDATED

IDGen technical document

NEEDS TO BE UPDATED

Localisation technical document

NEEDS TO BE UPDATED

Persister technical document

NEEDS TO BE UPDATED

SMS notification technical document

NEEDS TO BE UPDATED

API contract

API Contract

Postman scripts

Postman Collection

API List

Title

Link

/vendor/v1/_create

https://api.postman.com/collections/23418568-17e45900-5801-462d-a6b1-2cf108b37c8d?access_key=PMAT-01GMQRX9YME11ZQKFV30QW4AP0

/vendor/v1/_search

https://api.postman.com/collections/23418568-17e45900-5801-462d-a6b1-2cf108b37c8d?access_key=PMAT-01GMQRX9YME11ZQKFV30QW4AP0

/vendor/v1/_plainsearch

https://www.getpostman.com/collections/c79e98843bcdcc873d09

/vendor/v1/_update

https://api.postman.com/collections/23418568-17e45900-5801-462d-a6b1-2cf108b37c8d?access_key=PMAT-01GMQRX9YME11ZQKFV30QW4AP0

/vendor/driver/v1/_create

https://api.postman.com/collections/23418568-17e45900-5801-462d-a6b1-2cf108b37c8d?access_key=PMAT-01GMQRX9YME11ZQKFV30QW4AP0

/vendor/driver/v1/_update

https://api.postman.com/collections/23418568-17e45900-5801-462d-a6b1-2cf108b37c8d?access_key=PMAT-01GMQRX9YME11ZQKFV30QW4AP0

/vendor/driver/v1/_search

https://api.postman.com/collections/23418568-17e45900-5801-462d-a6b1-2cf108b37c8d?access_key=PMAT-01GMQRX9YME11ZQKFV30QW4AP0

Workflow Service

Overview

Workflows are a series of steps that moves a process from one state to another by actions performed by different kind of actors - humans, machines, time-based events, etc., to achieve a goal such an onboarding an employee, or approving an application or granting a resource, among others. The egov-workflow-v2 is a workflow engine which helps in performing these operations seamlessly using a predefined configuration.

Pre-requisites

Before you proceed with the documentation, the following pre-requisites must be met:

  • Java 8

  • Kafka server is up and running.

  • egov-persister service is running and has workflow persister config path added in it.

  • PSQL server is running and the database is created to store workflow configuration and data.

Interaction Diagram

Key Functionalities

  • Always allow anyone with a role in the workflow state machine to view the workflow instances and comment on it.

  • On the creation of workflow, it will appear in the inbox of all employees who have roles which can perform any state transitioning actions in this state.

  • Once an instance is marked to an individual employee, it will appear only in that employee's inbox. Point 1 will still hold true and all others participating in the workflow can still search it and act if they have the necessary action available to them

  • If the instance is marked to a person who cannot perform any state transitioning action, they can still comment/upload and mark it to anyone else.

  • Overall SLA : SLA for the complete processing of the application/entity.

  • State level SLA: SLA for a particular state in the workflow.

Environment Variables

Description

egov.wf.default.offset

The default value of offset in search.

egov.wf.default.limit

The default value of limit in search.

egov.wf.max.limit

Maximum number of records that are returned in search response.

egov.wf.inbox.assignedonly

Boolean flag, if set to true default search, will return records assigned to the user only; if false. it will return all the records based on user’s role. (Default search is the search call when no query params are sent and based on the RequestInfo of the call, records are returned, it’s used to show applications in the employee inbox).

egov.wf.statelevel

Boolean flag set to true if state-level workflow is required.

Deployment Details

  1. Deploy latest version of egov-workflow-v2 service.

  2. Add businessService persister yaml path in persister configuration.

  3. Add role action mapping for BusinessService API’s.

  4. Overwrite the egov.wf.statelevel flag (true for state level and false for tenant level).

  5. Create businessService (workflow configuration) according to product requirements.

  6. Add role action mapping for /processInstance/_search API.

  7. Add workflow persister yaml path in persister configuration.

Configuration Details

For configuration details, refer to the links in reference docs.

Integration

Integration Scope

The workflow configuration can be used by any module which performs a sequence of operations on an application/entity. It can be used to simulate and track processes in organisations to make it more efficient to and increase the accountability.

Integration Benefits

  • Role-based workflow.

  • Easy way of writing rule.

  • File movement within workflow roles.

Steps to Integration

  1. To integrate, host of egov-workflow-v2 should be overwritten in helm chart.

  2. /process/_search should be added as the search endpoint for searching workflow processsInstance object. The search endpoint provides pagination with default value configurable. Pagination is controlled by passing limit and offset in query parameter.

  3. /process/_transition should be added to perform an action on an application. (It’s for internal use in modules and should not be added in role action mapping)

  4. The workflow configuration can be fetched by calling _search API to check if data can be updated or not in the current state.

Reference Docs

Title

Link

Configuring Workflows For New Product/Entity

Configuring Workflows For New Product/Entity

Setting Up Workflows

Setting Up Workflows

API Swagger Documentation

Swagger Documentation

Migration to Workflow 2.0

Workflow 2.0 Configuration doc

API List

Title

Link

/businessservice/_create

https://www.getpostman.com/collections/8552e3de40c819e34190

/businessservice/_update

https://www.getpostman.com/collections/8552e3de40c819e34190

/businessservice/_search

https://www.getpostman.com/collections/8552e3de40c819e34190

/process/_transition

https://www.getpostman.com/collections/8552e3de40c819e34190

/process/_search

https://www.getpostman.com/collections/8552e3de40c819e34190

Note: All the API’s are in the same postman collection, therefore, the same link is added in each row.

Configuring Workflows For New Product/Entity

Overview

Workflow is defined as a sequence of tasks that has to be performed on an application/entity to process it. The egov-workflow-v2 is a workflow engine which helps in performing this operations seamlessly using a predefined configuration. We will discuss how to create this configuration for a new product in this document.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met:

  • egov-workflow-v2 service is up and running

  • Role-Action mapping are added for businessService API’s

Key Functionalities

  • Create and modify workflow configuration according to the product requirements.

  • Configure state-level as well BusinessService-level SLA to efficiently track progress of the application.

  • Control access to perform actions through configuration.

Attribute Name

Description

tenantId

The tenantId (ULB code) for which the workflow configuration is defined.

businessService

The name of the workflow.

business

The name of the module which uses this workflow configuration.

businessServiceSla

The overall SLA to process the application (in milliseconds).

state

Name of the state.

applicationStatus

The status of the application when in the given state.

docUploadRequired

Boolean flag representing if document is required to enter the state.

isStartState

Boolean flag representing if the state can be used as a starting state in the workflow.

isTerminateState

Boolean flag representing if the state is the leaf node or end state in the workflow configuration. (No actions can be taken on states with this flag as true).

isStateUpdatable

Boolean flag representing whether data can be updated in the application when taking action on the state.

currentState

The current state on which action can be performed.

nextState

The resultant state after an action is performed.

roles

A list containing the roles which can perform the actions.

auditDetails

Contains fields to audit edits on the data (createdTime, createdBy, lastModifiedTIme, lastModifiedby).

Deployment Details

  1. Deploy latest version of egov-workflow-v2 service.

  2. Add businessService persister yaml path in persister configuration.

  3. Add Role-Action mapping for BusinessService API’s.

  4. Overwrite the egov.wf.statelevel flag (true for state level and false for tenant level).

Configuration Details

1. The Workflow configuration has 3 level of hierarchy:

a. BusinessService

b. State

c. Action

The top level object is BusinessService. It contains fields describing the workflow and a list of states that are part of the workflow. The businessService can be defined at the tenant level like pb.amritsar or at the state level like pb. All objects maintain an audit sub-object which keeps track of who is creating and updating, and the time.

{
        "tenantId": "pb.amritsar",
        "businessService": "PGR",
        "business": "pgr-services",
        "businessServiceSla": 432000000,
        "states": [...]
    }

Each state object is a valid status for the application. The state object contains the information of the state and what actions can be performed.

{
        "sla": 36000000,
        "state": "PENDINGFORASSIGNMENT",
        "applicationStatus": "PENDINGFORASSIGNMENT",
        "docUploadRequired": false,
        "isStartState": false,
        "isTerminateState": false,
        "isStateUpdatable": false,
        "actions": [...]
    }

The action object is the last object in hierarchy. It defines the name of the action and the roles that can perform the action.

{
          "action": "ASSIGN",
          "roles": [
              "GRO",
              "DGRO"
          ],
          "nextState": "PENDINGATLME",
      }

2. The workflow should always start from null state as the service treats new applications as having null as the initial state. For example:

{
                    "sla": null,
                    "state": null,
                    "applicationStatus": null,
                    "docUploadRequired": false,
                    "isStartState": true,
                    "isTerminateState": false,
                    "isStateUpdatable": true,
                    "actions": [
                        {
                            "action": "APPLY",
                            "nextState": "APPLIED",
                            "roles": [
                                "CITIZEN",
                                "CSR"
                            ]
                        }
                    ]
                }

3. In action object, whatever nextState is defined, the application will be sent to that state. It can be to another forward state or even some backward state from where the application have already passed. (Generally such actions are named SENDBACK).

4. SENDBACKTOCITIZEN is a special keyword for the action name. This action sends back the application to a citizen’s inbox for him/her to take action. A new state should be created on which a citizen can take action and should be the nextState of this action. While calling this action from module, the assignes should be enriched by the module with the UUIDs of the owners of the application.

Integration

For integration related steps, refer to the document "Setting Up Workflows" in the reference docs.

Reference Docs

Title

Link

Workflow Service Documentation

Workflow Service

Setting Up Workflows

Setting Up Workflows

API List

Title

Link

_create

https://www.getpostman.com/collections/8552e3de40c819e34190

_update

https://www.getpostman.com/collections/8552e3de40c819e34190

_search

https://www.getpostman.com/collections/8552e3de40c819e34190

Note: All the API’s are in the same postman collection, and hence, the same link has been added in each row.

Setting Up Workflows

Overview

Every service integrated with egov-workflow-v2 service needs to first define the workflow configuration which describes the states in the workflow, the action that can be taken on these states, who all can perform those actions, SLA, etc. This configuration is created using APIs and is stored in DB. The configuration can be created either at the state-level or tenant-level based on the requirements.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met:

  • egov-workflow-v2 service is up and running

  • Role Action mapping is added for the BusinessService API’s

Key Functionalities

  • Create and modify the workflow configuration.

  • Configure the state level as well the BusinessService-level SLA.

  • Control access to workflow actions from configuration.

  • Validate if the flow defined in configuration is complete during creation.

Deployment Details

  1. Deploy latest version of egov-workflow-v2 service.

  2. Add role action mapping for BusinessService API’s (preferably add create and update only for SUPERUSER. Search can be added for a CITIZEN and required employee roles like TL_CEMP, etc.).

  3. Overwrite the egov.wf.statelevel flag (true for state-level and false for tenant-level).

  4. Add businessService persister yaml path in persister configuration.

Confuiguration Details

1. Create the businessService JSON based on the product requirement. Following is a sample json of a simple 2-step workflow where an application can be applied by a citizen or counter employee, and then can be either rejected or approved by the approver.

{
      "tenantId": "pb",
      "businessService": "PGR",
      "business": "pgr-services",
      "businessServiceSla": 432000000,
      "states": [
        {
          "sla": null,
          "state": null,
          "applicationStatus": null,
          "docUploadRequired": false,
          "isStartState": true,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "APPLY",
              "nextState": "PENDINGFORASSIGNMENT",
              "roles": [
                "CITIZEN",
                "COUNTER_EMPLOYEE"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "APPLIED",
          "applicationStatus": "APPLIED",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": false,
          "actions": [
            {
              "action": "APPROVE",
              "nextState": "APPROVED",
              "roles": [
                "APPROVER"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
                "APPROVER"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "REJECTED",
          "applicationStatus": "REJECTED",
          "isStateUpdatable": false,
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": true
        },
        {
          "sla": null,
          "state": "APPROVED",
          "applicationStatus": "APPROVED",
          "isStateUpdatable": false,
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": true
        }
      ]
    }

2. Once the businessService json is created, add it in request body of _create API of the workflow, and call the API to create the workflow.

3. To update the workflow, search the workflow object using _search API, and then make changes in the businessService object and then call _update using the modified search result. (States cannot be removed using _update API as it will leave the applications in that state in an invalid state. In such cases, first all the applications in that state should be moved forward or backward, and then the state should be disabled through DB directly).

Integration

Integration Scope

The workflow configuration can be used by any module which performs a sequence of operations on an application/entity. It can be used to simulate and track processes in organisations to make it more efficient, and increase the accountability.

Integration Benefits

Integrating with the workflow service provides a way to have a dynamic workflow configuration which can be easily modified according to the changing requirements. The modules do not have to deal with any validations regarding the workflow such as authorisation of the user to take an action, if documents are required to be uploaded at certain stage, etc., as they will be automatically handled by egov-workflow-v2 service based on the configuration defined. It automatically keeps updating the SLA for all applications, which provides a way to track the time taken by an application to get processed.

Steps to Integration

  1. To integrate, the host of egov-workflow-v2 should be overwritten in the helm chart.

  2. /egov-workflow-v2/egov-wf/businessservice/_search should be added as the endpoint for searching the workflow configuration. (Other endpoints are not required once the workflow configuration is created).

  3. The configuration can be fetched by calling _search API.

Reference Docs

Title

Link

Configuring workflows for new product/entity

Configuring Workflows For New Product/Entity

Workflow service documentation

Workflow Service

API List

Title

Link

_create

https://www.getpostman.com/collections/8552e3de40c819e34190

_update

https://www.getpostman.com/collections/8552e3de40c819e34190

_search

https://www.getpostman.com/collections/8552e3de40c819e34190

Note: All APIs are in the same postman collection. Hence, the same link has been added in each row.

Workflow 2.0 Configuration

Coming soon...

User Service

Overview

User service is responsible for user data management, and providing functionality to login and logout in the DIGIT system.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met:

  • Java 8

  • Kafka server is up and running

  • Encryption and MDMS services are running

  • PSQL server is running and database

  • Redis is running

Key Functionalities

  • Store, update and search user data

  • Provide authentication

  • Provide login,logout functionality into DIGIT platform

  • Store user data PIIs in encrypted form

Interaction Diagram

Deployment Details

  1. Set up latest version of egov-enc-service and egov-mdms- service.

  2. Deploy latest version of egov-user service.

  3. Add role action mapping for APIs.

Configuration Details

Following are the properties in application.properties file in user service which are configurable:

Property

Value

Remarks

egov.user.search.default.size

10

Default search record number limit

citizen.login.password.otp.enabled

true

Whether citizen login is OTP-based

employee.login.password.otp.enabled

false

Whether employee login is OTP-based

citizen.login.password.otp.fixed.value

123456

Fixed OTP for citizens

citizen.login.password.otp.fixed.enabled

false

Allow fixed OTP for citizens

otp.validation.register.mandatory

true

Whether OTP is compulsory for registration

access.token.validity.in.minutes

10080

Validity time of access token

refresh.token.validity.in.minutes

20160

Validity time of refresh token

default.password.expiry.in.days

90

Expiry date of a password

account.unlock.cool.down.period.minutes

60

Unlock time

max.invalid.login.attempts.period.minutes

30

Window size for counting attempts for lock

max.invalid.login.attempts

5

Max failed login attempts before account is locked

egov.state.level.tenant.id

pb

Integration

Integration Scope

User data management and functionality to login and logout into Digit system using OTP and password.

Integration Benefits

Employee

  • User registration

  • Search user

  • Update user details

  • Forgot password

  • Change password

  • User role mapping (single ULB to multiple roles)

  • Enable employee to login into DIGIT system based on password

Citizen

  • Create user

  • Update user

  • Search user

  • User registration using OTP

  • OTP-based login

Steps to Integration

  • To integrate, the host of the egov-user should be overwritten in helm chart.

  • Use /citizen/_create endpoint for creating users into the system. This endpoint requires the user to validate his/her mobile number using OTP. The OTP will be send to his/her mobile number, and then that OTP will be send as otpReference in the request body.

  • Use /v1/_search and /_search endpoints to search users in the system depending on various search parameters.

  • Use /profile/_update for updating the user profile. The user will be validated (either by OTP-based validation or password validation) when this API is called.

  • /users/_createnovalidate and /users/_updatenovalidate are endpoints to create user data into the system without any validations (no OTP or password required). They should be strictly used only for creating/updating users internally and should not be exposed outside.

  • Forgot password: In case the user forgets the password, it can be reset by calling /user-otp/v1/_send which will generate and send the OTP to the employee’s mobile number. The password can then be updated using this OTP by calling the API /password/nologin/_update in which new password along with the OTP has to be sent.

  • Use /password/_update to update the existing password by logging in. In the request body, both the old and new passwords hace to be sent. Details of the API can be found in the attached swagger documentation.

  • Use /user/oauth/token for generating token, /_logoutfor logout and /_details for getting user information from the token.

  • Multi-tenant user: This functionality allows a user to perform actions across multiple ULBs. For example, an employee belonging to Amritsar can perform a role of say a trade license approver for Jalandhar by assigning a tenant-level role of tenantId pb.jalandhar to him/her.

{
        "id": 24226,
        "uuid": "11t0e02b-0145-4de2-bc42-c97b96264807",
        "userName": "xyz",
        "name": "abc",
        "mobileNumber": "9999999999",
        "emailId": "abc@gmail.com",
        "locale": null,
        "type": "EMPLOYEE",
        "roles": [
            {
                "name": "Employee",
                "code": "EMPLOYEE",
                "tenantId": "pb.amritsar"
            },
            {
                "name": "TL Approver",
                "code": "TL_APPROVER",
                "tenantId": "pb.jalandhar"
            }
        ],
        "active": true,
        "tenantId": "pb.amritsar"
    }
  • If an employee has a role with a state-level tenantId he/she can perform actions corresponding to that role across all tenants.

  • Refresh token: Whenever the /user/oauth/token is called to generate the access_token, along with the access_token one more token is generated called refresh_token. The refresh token is used to generate a new access_token whenever the existing one expires. Till the refresh token is valid, the user will not have to login even if his/her access_token gets expired as it will be generated using refresh_token. The validity time of the refresh token is configurable and can be configured using the property: refresh.token.validity.in.minutes

User Data Privacy

MDMS configuration for security policy

{
  "tenantId": "pb",
  "moduleName": "DataSecurity",
  "SecurityPolicy": [
    {
      "model": "User",
      "uniqueIdentifier": {
        "name": "uuid",
        "jsonPath": "uuid"
      },
      "attributes": [
        {
          "name": "name",
          "jsonPath": "name",
          "patternId": "002",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "mobileNumber",
          "jsonPath": "mobileNumber",
          "patternId": "001",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "emailId",
          "jsonPath": "emailId",
          "patternId": "004",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "username",
          "jsonPath": "username",
          "patternId": "002",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "altContactNumber",
          "jsonPath": "altContactNumber",
          "patternId": "001",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "alternatemobilenumber",
          "jsonPath": "alternatemobilenumber",
          "patternId": "001",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "pan",
          "jsonPath": "pan",
          "patternId": "001",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "aadhaarNumber",
          "jsonPath": "aadhaarNumber",
          "patternId": "001",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "guardian",
          "jsonPath": "guardian",
          "patternId": "002",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "permanentAddress",
          "jsonPath": "permanentAddress/address",
          "patternId": "003",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "correspondenceAddress",
          "jsonPath": "correspondenceAddress/address",
          "patternId": "003",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "fatherOrHusbandName",
          "jsonPath": "fatherOrHusbandName",
          "patternId": "002",
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "searchUsername",
          "jsonPath": "userName",
          "patternId": "002",
          "defaultVisibility": "PLAIN"
        }
      ],
      "roleBasedDecryptionPolicy": [
        {
          "roles": [
            "PGR_LME",
            "GRO"
          ],
          "attributeAccessList": [
            {
              "attribute": "name",
              "firstLevelVisibility": "MASKED",
              "secondLevelVisibility": "PLAIN"
            },
            {
              "attribute": "mobileNumber",
              "firstLevelVisibility": "MASKED",
              "secondLevelVisibility": "PLAIN"
            },
            {
              "attribute": "username",
              "firstLevelVisibility": "MASKED",
              "secondLevelVisibility": "PLAIN"
            },
            {
              "attribute": "permanentAddress",
              "firstLevelVisibility": "MASKED",
              "secondLevelVisibility": "PLAIN"
            }
          ]
        },
        {
          "roles": [
            "TLCEMP"
          ],
          "attributeAccessList": [
            {
              "attribute": "mobileNumber",
              "firstLevelVisibility": "MASKED",
              "secondLevelVisibility": "PLAIN"
            }
          ]
        }
      ]
    },
    {
      "model": "UserSelf",
      "uniqueIdentifier": {
        "name": "uuid",
        "jsonPath": "uuid"
      },
      "attributes": [
        {
          "name": "name",
          "jsonPath": "name",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "mobileNumber",
          "jsonPath": "mobileNumber",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "emailId",
          "jsonPath": "emailId",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "username",
          "jsonPath": "username",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "altContactNumber",
          "jsonPath": "altContactNumber",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "alternatemobilenumber",
          "jsonPath": "alternatemobilenumber",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "pan",
          "jsonPath": "pan",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "aadhaarNumber",
          "jsonPath": "aadhaarNumber",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "guardian",
          "jsonPath": "guardian",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "permanentAddress",
          "jsonPath": "permanentAddress/address",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "correspondenceAddress",
          "jsonPath": "correspondenceAddress/address",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        },
        {
          "name": "fatherOrHusbandName",
          "jsonPath": "fatherOrHusbandName",
          "patternId": null,
          "defaultVisibility": "PLAIN"
        }
      ],
      "roleBasedDecryptionPolicy": []
    }
  ]
}

There are two security policy model for user data: User and UserSelf. In model User, field attributes contain a list of fields from the User object that needs to be secured and field roleBasedDecryptionPolicy is an attribute-level role-based policy. It will define visibility for each attribute.

UserSelf model contains the same structure of security policy, but User security model is used for Search API response and UserSelf is used for Create/Update API response.

Visibility of the PII data is based on the above MDMS configuration. There are three types of visibility mentioned in the configuration:

  1. PLAIN - Show text in plain form.

  2. MASKED - The returned text will contain masked data. The masking pattern will be applied as defined in the Masking Patterns master data.

  3. NONE - The returned text will not contain any data. It would contain string like “Confidential Information”.

Plain access request

{
  "RequestInfo": {
    "plainAccessRequest": {
      "recordId": "d5ee3d45-13a1-4aa5-bd86-9b8dae34b900"
      "fields": [ "name", "mobileNumber" ]
    }
  }
}

Any user will be able to get plain access to the secured data (citizen’s PII) by requesting through the plainAccessRequest parameter. It takes the following parameters:

  1. recordId - It is the unique identifier of the record that is requested for plain access.

  2. fields - It defines a list of attributes that are requested for plain access.

To know more about the encryption policy, refer to document Encryption Service mentioned in the reference docs.

Reference Docs

Title

Link

User data encryption promotion details

User data encryption promotion

Encryption Service

Encryption client library

API List

Title

Link

/citizen/_create

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/users/_createnovalidate

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/_search

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/v1/_search

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/_details

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/users/_updatenovalidate

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/profile/_update

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/password/_update

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/password/nologin/_update

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/_logout

https://www.getpostman.com/collections/15443fcb25c8aacd8897

/user/oauth/token

https://www.getpostman.com/collections/15443fcb25c8aacd8897

Note: All APIs are in the same postman collection, and hence, the same link has been added in each row.

User Data Encryption Promotion

Promotion of Encryption Service

Steps

  • Choose values for the following fields:

- master-password: choose any string of any length (can contain alphanumerics and special characters)

- master-salt: choose any string of length 8 (can contain alphanumerics and special characters)

- master-initialvector: choose any string of length 12 (can contain alphanumerics and special characters)

- Ask devops to generate keys for above selected values,

- In environment secrets.yml file, add “egov-enc-service” subsection under 'secrets' section, and provide values for above three fields. For example: For dev environment https://github.com/egovernments/eGov-infraOps/blob/master/helm/environments/dev-secrets.yaml#L29 (Ask Devops to do it)

  • Add field “state-level-tenant-id“ under “egov-enc-service:” section for state level tenantId in environment yml. Example: https://github.com/egovernments/eGov-infraOps/blob/master/helm/environments/qa.yaml#L525

  • Promote egov-enc-service:4-master-f47bff2

  • Make sure “egov-enc-service“ entry is present in “egov-service-host” in environment yml ,ex:- for dev https://github.com/egovernments/eGov-infraOps/blob/master/helm/environments/dev.yaml#L65 . If not, make changes and build and deploy zuul from master branch.

Data Migration

Steps

  • Provide DB details in following environment variables

- DB_PASSWORD

- DB_HOST

- DB_PORT

- DB_USERNAME

- DB_NAME'

  • Backup old tables

- Create table eg_user_backup_plaintext as (select * from eg_user)

- Create table eg_user_address_backup_plaintext as (select * from eg_user_address)

  • Delete foreign key referenced on ‘eg_user’ from ‘eg_userrole_v1’ temporarily until the data is transformed

- ALTER TABLE eg_userrole_v1 DROP CONSTRAINT fk_user_role_v1

  • Deploy user service build with encryption to run flyway migration (egov-user:11-user_changes_MT-800f319)

  • Clean tables of all plain text data

- Delete from eg_user_address

- Delete from eg_user

  • Run migration

- Script python package dependencies

- import psycopg2

- import sys

- import json

- import requests

- import configparser

- import logging

- import os

Commands to run for migration:

- python3 user_migration.py config_user_encryption.txt

- python3 user_migration.py config_address_encryption.tx

  • Restore earlier deleted foreign key constraint

- ALTER TABLE eg_userrole_v1 ADD CONSTRAINT fk_user_role_v1 FOREIGN KEY (user_id, user_tenantid) REFERENCES eg_user(id, tenantid) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION

Service Builds

  • User service: egov-user:11-user_changes_MT-800f319

- Set environment variable “DECRYPTION_ABAC_ENABLED” to false

  • User service copy for chatbot: egov-user-chatbot:4-user_changes_MT-621fe60

Note: Promote only if Whatsapp chatbot is already running in the system. It uses another copy of user service named “egov-user-chatbot“. Not needed if Whatsapp- chatbot is not in the system.

  • Report service: report:22-report-encryption-changes-e92c8ae

  • enc-service: egov-enc-service:4-master-f47bff2

  • MDMS: Copy the MDMS folder - https://github.com/egovernments/egov-mdms-data/tree/master/data/pb/DataSecurity

Encryption Client Library

Overview

The enc-client library is a supplementary Java library provided to support encryption-related functionalities so that every service does not need to pre-process the request before calling the encryption service.

Pre-requisites

  • MDMS Service

  • Encryption Service

  • Kafka

Note: The MDMS configurations explained below are fetched by this library at boot time. After you make changes in the MDMS repo and restart the MDMS service, you will need to RESTART THE SERVICE which has imported the enc-client library. For example, the report service is using the enc-client library, so after making configuration changes to the security policy pertaining to any report, you will have to restart the report service.

Key Functionalities

  • Encrypt a JSON Object - The encryptJson function of the library takes any Java object as an input and returns an object which has encrypted values of the selected fields. The fields to be encrypted are selected based on an MDMS configuration. This function requires the following parameters:

  1. Java/JSON object - The object whose fields will get encrypted.

  2. Model - It is used to identify the MDMS configuration to be used to select fields of the provided object.

  3. Tenant Id - The encryption key will be selected based on the passed tenantId.

  • Encrypt a Value - The encryptValue function of the library can be used to encrypt single values. This method also required a tenantId parameter.

  • Decrypt a JSON Object - The decryptJson function of the library takes any Java Object as an input and returns an object that has plain/masked or no values of the encrypted fields. The fields are identified based on the MDMS configuration. The returned value(plain/masked/null) of each of the attribute depends on the user’s role and if it is a PlainAccess request or a normal request. These configurations are part of the MDMS. This function required following parameters:

  1. Java/JSON object - The object containing the encrypted values that are to be decrypted.

  2. Model - It is used to select a configuration from the list of all available MDMS configurations.

  3. Purpose - It is a string parameter that passes the reason of the decrypt request. It is used for Audit purposes.

  4. RequestInfo - The requestInfo parameter serves multiple purposes:

- User Role - A list of user roles are extracted from the requestInfo parameter.

- PlainAccess Request - If the request is an explicit plain access request, it is to be passed as a part of the requestInfo. It will contain the fields that user is requesting for decryption and the id of record.

  • While decrypting Java object, this method also audits the request.

Configurations

All configurations related to enc-client library are stored in the MDMS. These master data are stored in DataSecurity module. It has two types of configurations:

  1. Masking patterns

  2. Security policy

Masking Patterns

{
    "patternId": "001",
    "pattern": ".(?=.{4})"
}

The masking patterns for different types of attributes (mobile number, name, etc.) are configurable in MDMS. It contains the following attributes:

  1. patternId - It is the unique pattern identifier. This id is referred to in the SecurityPolicy MDMS.

  2. pattern - This defines the actual pattern according to which the value will be masked.

Click here to see a sample of the masking patterns master data.

To know more about regular expression refer the below articles https://towardsdatascience.com/regular-expressions-clearly-explained-with-examples-822d76b037b4 Java Regular Expressions for Masks To test regular expression refer the below link. regex101: build, test, and debug regex

Security Policy

The security policy master data contains the policy used to encrypt and decrypt JSON objects. Each security policy contains the following details:

  1. model - This is the unique identifier of the policy.

  2. uniqueIdentifier - The field defined here should uniquely identify records passed to the decryptJson function.

  3. attributes - This defines a list of fields from the JSON object that needs to be secured.

  4. roleBasedDecryptionPolicy - This defines attribute-level role-based policy. It will define visibility for each attribute.

Visibility

The visibility is an enum with the following options:

  1. PLAIN - Show text in a plain form.

  2. MASKED - The returned text will contain masked data. The masking pattern will be applied as defined in the masking patterns master data.

  3. NONE - The returned text will not contain any data. It would contain string like “Confidential Information”.

It defines what level of visibility should the decryptJson function return for each attribute.

Attribute

{
  "name": "mobileNumber",
  "jsonPath": "mobileNumber",
  "patternId": "001",
  "defaultVisibility": "MASKED"
}
  1. name - This uniquely identifies the attribute out of the list of attributes for a given model.

  2. jsonPath - It is the json path of the attribute from the root of the model. This jsonPath is NOT the same as Jayway JsonPath library. This uses / and * to define the Json paths.

  3. patternId - It refers to the pattern to be used for masking which is defined in the masking patterns master.

  4. defaultVisibility - It is an enum configuring the default level of visibility of that attribute. If the visibility is not defined for a given role, then this defaultVisibility will apply.

The attribute defines a list of attributes of the model that are to be secured. The attribute is defined by the following parameters:

Unique Identifier

This parameter is used to define the unique identifier of that model. It is used for the purpose of auditing the access logs. (This attribute’s jsonPath should be at the root level of the model).

{
  "name": "uuid",
  "jsonPath": "uuid"
}

Role-Based Decryption Policy

{
  "roles": [ "PGR_LME", "GRO" ],
  "attributeAccessList": [
    {
      "attribute": "name",
      "firstLevelVisibility": "MASKED",
      "secondLevelVisibility": "PLAIN"
    },
    {
      "attribute": "mobileNumber",
      "firstLevelVisibility": "MASKED",
      "secondLevelVisibility": "PLAIN"
    }
  ]
}

It defines attribute-level access policies for a list of roles, and has the following parameters:

  1. roles - It defines a list of role codes for which the policy will get applied. Make sure not to duplicate role codes anywhere in the other policy. Otherwise, any one of the policies will get chosen for that role code.

  2. attributeAccessList - It defines a list of attributes for which the visibility differs from the default for those roles. There are two levels of visibility:

    1. First-level visibility: It applies to normal search requests. The search response could have multiple records.

    2. Second-level visibility: It is applied only when a user explicitly requests for plain access of a single record with a list of fields required in plain. The second-level visibility can be requested by passing plainAccessRequest in the RequestInfo.

    Plain Access Request

{
  "RequestInfo": {
    "plainAccessRequest": {
      "recordId": "d5ee3d45-13a1-4aa5-bd86-9b8dae34b900"
      "fields": [ "name", "mobileNumber" ]
    }
  }
}

Any user will be able to get plain access to the secured data (citizen’s PII) by requesting through the plainAccessRequest parameter. It takes the following parameters:

  1. recordId - It is the unique identifier of the record that is requested for plain access.

  2. fields - It defines a list of attributes that are requested for plain access.

Audit Service

Every decrypt request is audited. Based on the uniqueIdentifier defined as part of the security policy, it lists out the identifiers of the records that were decrypted as part of the request. Each audit object contains the following attributes:

AuditObject {  
    private String id;      // Audit object's unique identifer

    private String userId;  // The user that has requested for decryption

    private Long timestamp; // The time at which the decryption was requested

    private String purpose; // The purpose of the decryption request

    private String model;   // The model that is requested to decrypt

    private List<String> entityIds; // A list of ids of the entity that were decrypted

    private PlainRequestAccess plainRequestAccess;  // The parameters that were passed as part of the decryption request

    private JsonNode additionalInfo;  // A space for storing any additional information
}

API Contract

Click here to access the document.

FSM Vehicle Registry

Configuration and setup details on registering vehicles in FSM module

Overview

Vehicle registry is a system that enables urban local body (ULB) employees to create and search vehicle entities, schedule vehicle trips for FSM application and track vehicle trips. This document contains the details about the new enhancements made to the vehicle service and how to set up the vehicle and describes the functionalities provided.

Pre-requisites

Before you proceed with the configuration, make sure the following prerequisites are met:

  • Java 8

  • Kafka server is up and running.

  • egov-persister service is running and has vehicle-persister config path added in it.

  • PSQL server is running and database is created to store FSM Application data.

  • Following services should be up and running:

- egov-perister

- egov-mdms-service

- egov-workflow-v2

- egov-idgen

Key Functionalities

EXISTING

  1. DSO or ULB can create multiple vehicle trips based on the number of trips entered while submitting the FSM application.

  2. FSTPO can decline the vehicle trip with appropriate reason.

  3. Owner attribute has been added to the vehicle.

  4. FSTPO Vehicle Log Inbox Enhancements to include Application No search filter so that FSTPO can view all the vehicle trips associated with the application.

  5. FSPTO vehicle log API upgraded to show trip numbers in case of multi-trip application.

  6. Introduced Vehicle Tab.

  7. Option to add/remove/update vehicle individually.

  8. Admin can enable or disable the vehicle.

  9. Functionality to add/remove vehicles to vendor.

ENHANCEMENT

  1. Part Search: The Vehicle tab now includes the ability to perform a part search by vehicle number. This means that users can enter a partial vehicle number and retrieve all relevant results that contain that specific portion. For example, if the vehicle number is "AA 77 JJ 3324", users can search for any part of the vehicle number, such as "AA", "77", or "JJ", and retrieve all relevant results that contain that specific portion.

  2. Updating Registry Information: In the Vehicle Tab, the admin has the ability to update certain vehicle information, such as Owner name, Phone Number. Added a new column for gender , Dob and Email address which are updatable.

Deployment Details

  1. Deploy the latest version of the vehicle.

  2. Add vehicle-persister.yml file in config folder in git and add that path in persister . (The file path is to be added in environment yaml file in param called persist-yml-path ) and restart egov-persister-service.

  3. Integrate the following below changes in vehicle-persister.yml SAN-1063 and 1064 (SAN-1158 and SAN-1157) - Persister file - Vehicle… · egovernments/configs@2e53637

  4. SM-801 removing extra tab space by madan-kumar-eGov · Pull Request #2238 · egovernments/configs

  5. SM-801 vehicle not able to create in uat by madan-kumar-eGov · Pull Request #2240 · egovernments/configs

Configuration Details

Update vehicle-persister.yaml · egovernments/configs@32a7e1b

Update vehicle-persister.yaml · egovernments/configs@23237c8

added jsonb data type for additionalDetails column in save-vehicle-ap… · egovernments/configs@9b2f604

Added the audit logging for vehicle and vendor · egovernments/configs@482185f

SAN-1047 - Added the query map for update vehicle and vendor topics. · egovernments/configs@56da639

History for egov-persister/vehicle-persister.yaml - egovernments/configs

configs/vendor-persister.yaml at DEV · egovernments/configs

MDMS Configuration

Add master data in MDMS service with module name as vehicle and restart egov-mdms-service. Following are some sample master data for:

SuctionType

{
    "tenantId": "pb",
    "moduleName": "Vehicle",
    "SuctionType": [
        {
            "code": "SEWER_SUCTION_MACHINE",
            "name": "Sewer suction machine",
            "active": true
        },
        {
            "code": "SEWER_SUCTION_CUM_JETTING_MACHINE",
            "name": "Sewer suction cum jetting machine",
            "active": true
        }
    ]
}

VehicleOwner

{
    "tenantId": "pb",
    "moduleName": "Vehicle",
    "VehicleOwner": [{
            "name": "ULB",
            "code": "ULB",
            "active": true
        },
        {
            "name": "Private",
            "code": "Private",
            "active": true
        }
    ]
}

VehicleMakeModel

{
    "tenantId": "pb",
    "moduleName": "Vehicle",
    "VehicleMakeModel": [
        {
            "code": "MAHINDRA",
            "name": "Mahindra",
            "active": true
        },
        {
            "code": "MAHINDRA.BOLERO_PICKUP",
            "name": "Bolero Pickup",
            "active": true,
            "make": "MAHINDRA",
            "capacity": "5000",
            "amount": "500"
        },
        {
            "code": "TATA",
            "name": "TATA",
            "active": true
        },
        {
            "code": "TATA.LPT709/34",
            "name": "TATA LPT709/34",
            "active": true,
            "make": "TATA",
            "capacity": "2000",
            "amount": "200"
        },
        {
            "code": "TATA.407",
            "name": "TATA 407",
            "active": true,
            "make": "TATA",
            "capacity": "1000",
            "amount": "100"
        },
        {
            "code": "TAFE",
            "name": "TAFE",
            "active": true
        },
        {
            "code": "TAFE.TRACTOR_45DI",
            "name": "TAFE Tractor 45DI",
            "active": true,
            "make": "TAFE",
            "capacity": "10000",
            "amount": "1000"
        },
        {
            "code": "SONALIKA",
            "name": "Sonalika",
            "active": true
        },
        {
            "code": "SONALIKA.TRACTOR_35DI",
            "name": "Sonalika Tractor 35DI",
            "active": true,
            "make": "SONALIKA",
            "capacity": "8000",
            "amount": "1000"
        }
    ]
}

FSTPO Rejection Reason (Vehicle decline reason codes)

{
    "tenantId": "pb",
    "moduleName": "Vehicle",
    "FSTPORejectionReason": [{
            "name": "Septage Source",
            "code": "SEPTAGE_SOURCE",
            "active": true
        },
        {
            "name": "Outside operational hours",
            "code": "OUTSIDE_OPERATIONAL_HOURS",
            "active": true
        },
        {
            "name": "Under Maintenance",
            "code": "UNDER_MAINTENANCE",
            "active": true
        },
        {
            "name": "Others",
            "code": "OTHERS",
            "active": true
        }
    ]
}

SAN-1049: Added role actions for Driver APIs. · egovernments/egov-mdms-data@fb8e530

SAN-1063: Added the permissiosn for Vehicle trip creation · egovernments/egov-mdms-data@632ee94

SAN-1047: Added role action mapping for vendor and vehicle update · egovernments/egov-mdms-data@3e608a8

Business Service/Workflow Configuration

  1. Search the FSM_VEHICLE_TRIP workflow by the given search API.

/egov-workflow-v2/egov-wf/businessservice/_search? tenantId=pb.amritsar&businessServices=FSM_VEHICLE_TRIP

2. Update this below given action at “null” state at line no. 20 for FSM_VEHICLE_TRIP in below workflow and restart the workflow service.

{
  "action": "READY_FOR_DISPOSAL",
  "currentState": "61e01ccd-be34-4705-ae82-13ae93200fb3",
  "nextState": "e217e14a-7d3a-41bc-ae31-7ab2dce26f02",
  "roles": [
    "FSM_DSO",
    "FSM_EDITOR_EMP",
    "FSM_EMP_FSTPO"
  ],
  "active": true
}

"BusinessServices": [
       {
           "tenantId": "pb.amritsar",
           "uuid": "22c802e6-5354-43be-979a-8a653753459e",
           "businessService": "FSM_VEHICLE_TRIP",
           "business": "vehicle",
           "businessServiceSla": 172800000,
           "states": [
               {
                   "auditDetails": {
                       "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                       "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                       "createdTime": 1613116718088,
                       "lastModifiedTime": 1654241412659
                   },
                   "uuid": "61e01ccd-be34-4705-ae82-13ae93200fb3",
                   "tenantId": "pb.amritsar",
                   "businessServiceId": "22c802e6-5354-43be-979a-8a653753459e",
                   "sla": null,
                   "state": null, 
                   "applicationStatus": null,
                   "docUploadRequired": false,
                   "isStartState": true,
                   "isTerminateState": false,
                   "isStateUpdatable": true,
                   "actions": [
                       {
                           "auditDetails": {
                               "createdBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "createdTime": 1654241412659,
                               "lastModifiedTime": 1654241412659
                           },
                           "uuid": "344d60a6-b415-4937-8a20-e1a70d767f01",
                           "tenantId": "pb.amritsar",
                           "currentState": "61e01ccd-be34-4705-ae82-13ae93200fb3",
                           "action": "CREATE_FSTPO_VEHICLE_LOG",
                           "nextState": "0fec53d3-6940-44c9-8582-2a09bd1f413a",
                           "roles": [
                               "FSM_EMP_FSTPO"
                           ],
                           "active": true
                       },
                       {
                           "auditDetails": {
                               "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                               "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "createdTime": 1613116718088,
                               "lastModifiedTime": 1654241412659
                           },
                           "uuid": "96e88b11-25d8-4cc1-b35c-6ce5edcb5904",
                           "tenantId": "pb.amritsar",
                           "currentState": "61e01ccd-be34-4705-ae82-13ae93200fb3",
                           "action": "SCHEDULE",
                           "nextState": "71f17154-40b8-4595-903a-c8d93c124abe",
                           "roles": [
                               "FSM_DSO",
                               "FSM_EDITOR_EMP",
                               "FSM_EMP_FSTPO"
                           ],
                           "active": true
                       },
                       {
                           "action": "READY_FOR_DISPOSAL",
                           "currentState": "61e01ccd-be34-4705-ae82-13ae93200fb3",
                           "nextState": "e217e14a-7d3a-41bc-ae31-7ab2dce26f02",
                           "roles": [
                               "FSM_DSO",
                               "FSM_EDITOR_EMP",
                               "FSM_EMP_FSTPO"
                           ],
                           "active": true
                       }
                   ]
               },
               {
                   "auditDetails": {
                       "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                       "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                       "createdTime": 1613116718088,
                       "lastModifiedTime": 1654241412659
                   },
                   "uuid": "71f17154-40b8-4595-903a-c8d93c124abe",
                   "tenantId": "pb.amritsar",
                   "businessServiceId": "22c802e6-5354-43be-979a-8a653753459e",
                   "sla": null,
                   "state": "SCHEDULED",
                   "applicationStatus": "SCHEDULED",
                   "docUploadRequired": false,
                   "isStartState": true,
                   "isTerminateState": false,
                   "isStateUpdatable": true,
                   "actions": [
                       {
                           "auditDetails": {
                               "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                               "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "createdTime": 1613116718088,
                               "lastModifiedTime": 1654241412659
                           },
                           "uuid": "b82e310e-a519-4ee8-8aaf-550cccbe26b2",
                           "tenantId": "pb.amritsar",
                           "currentState": "71f17154-40b8-4595-903a-c8d93c124abe",
                           "action": "READY_FOR_DISPOSAL",
                           "nextState": "e217e14a-7d3a-41bc-ae31-7ab2dce26f02",
                           "roles": [
                               "FSM_DSO",
                               "FSM_EDITOR_EMP",
                               "FSM_EMP_FSTPO"
                           ],
                           "active": true
                       }
                   ]
               },
               {
                   "auditDetails": {
                       "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                       "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                       "createdTime": 1613116718088,
                       "lastModifiedTime": 1654241412659
                   },
                   "uuid": "e217e14a-7d3a-41bc-ae31-7ab2dce26f02",
                   "tenantId": "pb.amritsar",
                   "businessServiceId": "22c802e6-5354-43be-979a-8a653753459e",
                   "sla": null,
                   "state": "WAITING_FOR_DISPOSAL",
                   "applicationStatus": "WAITING_FOR_DISPOSAL",
                   "docUploadRequired": false,
                   "isStartState": true,
                   "isTerminateState": false,
                   "isStateUpdatable": true,
                   "actions": [
                       {
                           "auditDetails": {
                               "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                               "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "createdTime": 1643360911202,
                               "lastModifiedTime": 1654241412659
                           },
                           "uuid": "9a8b4fd2-8954-48b4-b593-b5ae273ea33f",
                           "tenantId": "pb.amritsar",
                           "currentState": "e217e14a-7d3a-41bc-ae31-7ab2dce26f02",
                           "action": "DECLINEVEHICLE",
                           "nextState": "15c550df-8369-47fd-816d-c24a07861c5a",
                           "roles": [
                               "FSM_EMP_FSTPO"
                           ],
                           "active": true
                       },
                       {
                           "auditDetails": {
                               "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                               "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "createdTime": 1613116718088,
                               "lastModifiedTime": 1654241412659
                           },
                           "uuid": "c83445e8-c658-4a29-b69d-29f30a8be7ff",
                           "tenantId": "pb.amritsar",
                           "currentState": "e217e14a-7d3a-41bc-ae31-7ab2dce26f02",
                           "action": "DISPOSE",
                           "nextState": "0fec53d3-6940-44c9-8582-2a09bd1f413a",
                           "roles": [
                               "FSM_EMP_FSTPO"
                           ],
                           "active": true
                       }
                   ]
               },
               {
                   "auditDetails": {
                       "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                       "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                       "createdTime": 1613116718088,
                       "lastModifiedTime": 1654241412659
                   },
                   "uuid": "0fec53d3-6940-44c9-8582-2a09bd1f413a",
                   "tenantId": "pb.amritsar",
                   "businessServiceId": "22c802e6-5354-43be-979a-8a653753459e",
                   "sla": null,
                   "state": "DISPOSED",
                   "applicationStatus": "DISPOSED",
                   "docUploadRequired": false,
                   "isStartState": false,
                   "isTerminateState": true,
                   "isStateUpdatable": true,
                   "actions": null
               },
               {
                   "auditDetails": {
                       "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
                       "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                       "createdTime": 1643360911202,
                       "lastModifiedTime": 1654241412659
                   },
                   "uuid": "15c550df-8369-47fd-816d-c24a07861c5a",
                   "tenantId": "pb.amritsar",
                   "businessServiceId": "22c802e6-5354-43be-979a-8a653753459e",
                   "sla": null,
                   "state": "VEHICLE_DECLINED",
                   "applicationStatus": "VEHICLE_DECLINED",
                   "docUploadRequired": false,
                   "isStartState": false,
                   "isTerminateState": true,
                   "isStateUpdatable": true,
                   "actions": null
               },
               {
                   "auditDetails": {
                       "createdBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                       "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                       "createdTime": 1654105652933,
                       "lastModifiedTime": 1654241412659
                   },
                   "uuid": "4c97dd1b-ebcf-424b-bc68-037c17e29194",
                   "tenantId": "pb.amritsar",
                   "businessServiceId": "22c802e6-5354-43be-979a-8a653753459e",
                   "sla": null,
                   "state": null,
                   "applicationStatus": null,
                   "docUploadRequired": false,
                   "isStartState": true,
                   "isTerminateState": false,
                   "isStateUpdatable": true,
                   "actions": [
                       {
                           "auditDetails": {
                               "createdBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
                               "createdTime": 1654105652933,
                               "lastModifiedTime": 1654241412659
                           },
                           "uuid": "01a3ec24-a89a-4169-98ba-13b483ff417e",
                           "tenantId": "pb.amritsar",
                           "currentState": "4c97dd1b-ebcf-424b-bc68-037c17e29194",
                           "action": "CREATE_FSTPO_LOG",
                           "nextState": "0fec53d3-6940-44c9-8582-2a09bd1f413a",
                           "roles": [
                               "FSM_EMP_FSTPO"
                           ],
                           "active": true
                       }
                   ]
               }
           ],
           "auditDetails": {
               "createdBy": "11b0e02b-0145-4de2-bc42-c97b96264807",
               "lastModifiedBy": "157fc9f6-836f-4780-ba89-9e511f65099e",
               "createdTime": 1613116718088,
               "lastModifiedTime": 1654241412659
           }
       }
   ]

Actions & Role Action Mapping

Actions

{
      "id": {{PLACEHOLDER1}},
      "name": "Create Vehicle Application",
      "url": "/vehicle/v1/_create",
      "displayName": "Create Vehicle",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "vehicle",
      "code": "null",
      "path": ""
    },
    {
      "id":  {{PLACEHOLDER2}},
      "name": "Search Vehicle Application",
      "url": "/vehicle/v1/_search",
      "displayName": "Search  Vehicle",
      "orderNumber": 1,
      "enabled": false,
      "serviceCode": "vehicle",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER3}},
      "name": "Vehicle Trip Search",
       "url": "/vehicle/trip/v1/_search",
      "displayName": "Vehicle Trip Search",
      "orderNumber": 1,
      "parentModule": "",
      "enabled": false,
      "serviceCode": "",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER4}},
      "name": "Vehicle Trip Update",
       "url": "/vehicle/trip/v1/_update",
      "displayName": "Vehicle Trip Update",
      "orderNumber": 1,
      "parentModule": "",
      "enabled": false,
      "serviceCode": "",
      "code": "null",
      "path": ""
    },
    {
      "id": {{PLACEHOLDER5}},
      "name": "Vehicle Trip Create",
      "url": "/vehicle/trip/v1/_create",
      "displayName": "Vehicle Trip Create",
      "orderNumber": 1,
      "parentModule": "",
      "enabled": false,
      "serviceCode": "vehicle",
      "code": "null",
      "path": ""
    },

{
  "id": {{PLACEHOLDER6}},
  "name": "Update Vehicle Application",
  "url": "/vehicle/v1/_update",
  "displayName": "Update Vehicle",
  "orderNumber": 0,
  "enabled": false,
  "serviceCode": "vehicle",
  "code": "null",
  "path": ""
}

Role Action Mapping

[
  {
    "rolecode": "FSM_ADMIN",
    "actionid": {{PLACEHOLDER1}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": {{PLACEHOLDER2}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid":  {{PLACEHOLDER2}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid":  {{PLACEHOLDER2}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_VIEW_EMP",
    "actionid":  {{PLACEHOLDER2}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EMP_FSTPO",
    "actionid":  {{PLACEHOLDER2}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EMP_FSTPO",
    "actionid": {{PLACEHOLDER3}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EMP_FSTPO",
    "actionid":{{PLACEHOLDER4}},
    "actioncode": "",
    "tenantId": "pb"
  },
  {
      "rolecode": "FSM_EMP_FSTPO",
      "actionid": {{PLACEHOLDER5}},
      "actioncode": "",
      "tenantId": "pb"
    },
]
{
  "rolecode": "FSM_ADMIN",
  "actionid": {{PLACEHOLDER6}},
  "actioncode": "",
  "tenantId": "pb"
},

Infra Ops Configuration

Configurations that we can manage through values.yml vehicle in infraops repo are listed below. values.yml for the vehicle can be found.

Description

name in values.yml

Current Value

id-gen host, to generate the application number

EGOV_IDGEN_HOST

egov-idgen from egov-service-host

mdms service host

EGOV_MDMS_HOST

egov-mdms-service from egov-service-host

workflow v2 service host

WORKFLOW_CONTEXT_PATH

egov-workflow-v2 from egov-service-host

user service host, to get the locale data

EGOV_USER_HOST

egov-user from egov-service-host

Kafka Consumer Group

SPRING_KAFKA_CONSUMER_GROUP_ID

egov-vehicle-services

kafka topic to which service push data to save new vehicle application

PERSISTER_SAVE_VEHICLE_TOPIC

save-vehicle-application

kafka topic to which service push data of the vehicleTrip to save

PERSISTER_SAVE_VEHICLE_TRIP_TOPIC

save-vehicle-trip

kafka topic to which service push data of the vehicleTrip to update

PERSISTER_UPDATE_VEHICLE_TRIP_TOPIC

update-vehicle-trip

kafka topic to which service push data of the vehicleTrip to update the status

PERSISTER_UPDATE_VEHICLE_TRIP_WORKFLOW_TOPIC

update-workflow-vehicle-trip

VehicleTrip Appilcatiion Number format`

egov.idgen.vehicle.trip.applicationNum.format

"[CITY.CODE]-VT-[cy:yyyy-MM-dd]-[SEQ_EGOV_VEHICLETRIP]"

Configurations sample in Values.yml

egov.idgen.vehicle.trip.applicationNum.format: "[CITY.CODE]-VT-[cy:yyyy-MM-dd]-[SEQ_EGOV_VEHICLETRIP]"

# Additional Container Envs
env: |
  - name: EGOV_IDGEN_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-idgen
  - name: EGOV_HRMS_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-hrms
  - name: EGOV_MDMS_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-mdms-service
  - name: EGOV_USER_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-user
  - name: WORKFLOW_CONTEXT_PATH
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-workflow-v2
  - name: WORKFLOW_TRANSITION_PATH
    value: "egov-workflow-v2/egov-wf/process/_transition"
  - name: EGOV_IDEN_VEHICLE_TRIP_APPLICATIONNUM_FORMAT
    value: "[CITY.CODE]-VT-[cy:yyyy-MM-dd]-[SEQ_EGOV_VEHICLETRIP]"
  - name: SPRING_KAFKA_CONSUMER_GROUP_ID
    value: egov-vehicle-services
  - name: PERSISTER_SAVE_VEHICLE_TOPIC
    value: save-vehicle-application
  - name: PERSISTER_UPDATE_VEHICLE_TOPIC
    value: update-vehicle-application
  - name: PERSISTER_SAVE_VEHICLE_TRIP_TOPIC
    value: save-vehicle-trip
  - name: PERSISTER_UPDATE_VEHICLE_TRIP_TOPIC
    value: update-vehicle-trip
  - name: PERSISTER_UPDATE_VEHICLE_TRIP_WORKFLOW_TOPIC
    value: update-workflow-vehicle-trip 
  - name: SPRING_KAFKA_PRODUCER_KEY_SERIALIZER
    value: org.apache.kafka.common.serialization.StringSerializer
  - name: SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER
    value: org.springframework.kafka.support.serializer.JsonSerializer
  - name: JAVA_OPTS
    value: {{ index .Values "heap" | quote }}
  - name: JAVA_ARGS
    value: {{ index .Values "java-args" | quote }}
  - name: SERVER_PORT
    value: "8080"
  - name: SECURITY_BASIC_ENABLED
    value: "false"  
  - name: MANAGEMENT_SECURITY_ENABLED
    value: "false"
  {{- if index .Values "tracing-enabled" }}
  - name: TRACER_OPENTRACING_ENABLED
    value: "true" 
  {{- end }}

DIGIT-DevOps/values.yaml at master · egovernments/DIGIT-DevOps

Data Setup

Create Vehicle

Create a vehicle with one of the vehicle types available in the VehicleMakeModel MDMS.

Sample Curl

curl 'https://dev.digit.org/vehicle/v1/_create?tenantId=pb.amritsar' \
  -H 'authority: dev.digit.org' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
  -H 'content-type: application/json;charset=UTF-8' \
  -H 'cookie: _ga=GA1.2.1852108775.1653914860; intercom-id-xp1951jv=17aa7431-3dc0-4524-9956-a22bb67a637f; __cuid=858e6f9f233c4b2c804d3f81109b48ac; amp_fef1e8=7faa94f4-6926-4f98-ac07-be2414f977c6R...1gkkb64lb.1gkkb6kvh.7p.a.83' \
  -H 'origin: https://dev.digit.org' \
  -H 'referer: https://dev.digit.org/digit-ui/employee/fsm/registry/new-vehicle' \
  -H 'sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' \
  --data-raw '{"vehicle":{"tenantId":"pb.amritsar","registrationNumber":"AS 12 AS 1234","model":"MAHINDRA","type":"MAHINDRA.BOLERO_PICKUP","tankCapacity":"5000","suctionType":"SEWER_SUCTION_MACHINE","pollutionCertiValidTill":null,"InsuranceCertValidTill":null,"fitnessValidTill":null,"roadTaxPaidTill":null,"gpsEnabled":true,"source":"Municipal records","owner":{"tenantId":"pb","name":"raj","fatherOrHusbandName":"raj","relationship":"OTHER","gender":"OTHERS","dob":-19800000,"emailId":"abc@egov.com","correspondenceAddress":"","mobileNumber":"9876543210"},"additionalDetails":{"description":""}},"RequestInfo":{"apiId":"Rainmaker","authToken":"df28f073-4caf-456e-bd43-1943ce76548c","userInfo":{"id":28452,"uuid":"5674253d-9c2a-4d47-88ae-450f3fbbcad2","userName":"BPAFieldInspector","name":"lakshmi","mobileNumber":"8656565343","emailId":null,"locale":null,"type":"EMPLOYEE","roles":[{"name":"FSM Administrator","code":"FSM_ADMIN","tenantId":"pb.amritsar"},{"name":"BPA Services Approver","code":"BPA_APPROVER","tenantId":"pb.amritsar"},{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"},{"name":"FSM Employee Report Viewer","code":"FSM_REPORT_VIEWER","tenantId":"pb.amritsar"},{"name":"BPA Services verifier","code":"BPA_VERIFIER","tenantId":"pb.amritsar"},{"name":"BPA Field Inspector","code":"BPA_FIELD_INSPECTOR","tenantId":"pb.amritsar"},{"name":"BPAREG doc verifier","code":"BPAREG_DOC_VERIFIER","tenantId":"pb.amritsar"}],"active":true,"tenantId":"pb.amritsar","permanentCity":null},"msgId":"1671428547643|en_IN","plainAccessRequest":{}}}' \
  --compressed

Integration

Integration Scope

Integrated with the application through REST API to create, and search vehicles. For any module where the vehicle trip is required, one can integrate REST API trip/v1/create, update, and search.

Integration Benefits

  • Vehicle management would become easy.

  • Trip management would become easy.

Steps to Integration

  • FSM application can vehicle/v1/_search to validate the FSM vehicle assignment.

  • FSM application call vehicle/trip/v1/_create on assigning vehicle to the spplication.

  • FSTP operators can mark the vehicleTrip as DISPOSED.

Interaction Diagrams

Reference Docs

Doc Links

Workflow Technical Document

Workflow Service

User technical document

User Service

MDMS technical document

NEEDS TO BE UPDATED

IDGen technical document

NEEDS TO BE UPDATED

Localisation technical document

NEEDS TO BE UPDATED

Persister technical document

NEEDS TO BE UPDATED

SMS notification technical document

NEEDS TO BE UPDATED

API contract

API Contract

Postman scripts

Postman Collection

API List

Title

Link

vehicle/v1/_create

https://www.getpostman.com/collections/6d99bb40022396f848b2

vehicle/v1/_search

https://www.getpostman.com/collections/6d99bb40022396f848b2

/vehicle/v1/_plainsearch

https://www.getpostman.com/collections/6d99bb40022396f848b2

/vehicle/trip/v1/_create

https://www.getpostman.com/collections/4d425d97a5db5ced11b6

vehicle/trip/v1/_update

https://www.getpostman.com/collections/6d99bb40022396f848b2

vehicle/trip/v1/_search

https://www.getpostman.com/collections/6d99bb40022396f848b2

/vehicle/trip/v1/_plainsearch

https://www.getpostman.com/collections/6d99bb40022396f848b2

vehicle/v1/_update

https://api.postman.com/collections/23418568-a15793e6-edeb-4393-a6b8-38fd90deca6f?access_key=PMAT-01GMQPGY7NKF54DP47PEJH6NZG

Legacy/Re-Indexing the FSM Data

Overview

In this document, we will learn how to legacy index/re-index the fsm index.

Pre-Requisites

  • Kubectl access to the required environment in which you want to run the re-indexing

  • playground pod access

  • Legacy index mapping/configuration done in the respective indexer-config ( in this case for FSM, legacy index configuration for fsm is done here, Similarly for VehicleTrip also exists )

Postman Collection

Postman collection to re-index the data for FSM, VehicleTrip, Vehicle, Vendor Services can be downloaded here

Steps to legacy-index FSM

  1. After importing the postman collection downloaded from above section, you can find two request

    1. fsm-legacy : This request helps to get the data from fsm/plainsearch api and push data to fsm-enriched topic by indexer service

    2. fsm-legacy-kafkaconnector : This is the request to create a connector which can listen to the fsm-enriched topic and push data to the elastic search with the new index fsm-enriched

  2. Run the fsm-legacy-kafkaconnector request in the playground pod, which would create a connector which would intern start listening to the topic fsm-enriched-sink

  3. Run the fsm-legacy request in the playground pod, which would call indexer service to intiate the process of fetching the data from plainsearch and push the data prepared according to the legacy-index mapping and push the data to the fsm-enriched-sink topic

  4. Whole process would take some time, mean while you can searc for the data in fsm-enriched index in the elastic search

  5. we can go through the logs of the indexer pod, which would help to understand the job is done

  6. Once the job is done, delete the kafka connector running the below curl in the playground curl --location --request DELETE 'http://kafka-connect.kafka-cluster:8083/connectors/fsm-enriched-es-sink'

  7. Once reindexing is completed, please verfiy the count in fsm index and fsm-enriched index, then delete the fsm index and create alias for fsm-enriched index as fsm.Please use below command for alias creating.

POST /_aliases
{  "actions":
[  
  {      "add":
 {        "index": "fsm-enriched",    
   "alias": "fsm"    
  }    
}
 ]
}

Steps to legacy index VehicleTrip

  1. After importing the postman collection downloaded from above section, you can find two request

    1. vehicleTrip-legacy : This request helps to get the data from vehicletrip/plainsearch api and push data to vehicletrip-enriched topic by indexer service

    2. vehicle-trip-legacy-kafkaconnector : This is the request to create a connector which can listen to the vehicletrip-enriched topic and push data to the elastic search with the new index vehicletrip-enriched

  2. Run the vehicletrip-legacy-kafkaconnector request in the playground pod, which would create a connector which would intern start listening to the topic vehicletrip-enriched-sink

  3. Run the vehicletrip-legacy request in the playground pod, which would call indexer service to intiate the process of fetching the data from plainsearch and push the data prepared according to the legacy-index mapping and push the data to the vehicletrip-enriched-sink topic

  4. Whole process would take some time, mean while you can searc for the data in vehicletrip-enriched index in the elastic search

  5. we can go through the logs of the indexer pod, which would help to understand the job is done

  6. Once the job is done, delete the kafka connector running the below curl in the playground curl --location --request DELETE 'http://kafka-connect.kafka-cluster:8083/connectors/vehicletrip-enriched-es-sink'

  7. Once reindexing is completed, please verfiy the count in vehicletrip index and vehicletrip-enriched index, then delete the vehicletrip index and create alias for vehicletrip-enriched index as vehicletrip.Please use below command for alias creating.

POST /_aliases
{  "actions":
[  
  {      "add":
 {        "index": "vehicletrip-enriched",    
   "alias": "vehicletrip"    
  }    
}
 ]
}

FSM UI Docs

This section includes the following:

  • FM Citizen UI

  • FSM Employee UI

  • FSM DSO UI

  • FSM FSTPO UI

FSM Citizen UI

There are two new updates introduced in FSM v1.2.1 while creating a new application - Stepper Information and Vehicle Capacity Selection in the Service Request Screen.

Stepper Information

We are introducing stepper information in FSM while creating an application from the citizen side so that they have visibility on how many steps they need to go over to submit details regarding their tank.

Technical Implementations Details:

TLTimelineInFSM.js file is the common component and used for rendering the stepper information. The path of the file is:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/TLTimelineInFSM.js

The code snippets for defining the steps present in FSM application under case “APPLY”:

The code snippets to render the stepper information in each screen using the timeline component:

using Timeline component to render the stepper Information in each screen provided with step number in currentStep.

Service Request Screen

Citizens can now select vehicle capacity along with the number of trips required while creating an application. If nothing is selected, we will proceed by taking the minimum vehicle capacity available with the number of trips.

Technical Implementation Details:

Code path: frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectTripNo.js

The code snippet for rendering the Vehicle Capacity field in Service Request screen:

<CardText> {t("ES_VEHICLE CAPACITY")} </CardText>
 <RadioOrSelect
    options={vehicleMenu?.map((vehicle) => ({ ...vehicle, label: vehicle.capacity }))}
    selectedOption={vehicleCapacity}
    optionKey="capacity"
    onSelect={selectVehicle}
    optionCardStyles={{ zIndex: "60" }}
    t={t}
    isMandatory={config.isMandatory}isDropDown={true}
/>

The code snippet for fetching the vehicles available under all DSO:

const allVehicles = dsoData.reduce((acc, curr) => {
  return curr.vehicles && curr.vehicles.length ? acc.concat(curr.vehicles) : acc;
}, []);
const cpacityMenu = Array.from(new Set(allVehicles.map((a) => a.capacity)))
    .map((capacity) => allVehicles.find((a) => a.capacity === capacity));

The code snippet for setting the default vehicle capacity to minimum:

FSM Employee UI

There are three main updates in FSM v1.2.1 for employee UI:

  1. Application timeline

  2. Photo viewed by employee/DSO

  3. Payment mode while completing request

1. Application Timeline:

An employee can see the application status in application timeline with provider details.

Technical Implementation Details:

The path for the code:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/index.js

The code snippet to render application timeline:

The code snippet for extracting the provider info for each status:

2. Photo viewed by employee/DSO

An employee/DSO can view the photo uploaded by the employee/DSO in complete request action.

Technical Implementation Details:

The path for the code:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/index.js

The code snippets to render the field:

ViewImages.js are the common component used to fetch and render the Image file id. The path is shown below:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/ViewImages.js

3. Payment mode while completing request

An employee has to select the payment mode while completing the request.

Technical Implementation Details:

File path:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/CompleteApplication.js

The code snippet to render the field.

MDMS file fetch for payment mode:

egov-mdms-data/ReceivedPaymentType.json at UAT · egovernments/egov-mdms-data

{
    "tenantId": "pg",
    "moduleName": "FSM",
    "ReceivedPaymentType": [
        {
            "name": "Payed in Cash",
            "code": "PAYED_IN_CASH",
            "active": true
        },
        {
            "name": "Payed in Counter",
            "code": "PAYED_IN_COUNTER",
            "active": true
        },
        {
            "name": "Netbanking",
            "code": "NETBANKING",
            "active": true
        }
    ]
}

FSM DSO UI

Complete Request

Fetching data from the MDMS

Customising Fields In A Form

The config can be found at CompleteApplication.js

File Path: frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/CompleteApplication.js

{
          label: "ES_NEW_APPLICATION_PROPERTY_TYPE",
          isMandatory: true,
          type: "component",
          route: "property-type",
          key: "propertyType",
          component: "SelectPropertyType",
          texts: {
            headerCaption: "",
            header: "CS_FILE_APPLICATION_PROPERTY_LABEL",
            cardText: "CS_FILE_APPLICATION_PROPERTY_TEXT",
            submitBarLabel: "CS_COMMON_NEXT",
          },
          nextStep: "property-subtype",
        },
        {
          label: "ES_NEW_APPLICATION_PROPERTY_SUB-TYPE",
          isMandatory: true,
          type: "component",
          route: "property-subtype",
          key: "subtype",
          component: "SelectPropertySubtype",
          texts: {
            headerCaption: "",
            header: "CS_FILE_APPLICATION_PROPERTY_SUBTYPE_LABEL",
            cardText: "CS_FILE_APPLICATION_PROPERTY_SUBTYPE_TEXT",
            submitBarLabel: "CS_COMMON_NEXT",
          },
          nextStep: "map",
        },
        {
          label: "ES_NEW_APPLICATION_PIT_TYPE",
          isMandatory: false,
          type: "component",
          route: "pit-type",
          key: "pitType",
          component: "SelectPitType",
          texts: {
            header: "CS_FILE_PROPERTY_PIT_TYPE",
            cardText: "CS_FILE_PROPERTY_PIT_TYPE_TEXT",
            submitBarLabel: "CS_COMMON_NEXT",
            skipText: "CORE_COMMON_SKIP_CONTINUE",
          },
          nextStep: "tank-size",
        },
        {
          route: "tank-size",
          component: "SelectTankSize",
          isMandatory: false,
          texts: {
            headerCaption: "",
            header: "CS_FILE_APPLICATION_PIT_SEPTIC_TANK_SIZE_TITLE",
            cardText: "CS_FILE_APPLICATION_PIT_SEPTIC_TANK_SIZE_TEXT",
            submitBarLabel: "CS_COMMON_NEXT",
          },
          type: "component",
          key: "pitDetail",
          nextStep: null,
          label: "ES_NEW_APPLICATION_PIT_DIMENSION",
        },

Upload Pit Photo Button

UploadPitPhoto.js molecule is available within the molecules folder in react-components.

File Path: frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/molecules/UploadPitPhoto.js

Saving Image fileId in FSM service

const uploadImage = useCallback(async () => {
        if (uploadedImagesIds === null || uploadedImagesIds.length < 3) {
            const response = await Digit.UploadServices.Filestorage("FSM", image, props.tenantId);
            setUploadedImagesIds(addUploadedImageIds(response));
        } else {
            console.log("disabled")
        }
    }, [addUploadedImageIds, image]);

Filter Component On DSO Inbox Screen

The link for the MDMS changes made is given below.

egov-mdms-data/RoleStatusMapping.json at DEV · egovernments/egov-mdms-data

RoleStatusMappping.json

  {
            "userRole": "FSM_DSO",
            "statuses": [
                "DSO_INPROGRESS",
                "PENDING_DSO_APPROVAL",
                "COMPLETED",
            ],
            "zeroCheck": true,
            "fixed": false
        },

Schedule Action For Post Pay In DSO

Schedule Action is added for post-pay applications where DSOs can schedule the trip by entering the number of trips.

Code snippet for schedule window:

 case "SCHEDULE":
      case "ES_FSM_SCHEDULE":
        setFormValve(true);
        return setConfig(
          configScheduleDso({
            t,
            rejectMenu: Reason?.DeclineReason,
            setReason: setDeclineReason,
            reason: declineReason,
            applicationCreatedTime: applicationData?.auditDetails?.createdTime,
            vehicle,
            vehicleCapacity: applicationData?.vehicleCapacity,
            action,
            noOfTrips: applicationData?.noOfTrips
          })
        );

ScheduleDso.js is the file responsible for the schedule window pop up.

File path: frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/ApplicationDetails/config/ScheduleDso.js

FSM FSTPO UI

In FSTP, we are trying to decouple the vehicle dispose from the FSM application. Whether vehicle is attached to any FSM application or not, we allow the vehicle to dispose in the FSTP plant.

FSTP Home UI:

After logging as a FSTP user, we have now the home button option:

Technical Implementation Details:

Code changes path are:

DIGIT-Dev/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/components/FsmCard.js

FSTP Operations UI:

After moving into “home” option, an FSTP user can choose from the following options:

  • FSTP can choose Add Vehicle Log option if he/she wants to check whether a vehicle is linked to any application and dispose.

  • FSTP can choose Inbox if he/she wants to check all the applications that are is ready to dispose.

Technical Implementation Details:

The path for code:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpOperations.js

The code snippet for populating the options:

The code snippet for rendering the icon:

ULBHomeCard.js is the common component used to populate options in the screen.

The paths:

frontend/micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/ULBHomeCard.js

FSTP Add Vehicle Log UI:

FSTP can add vehicle log using vehicle number (in proper format with spaces, e.g. AB 00 CD 1234). An improper format will throw an error.

Techincal Implementation Details:

The path for the code:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpAddVehicle.js

The code snippet for populating the add vehicle log field and its validation:

The code snippet for rendering the screen:

FSTP Service Request Screen:

After entering the vehicle number in the add vehicle log screen, we are fetching the FSM application, which is linked to that specific vehicle number. The data is rendered as shown below:

Technical Implementation Details:

The path for the code:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpServiceRequest.js

The code snippets for fetching the FSM application linked to vehicle number:

Fetching the vehicle Id using vehicle number

Fetching the vehicle log using vehicle Id

Extracting out the FSM application number from vehicle log:

Fetching the FSM application details using FSM application number

The code snippets to render the data:

Mobile view

Desktop view

Vehicle Log screen:

After selecting the application, FSTPO can dispose the vehicle log in the vehicle log screen.

Additional details and attachment fields are introduced in new updates in FSM v1.2.1 .

The screen for the existing vehicle log:

The screen for new vehicle log if no application is found for vehicle is shown below. FSTPO can dispose the new vehicle log by providing all the details below.

Technical Implementation Details:

The path for the code:

frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pages/employee/FstpOperatorDetails.js

The code snippet for additional details and attachments field:

For new vehicle log:

The code snippets to render input field for new vehicle log:

FSM-DSS Technical Documentation

Overview

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 sets, there is a need for making this configurable so that, if a new scenario is introduced, then it is 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 the analytics side of DSS for FSM.

What is analytics?

Analytics: Micro-service that is responsible for building, fetching, aggregating, and computing the data on ElasticSearch to a consumable data response, which will be later used for visualisations and graphical representations.

Analytics Configurations

Analytics contains multiple configurations. We need to add the changes related to FSM in this dashboard-analytics. Here is the location: configs/egov-dss-dashboards/dashboard-analytics at qa · egovernments/configs Below is a list of configurations that need to be changed to run FSM successfully.

  1. Chart API Configuration

  2. Master Dashboard Configuration

  3. Role Dashboard Mappings Configuration

Description

Chart API Configuration

Each visualisation has its own properties, and comes from different data sources (sometimes it is a combination of different data sources).

In order to configure each visualisation and their properties, we have a chart API configuration document. In this, the visualisation code, which happens to be the key, will have its properties configured as a part of configuration, and are easily changeable.

Here is the sample ChartApiConfiguration.json data for FSM.

  "fsmTotalrequest": {
    "chartName": "DSS_FSM_TOTAL_REQUESTS",
    "queries": [
      {
        "module": "FSM",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Application\":{\"value_count\":{\"field\":\"Data.fsm.@timestamp\"}}}}}}",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "dateRefField": "Data.fsm.@timestamp"
      }
    ],
    "chartType": "metric",
    "valueType": "number",
    "action": "",
    "drillChart": "none",
    "aggregationPaths": [
      "Total Application"
    ],
    "insight": {
      "chartResponseMap" : "totalApplication",
      "action" : "differenceOfNumbers",
      "upwardIndicator" : "positive",
      "downwardIndicator" : "negative",
      "textMessage" : "$indicator$value% than last $insightInterval",
      "colorCode" : "#228B22",
      "insightInterval" : "year",
      "isRoundOff": true
    },
    "_comment": " FSM Total Applications"
  },
  "totalSludgeTreated": {
    "chartName": "DSS_FSM_TOTAL_SLUDGE_TREATED",
    "queries": [
      {
        "module": "FSM",
        "indexName": "vehicletrip",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.vehicleTrip.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Sludge Collection\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}}}}}}",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "dateRefField": "Data.vehicleTrip.@timestamp"
      }
    ],
    "chartType": "metric",
    "valueType": "number",
    "action": "",
    "drillChart": "none",
    "aggregationPaths": [
      "Total Sludge Collection"
    ],
    "insight": {
      "chartResponseMap" : "totalSludgeTreated",
      "action" : "differenceOfNumbers",
      "upwardIndicator" : "positive",
      "downwardIndicator" : "negative",
      "textMessage" : "$indicator$value% than last $insightInterval",
      "colorCode" : "#228B22",
      "insightInterval" : "year",
      "isRoundOff": true
    },
    "_comment": " FSM Total Sludge Treated"
  },
  "avgFSMCostRequest": {
    "chartName": "DSS_FSM_AVG_FSM_COST_OR_REQ",
    "queries": [
      {
        "module": "FSM",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}],\"must\":[{\"term\":{\"Data.payments.paymentDetails.businessService.keyword\":\"FSM.TRIP_CHARGES\"}}]}},\"aggs\":{\"Average Collection\":{\"avg\":{\"field\":\"Data.payments.paymentDetails.bill.billDetails.amountPaid\"}}}}}}",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "dateRefField": "Data.fsm.@timestamp"
      }
    ],
    "chartType": "metric",
    "valueType": "amount",
    "action": "",
    "drillChart": "none",
    "isRoundOff": true,
    "aggregationPaths": [
      "Average Collection"
    ],
    "insight": {
      "chartResponseMap" : "averageCollection",
      "action" : "differenceOfNumbers",
      "upwardIndicator" : "positive",
      "downwardIndicator" : "negative",
      "textMessage" : "$indicator$value% than last $insightInterval",
      "colorCode" : "#228B22",
      "insightInterval" : "year",
      "isRoundOff": true
    },
    "_comment": " FSM Average Collection"
  },
  "totalCollectioninLacs": {
    "chartName": "DSS_FSM_TOTAL_COLLECTION",
    "queries": [
      {
        "module": "FSM",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.tenantId.keyword\":\"pb.testing\"}}],\"must\":[{\"term\":{\"Data.payments.paymentDetails.businessService.keyword\":\"FSM.TRIP_CHARGES\"}}]}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"Data.payments.paymentDetails.bill.billDetails.amountPaid\"}}}}}}",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "dateRefField": "Data.fsm.@timestamp"
      }
    ],
    "chartType": "metric",
    "valueType": "amount",
    "action": "",
    "drillChart": "none",
    "documentType": "_doc",
    "aggregationPaths": [
      "Total Collection"
    ],
    "insight": {
      "chartResponseMap" : "totalCollection",
      "action" : "differenceOfNumbers",
      "upwardIndicator" : "positive",
      "downwardIndicator" : "negative",
      "textMessage" : "$indicator$value% than last $insightInterval",
      "colorCode" : "#228B22",
      "insightInterval" : "year",
      "isRoundOff": true
    },
    "_comment": " FSM Total Collection"
  },
  "slaCompliance": {
    "chartName": "DSS_FSM_SLA_COMPLIANCE",
    "queries": [
      {
        "module": "FSM",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.service.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed With In Sla\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}}}},\"Total Applications\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}}}}}}",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "dateRefField": "Data.fsm.@timestamp"
      }
    ],
    "chartType": "metric",
    "valueType": "percentage",
    "drillChart": "none",
    "documentType": "_doc",
    "action": "percentage",
    "isRoundOff": true,
    "aggregationPaths": [
      "Closed With In Sla",
      "Total Applications"
    ],
    "insight": {
      "chartResponseMap" : "slaCompliance",
      "action" : "differenceOfNumbers",
      "upwardIndicator" : "positive",
      "downwardIndicator" : "negative",
      "textMessage" : "$indicator$value% than last $insightInterval",
      "colorCode" : "#228B22",
      "insightInterval" : "year",
      "isRoundOff": true
    },
    "_comment": " SLA Compliance"
  },
  "citizenAvgRating": {
    "chartName": "DSS_FSM_CITIZEN_AVG_RATING",
    "queries": [
      {
        "module": "FSM",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}],\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\"]}},{\"term\":{\"Data.history.action.keyword\":\"RATE\"}},{\"exists\":{\"field\":\"Data.history\"}},{\"range\":{\"Data.history.rating\":{\"gte\":1}}}]}},\"aggs\":{\"Citizen Average Rating\":{\"avg\":{\"script\":\"int sum = 0;int count =0;if(params['_source']['Data']['history']!=null){ for (item in params['_source']['Data']['history']) {if(item.rating!=null){ sum += item.rating;} }} return sum;\"}}}}}}",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "dateRefField": "Data.fsm.@timestamp"
      }
    ],
    "chartType": "metric",
    "valueType": "number",
    "action": "",
    "drillChart": "none",
    "documentType": "_doc",
    "aggregationPaths": [
      "Citizen Average Rating"
    ],
    "postAggregationTheory": "",
    "insight": {},
    "_comment": " Citizen Average rating"
  },
  "fsmCollectionByUsageType": {
    "chartName": "DSS_FSM_COLLECTION_BY_USAGE_TYPE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Usage Type\":{\"terms\":{\"field\":\"Data.fsm.propertyUsage.keyword\"},\"aggs\":{\"Assessed Properties\":{\"sum\":{\"field\":\"Data.payments.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}"
      }
    ],
    "chartType": "pie",
    "valueType": "amount",
    "action": "",
    "documentType": "_doc",
    "drillChart": "none",
    "aggregationPaths": [
      "Usage Type"
    ],
    "insight": {
    },
    "_comment": " "
  },
  "fsmTotalCumulativeCollection": {
    "chartName": "DSS_FSM_TOTAL_CUMULATIVE_COLLECTION",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Total Collection\":{\"date_histogram\":{\"field\":\"Data.fsm.@timestamp\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Count\":{\"sum\":{\"field\":\"Data.payments.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}"
      }
    ],
    "chartType": "line",
    "valueType": "amount",
    "action": "",
    "drillChart": "none",
    "documentType": "_doc",
    "aggregationPaths": [
      "Total Collection"
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmTopUlbByPerformance": {
    "chartName": "DSS_FSM_TOP_ULB_BY_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed With In Sla\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}}}},\"Total Applications\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}}}}}}"
      }
    ],
    "chartType": "perform",
    "valueType": "percentage",
    "drillChart": "none",
    "documentType": "_doc",
    "drillChart": "ulbTopDrillChart",
    "action": "percentage",
    "plotLabel": "DSS_COMPLETION_RATE",
    "isRoundOff": true,
    "order": "desc",
    "limit": 3,
    "aggregationPaths": [
      "Closed With In Sla",
      "Total Applications"
    ],
    "isCumulative": false,
    "interval": "month",
    "insight": {
    },
    "_comment": ""
  },
  "ulbTopDrillChart": {
    "chartName": "DSS_FSM_ULB_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULB\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\",\"size\":1000,\"order\":{\"_count\":\"desc\"}},\"aggs\":{\"TotalRequests\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}},\"ClosedWithInSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"ClosedOutsideSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value > params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"CitizenAverageRating\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\"]}},{\"term\":{\"Data.history.action.keyword\":\"RATE\"}},{\"exists\":{\"field\":\"Data.history\"}},{\"range\":{\"Data.history.rating\":{\"gte\":1}}}]}},\"aggs\":{\"CitizenAvgRating\":{\"avg\":{\"script\":\"int sum = 0;int count =0;if(params['_source']['Data']['history']!=null){ for (item in params['_source']['Data']['history']) {if(item.rating!=null){ sum += item.rating;} }} return sum;\"}}}}}}}}}}"
      }
    ],
   "filterKeys": [
      {"key": "tenantId", "column": "ULB"}
    ],
    "isPostResponseHandler": true,
    "chartType": "table",
    "valueType": "number",
    "action": "",
    "documentType": "_doc",
    "drillChart": "none",
    "plotLabel":"ULB",
    "aggregationPaths": [
      "TotalRequests",
      "ClosedWithInSLA",
      "ClosedOutsideSLA",
      "CitizenAverageRating"
    ],
    "pathDataTypeMapping": [
      {
        "TotalRequests" : "number"
      },
      {
        "ClosedWithInSLA" : "number"
      },
      {
        "ClosedOutsideSLA" : "number"
      },
      {
        "CitizenAverageRating" : "number"
      }
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmBottomUlbByPerformance": {
    "chartName": "DSS_FSM_BOTTOM_ULB_BY_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Closed With In Sla\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"count\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}}}},\"Total Applications\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\"},\"aggs\":{\"tenant_count\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}}}}}}"
      }
    ],
    "chartType": "perform",
    "valueType": "percentage",
    "drillChart": "none",
    "documentType": "_doc",
    "drillChart": "ulbBottomDrillChart",
    "action": "percentage",
    "isRoundOff": true,
    "plotLabel": "DSS_COMPLETION_RATE",
    "order": "asc",
    "limit": 3,
    "aggregationPaths": [
      "Closed With In Sla",
      "Total Applications"
    ],
    "isCumulative": false,
    "interval": "month",
    "insight": {
    },
    "_comment": ""
  },
  "ulbBottomDrillChart": {
    "chartName": "DSS_FSM_ULB_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULB\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\",\"size\":1000,\"order\":{\"_count\":\"asc\"}},\"aggs\":{\"TotalRequests\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}},\"ClosedWithInSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"ClosedOutsideSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value > params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"CitizenAverageRating\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\"]}},{\"term\":{\"Data.history.action.keyword\":\"RATE\"}},{\"exists\":{\"field\":\"Data.history\"}},{\"range\":{\"Data.history.rating\":{\"gte\":1}}}]}},\"aggs\":{\"CitizenAvgRating\":{\"avg\":{\"script\":\"int sum = 0;int count =0;if(params['_source']['Data']['history']!=null){ for (item in params['_source']['Data']['history']) {if(item.rating!=null){ sum += item.rating;} }} return sum;\"}}}}}}}}}}"
      }
    ],
   "filterKeys": [
      {"key": "tenantId", "column": "ULB"}
    ],
    "isPostResponseHandler": true,
    "chartType": "table",
    "valueType": "number",
    "action": "",
    "documentType": "_doc",
    "drillChart": "none",
    "plotLabel":"ULB",
    "aggregationPaths": [
      "TotalRequests",
      "ClosedWithInSLA",
      "ClosedOutsideSLA",
      "CitizenAverageRating"
    ],
    "pathDataTypeMapping": [
      {
        "TotalRequests" : "number"
      },
      {
        "ClosedWithInSLA" : "number"
      },
      {
        "ClosedOutsideSLA" : "number"
      },
      {
        "CitizenAverageRating" : "number"
      }
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmCapacityUtilization": {
    "chartName": "DSS_FSTP_CAPACITY_UTILIZATION",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.vehicleTrip.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "vehicletrip",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.vehicleTrip.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Capacity Utilization\":{\"date_histogram\":{\"field\":\"Data.vehicleTrip.@timestamp\",\"interval\":\"month\"},\"aggs\":{\"Count\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}}}}}}}}"
      }
    ],
    "chartType": "line",
    "valueType": "amount",
    "action": "",
    "isRoundOff": true,
    "documentType": "_doc",
    "drillChart": "none",
    "aggregationPaths": [
      "Capacity Utilization"
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmMonthlyWasteCal": {
    "chartName": "DSS_FSM_MONTHLY_WASTE_CAL",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.vehicleTrip.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "vehicletrip",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.vehicleTrip.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Septage Dumped At Plant\":{\"date_histogram\":{\"field\":\"Data.vehicleTrip.@timestamp\",\"interval\":\"month\"},\"aggs\":{\"Count\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}}}},\"Septage Collected\":{\"date_histogram\":{\"field\":\"Data.vehicleTrip.@timestamp\",\"interval\":\"month\"},\"aggs\":{\"Count\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.tripDetails.volume'].value)/1000.0\"}}}}}}}}}"
      }
    ],
    "chartType": "line",
    "valueType": "number",
    "action": "",
    "isRoundOff": true,
    "documentType": "_doc",
    "drillChart": "none",
    "aggregationPaths": [
      "Septage Collected",
      "Septage Dumped At Plant"
    ],
    "isCumulative": false,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmTopDsoByPerformance": {
    "chartName": "DSS_FSM_TOP_DSO_BY_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Raised\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":3,\"order\":{\"_count\":\"desc\"}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}},\"Closed Within SLA\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":3,\"order\":{\"_count\":\"desc\"}},\"aggs\":{\"Count\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}}}},\"Closed Outside SLA\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":3,\"order\":{\"_count\":\"desc\"}},\"aggs\":{\"Count\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value > params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}}}}}}}}"
      }
    ],
    "chartType": "line",
    "valueType": "number",
    "action": "",
    "drillChart": "dsoTopDrillChart",
    "documentType": "_doc",
    "aggregationPaths": [
      "Raised",
      "Closed Within SLA",
      "Closed Outside SLA"
    ],
    "isCumulative": false,
    "interval": "month",
    "insight": {
    },
    "_comment": ""
  },
  "dsoTopDrillChart": {
    "chartName": "DSS_FSM_DSO_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"DSOName\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":1000,\"order\":{\"_count\":\"desc\"}},\"aggs\":{\"TotalRequest\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}},\"ClosedWithinSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}},\"ClosedOutsideSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value > params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}},\"CitizenAverageRating\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\"]}},{\"term\":{\"Data.history.action.keyword\":\"RATE\"}},{\"exists\":{\"field\":\"Data.history\"}},{\"range\":{\"Data.history.rating\":{\"gte\":1}}}]}},\"aggs\":{\"CitizenAvgRating\":{\"avg\":{\"script\":\"int sum = 0;int count =0;if(params['_source']['Data']['history']!=null){ for (item in params['_source']['Data']['history']) {if(item.rating!=null){ sum += item.rating;} }} return sum;\"}}}}}}}}}}"
      }
    ],
    "filterKeys": [
      {"key": "dsoName", "column": "DSOName"}
    ],
    "isPostResponseHandler": true,
    "chartType": "table",
    "valueType": "number",
    "action": "",
    "documentType": "_doc",
    "drillChart": "none",
    "plotLabel":"DSOName",
    "aggregationPaths": [
      "TotalRequest",
      "ClosedWithinSLA",
      "ClosedOutsideSLA",
      "CitizenAverageRating"
    ],
    "pathDataTypeMapping": [
      {
        "TotalRequest" : "number"
      },
      {
        "ClosedWithinSLA" : "number"
      },
        {
        "ClosedOutsideSLA" : "number"
      },
      {
        "CitizenAverageRating" : "number"
      }
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmBottomDsoByPerformance": {
    "chartName": "DSS_FSM_BOTTOM_DSO_BY_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Raised\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":3,\"order\":{\"_count\":\"asc\"}},\"aggs\":{\"Count\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}},\"Closed Within SLA\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":3,\"order\":{\"_count\":\"asc\"}},\"aggs\":{\"Count\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}}}},\"Closed Outside SLA\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":3,\"order\":{\"_count\":\"asc\"}},\"aggs\":{\"Count\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value > params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}}}}}}}}"
      }
    ],
    "chartType": "line",
    "valueType": "number",
    "action": "",
    "drillChart": "dsoBottomDrillChart",
    "documentType": "_doc",
    "aggregationPaths": [
      "Raised",
      "Closed Within SLA",
      "Closed Outside SLA"
    ],
    "isCumulative": false,
    "interval": "month",
    "insight": {
    },
    "_comment": ""
  },
  "dsoBottomDrillChart": {
    "chartName": "DSS_FSM_DSO_PERFORMANCE",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"DSOName\":{\"terms\":{\"field\":\"Data.vendor.name.keyword\",\"size\":1000,\"order\":{\"_count\":\"asc\"}},\"aggs\":{\"TotalRequest\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}},\"ClosedWithinSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}},\"ClosedOutsideSLA\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value > params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"valueCount\":{\"value_count\":{\"field\":\"Data.vendor.name.keyword\"}}}},\"CitizenAverageRating\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\"]}},{\"term\":{\"Data.history.action.keyword\":\"RATE\"}},{\"exists\":{\"field\":\"Data.history\"}},{\"range\":{\"Data.history.rating\":{\"gte\":1}}}]}},\"aggs\":{\"CitizenAvgRating\":{\"avg\":{\"script\":\"int sum = 0;int count =0;if(params['_source']['Data']['history']!=null){ for (item in params['_source']['Data']['history']) {if(item.rating!=null){ sum += item.rating;} }} return sum;\"}}}}}}}}}}"
      }
    ],
    "filterKeys": [
      {"key": "dsoName", "column": "DSOName"}
    ],
    "isPostResponseHandler": true,
    "chartType": "table",
    "valueType": "number",
    "action": "",
    "documentType": "_doc",
    "drillChart": "none",
    "plotLabel":"DSOName",
    "aggregationPaths": [
      "TotalRequest",
      "ClosedWithinSLA",
      "ClosedOutsideSLA",
      "CitizenAverageRating"
    ],
    "pathDataTypeMapping": [
      {
        "TotalRequest" : "number"
      },
      {
        "ClosedWithinSLA" : "number"
      },
      {
        "ClosedOutsideSLA" : "number"
      },
      {
        "CitizenAverageRating" : "number"
      }
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmTotalReqByDistrict": {
    "chartName": "DSS_FSM_TOTAL_REQ_BY_DISTRICT",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtName\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Open_Req\":{\"filter\":{\"bool\":{\"must_not\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}}]}},\"aggs\":{\"OpenReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"Closed_Req\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}}]}},\"aggs\":{\"ClosedReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"TotalReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}},\"Closed_With_In_Sla\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"ClosedWithInSla\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"TotalCollection\":{\"sum\":{\"field\":\"Data.payments.paymentDetails.bill.billDetails.amountPaid\"}}}}}}"
      }
    ],
    "isMdmsEnabled": true,
    "filterKeys": [
      {"key": "tenantId", "column": "District"}
    ],
    "chartType": "xtable",
    "valueType": "number",
    "isRoundOff": true,
    "drillChart": "fsmTotalReqByTenant",
    "plotLabel": "District",
    "excludedColumns": ["ClosedWithInSla"],
    "computedFields": [
      {
        "postAggregationTheory" : "",
        "actionName": "PercentageComputedField",
        "fields" : ["ClosedReq", "TotalReq"],
        "newField" : "CompletionRateIn%",
        "_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" : ["ClosedWithInSla","TotalReq"],
        "newField" : "SLAAchievedIn%",
        "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name  "
      }
    ],
     "chartSpecificProperty": {
     "XtableColumnOrder":[
     "S.N.",
     "District",
     "OpenReq",
     "ClosedReq",
     "TotalReq",
     "CompletionRateIn%",
     "SLAAchievedIn%",
     "TotalCollection"
     ]
     },
    "insight": {
    },
    "_comment": " "
  },
  "fsmTotalReqByTenant": {
    "chartName": "DSS_FSM_TOTAL_REQ_BY_ULB",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtName\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBs\":{\"terms\":{\"field\":\"Data.fsm.tenantId.keyword\",\"size\":1000},\"aggs\":{\"Open_Req\":{\"filter\":{\"bool\":{\"must_not\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}}]}},\"aggs\":{\"OpenReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"Closed_Req\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}}]}},\"aggs\":{\"ClosedReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"TotalReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}},\"Closed_With_In_Sla\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"ClosedWithInSla\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"TotalCollection\":{\"sum\":{\"field\":\"Data.payments.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}"
      }
    ],
    "filterKeys": [
      {"key": "tenantId", "column": "ULB"}
    ],
    "chartType": "xtable",
    "valueType": "number",
    "isRoundOff": true,
    "drillChart": "fsmTotalReqByWard",
    "plotLabel": "ULB",
    "excludedColumns": ["ClosedWithInSla"],
    "computedFields": [
      {
        "postAggregationTheory" : "",
        "actionName": "PercentageComputedField",
        "fields" : ["ClosedReq", "TotalReq"],
        "newField" : "CompletionRateIn%",
        "_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" : ["ClosedWithInSla","TotalReq"],
        "newField" : "SLAAchievedIn%",
        "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name  "
      }
    ],
    "chartSpecificProperty": {
     "XtableColumnOrder":[
     "S.N.",
     "ULB",
     "OpenReq",
     "ClosedReq",
     "TotalReq",
     "CompletionRateIn%",
     "SLAAchievedIn%",
     "TotalCollection"
     ]
     },
    "insight": {
    },
    "_comment": " "
  },
  "fsmTotalReqByWard": {
    "chartName": "DSS_FSM_TOTAL_REQ_BY_WARD",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.fsm.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "fsm",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"Data.fsm.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Ward\":{\"terms\":{\"field\":\"Data.ward.name.keyword\",\"size\":1000},\"aggs\":{\"Open_Req\":{\"filter\":{\"bool\":{\"must_not\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}}]}},\"aggs\":{\"OpenReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"Closed_Req\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}}]}},\"aggs\":{\"ClosedReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"TotalReq\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}},\"Closed_With_In_Sla\":{\"filter\":{\"bool\":{\"must\":[{\"terms\":{\"Data.fsm.applicationStatus.keyword\":[\"COMPLETED\",\"CITIZEN_FEEDBACK_PENDING\"]}},{\"script\":{\"script\":{\"source\":\"doc['Data.fsm.auditDetails.lastModifiedTime'].value - doc['Data.fsm.auditDetails.createdTime'].value < params.threshold\",\"lang\":\"painless\",\"params\":{\"threshold\":172800000}}}}]}},\"aggs\":{\"ClosedWithInSla\":{\"value_count\":{\"field\":\"Data.fsm.tenantId.keyword\"}}}},\"TotalCollection\":{\"sum\":{\"field\":\"Data.payments.paymentDetails.bill.billDetails.amountPaid\"}}}}}}}}"
      }
    ],
    "filterKeys": [
      {"key": "wardId", "column": "Ward"},
      {"key": "ulbId", "column": "ULB"}
    ],
    "chartType": "xtable",
    "valueType": "number",
    "isRoundOff": true,
    "drillChart": "none",
    "action": "",
    "documentType": "_doc",
    "plotLabel": "Ward",
    "excludedColumns": ["ClosedWithInSla"],
    "computedFields": [
      {
        "postAggregationTheory" : "",
        "actionName": "PercentageComputedField",
        "fields" : ["ClosedReq", "TotalReq"],
        "newField" : "CompletionRateIn%",
        "_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" : ["ClosedWithInSla","TotalReq"],
        "newField" : "SLAAchievedIn%",
        "_comments": "fields are field names picked from its aggregation query to use post aggregation newField value with given new field name  "
      }
    ],
     "chartSpecificProperty": {
     "XtableColumnOrder":[
     "S.N.",
     "Ward",
     "OpenReq",
     "ClosedReq",
     "TotalReq",
     "CompletionRateIn%",
     "SLAAchievedIn%",
     "TotalCollection"
     ]
     },
    "insight": {
    },
    "_comment": " "
  },
  "fsmVehicleLogReportByDDR": {
    "chartName": "DSS_FSM_VECHILE_LOG_REPORT",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.vehicleTrip.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtName\"}",
        "indexName": "vehicletrip",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"data.vehicleTrip.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"NoOfTrips\":{\"value_count\":{\"field\":\"Data.vehicleTrip.@timestamp\"}},\"TotalSeptageCollected\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.tripDetails.volume'].value)/1000.0\"}}},\"TotalSeptageDumped\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}},\"CapacityUtilization\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}}}}}}"
      }
    ],
    "isMdmsEnabled": true,
    "filterKeys": [
      {"key": "tenantId", "column": "District"}
    ],
    "isPostResponseHandler": true,
    "chartType": "xtable",
    "valueType": "number",
    "action": "",
    "isRoundOff": true,
    "documentType": "_doc",
    "drillChart": "fsmVehicleLogReportByTenant",
    "plotLabel":"District",
    "aggregationPaths": [
      "NoOfTrips",
      "TotalSeptageCollected",
      "TotalSeptageDumped",
      "CapacityUtilization"
    ],
    "pathDataTypeMapping": [
      {
        "NoOfTrips" : "number"
      },
      {
        "TotalSeptageCollected" : "number"
      },
      {
        "TotalSeptageDumped" : "number"
      },
      {
        "CapacityUtilization" : "number"
      }
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmVehicleLogReportByTenant": {
    "chartName": "DSS_FSM_VECHILE_LOG_REPORT",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.vehicleTrip.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtName\"}",
        "indexName": "vehicletrip",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"data.vehicleTrip.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"ULBs \":{\"terms\":{\"field\":\"Data.vehicleTrip.tenantId.keyword\",\"size\":1000},\"aggs\":{\"NoOfTrips\":{\"value_count\":{\"field\":\"Data.vehicleTrip.@timestamp\"}},\"TotalSeptageCollected\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.tripDetails.volume'].value)/1000.0\"}}},\"TotalSeptageDumped\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}},\"CapacityUtilization\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}}}}}}}}"
      }
    ],
    "filterKeys": [
      {"key": "tenantId", "column": "Boundary"}
    ],
    "isPostResponseHandler": true,
    "chartType": "xtable",
    "valueType": "number",
    "action": "",
    "isRoundOff": true,
    "documentType": "_doc",
    "drillChart": "fsmVehicleLogReportByVehicleNo",
    "plotLabel":"Boundary",
    "aggregationPaths": [
      "NoOfTrips",
      "TotalSeptageCollected",
      "TotalSeptageDumped",
      "CapacityUtilization"
    ],
    "pathDataTypeMapping": [
      {
        "NoOfTrips" : "number"
      },
      {
        "TotalSeptageCollected" : "number"
      },
      {
        "TotalSeptageDumped" : "number"
      },
      {
        "CapacityUtilization" : "number"
      }
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  },
  "fsmVehicleLogReportByVehicleNo": {
    "chartName": "DSS_FSM_VECHILE_LOG_REPORT",
    "queries": [
      {
        "module": "FSM",
        "dateRefField": "Data.vehicleTrip.@timestamp",
        "requestQueryMap": "{\"wardId\" : \"Data.ward.name.keyword\", \"tenantId\" : \"Data.tenantData.code\" ,  \"district\" : \"Data.tenantData.city.districtCode\"}",
        "indexName": "vehicletrip",
        "aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must_not\":[{\"term\":{\"data.vehicleTrip.tenantId.keyword\":\"pb.testing\"}}]}},\"aggs\":{\"Vehicle Reg No\":{\"terms\":{\"field\":\"Data.vehicleTrip.vehicle.registrationNumber.keyword\",\"size\":1000},\"aggs\":{\"NoOfTrips\":{\"value_count\":{\"field\":\"Data.vehicleTrip.@timestamp\"}},\"TotalSeptageCollected\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.tripDetails.volume'].value)/1000.0\"}}},\"TotalSeptageDumped\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}},\"CapacityUtilization\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.volumeCarried'].value)/1000.0\"}}},\"TankCapacity\":{\"sum\":{\"script\":{\"source\":\"(doc['Data.vehicleTrip.vehicle.tankCapacity'].value)/1000.0\"}}}}}}}}}"
      }
    ],
    "filterKeys": [
      {"key": "registrationNumber", "column": "Vehicle_No"},
      {"key": "wardId", "column": "Ward"},
      {"key": "ulbId", "column": "ULB"}
    ],
    "isPostResponseHandler": true,
    "chartType": "xtable",
    "valueType": "number",
    "action": "",
    "isRoundOff": true,
    "documentType": "_doc",
    "drillChart": "none",
    "plotLabel":"Vehicle_No",
    "aggregationPaths": [
      "NoOfTrips",
      "TotalSeptageCollected",
      "TotalSeptageDumped",
      "CapacityUtilization",
      "TankCapacity"
    ],
    "pathDataTypeMapping": [
      {
        "NoOfTrips" : "number"
      },
      {
        "TotalSeptageCollected" : "number"
      },
      {
        "TotalSeptageDumped" : "number"
      },
      {
        "CapacityUtilization" : "number"
      },
      {
        "TankCapacity" : "number"
      }
    ],
    "isCumulative": true,
    "interval": "month",
    "insight": {
    },
    "_comment": " "
  }

Click here to check the 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_FSM_DASHBOARD",
      "id": "fsm",
      "isActive": "",
      "style": "linear",
      "visualizations": [
        {
          "row": 1,
          "name": "DSS_REVENUE",
          "vizArray": [
            {
              "id": 311,
              "name": "DSS_OVERVIEW",
              "dimensions": {
                "height": 450,
                "width": 4
              },
              "vizType": "metric-collection",
              "label": "DSS_OVERVIEW",
              "noUnit": true,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmTotalrequest",
                  "name": "DSS_FSM_TOTAL_REQUESTS",
                  "code": "",
                  "chartType": "metric",
                  "filter": "",
                  "headers": []
                },
                {
                  "id": "totalSludgeTreated",
                  "name": "DSS_FSM_TOTAL_SLUDGE_TREATED",
                  "code": "",
                  "chartType": "metric",
                  "filter": "",
                  "headers": []
                },
                {
                  "id": "avgFSMCostRequest",
                  "name": "DSS_FSM_AVG_FSM_COST_OR_REQ",
                  "code": "",
                  "chartType": "metric",
                  "filter": "",
                  "headers": []
                },
                {
                  "id": "totalCollectioninLacs",
                  "name": "DSS_FSM_TOTAL_COLLECTION",
                  "code": "",
                  "chartType": "metric",
                  "filter": "",
                  "headers": []
                },
                {
                  "id": "slaCompliance",
                  "name": "DSS_FSM_SLA_COMPLIANCE",
                  "code": "",
                  "chartType": "metric",
                  "filter": "",
                  "headers": []
                },
                {
                  "id": "citizenAvgRating",
                  "name": "DSS_FSM_CITIZEN_AVG_RATING",
                  "code": "",
                  "chartType": "metric",
                  "filter": "",
                  "headers": []
                }
              ]
            },
            {
              "id": 322,
              "name": "DSS_FSM_TOTAL_CUMULATIVE_COLLECTION",
              "dimensions": {
                "height": 450,
                "width": 6
              },
              "vizType": "chart",
              "label": "",
              "noUnit": true,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmTotalCumulativeCollection",
                  "name": "Monthly",
                  "code": "",
                  "chartType": "line",
                  "filter": "",
                  "headers": []
                }
              ]
            }
          ]
        },
        {
          "row": 2,
          "name": "DSS_REVENUE",
          "vizArray": [
            {
              "id": 321,
              "name": "DSS_FSM_TOP_ULB_BY_PERFORMANCE",
              "dimensions": {
                "height": 250,
                "width": 3
              },
              "vizType": "performing-metric",
              "label": "",
              "noUnit": false,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmTopUlbByPerformance",
                  "name": "Monthly",
                  "code": "",
                  "chartType": "bar",
                  "filter": "",
                  "headers": []
                }
              ]
            },
            {
              "id": 322,
              "name": "DSS_FSM_BOTTOM_ULB_BY_PERFORMANCE",
              "dimensions": {
                "height": 250,
                "width": 3
              },
              "vizType": "performing-metric",
              "label": "",
              "noUnit": false,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmBottomUlbByPerformance",
                  "name": "Monthly",
                  "code": "",
                  "chartType": "bar",
                  "filter": "",
                  "headers": []
                }
              ]
            },
            {
              "id": 323,
              "name": "DSS_FSM_COLLECTION_BY_USAGE_TYPE",
              "dimensions": {
                "height": 250,
                "width": 4
              },
              "vizType": "chart",
              "label": "",
              "noUnit": false,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmCollectionByUsageType",
                  "name": "DSS_FSM_COLLECTION_BY_USAGE_TYPE",
                  "code": "",
                  "chartType": "donut",
                  "filter": "",
                  "headers": []
                }
              ]
            }
          ]
        },
        {
          "row": 3,
          "name": "DSS_REVENUE",
          "vizArray": [
            {
              "id": 325,
              "name": "DSS_FSTP_CAPACITY_UTILIZATION",
              "dimensions": {
                "height": 450,
                "width": 5
              },
              "vizType": "chart",
              "label": "",
              "noUnit": true,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmCapacityUtilization",
                  "name": "Monthly",
                  "code": "",
                  "chartType": "line",
                  "filter": "",
                  "headers": []
                }
              ]
            },
            {
              "id": 326,
              "name": "DSS_FSM_MONTHLY_WASTE_CAL",
              "dimensions": {
                "height": 450,
                "width": 5
              },
              "vizType": "chart",
              "label": "",
              "noUnit": true,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmMonthlyWasteCal",
                  "name": "Monthly",
                  "code": "",
                  "chartType": "bar",
                  "filter": "",
                  "headers": []
                }
              ]
            }
          ]
        },
        {
          "row": 4,
          "name": "DSS_REVENUE",
          "vizArray": [
            {
              "id": 327,
              "name": "DSS_FSM_TOP_DSO_BY_PERFORMANCE",
              "dimensions": {
                "height": 450,
                "width": 5
              },
              "vizType": "chart",
              "label": "",
              "noUnit": true,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmTopDsoByPerformance",
                  "name": "Monthly",
                  "code": "",
                  "chartType": "horizontalBar",
                  "filter": "",
                  "headers": []
                }
              ]
            },
            {
              "id": 329,
              "name": "DSS_FSM_BOTTOM_DSO_BY_PERFORMANCE",
              "dimensions": {
                "height": 450,
                "width": 5
              },
              "vizType": "chart",
              "label": "",
              "noUnit": true,
              "isCollapsible": false,
              "charts": [
                {
                  "id": "fsmBottomDsoByPerformance",
                  "name": "Monthly",
                  "code": "",
                  "chartType": "horizontalBar",
                  "filter": "",
                  "headers": []
                }
              ]
            }
          ]
        },
        {
          "row": 5,
          "name": "DSS_REVENUE",
          "vizArray": [
            {
              "id": 339,
              "name": "DSS_FSM_TOTAL_REQ_BY_DISTRICT",
              "dimensions": {
                "height": 350,
                "width": 10
              },
              "vizType": "chart",
              "label": "",
              "noUnit": false,
              "isCollapsible": true,
              "charts": [
                {
                  "id": "fsmTotalReqByDistrict",
                  "name": "DSS_FSM_TOTAL_REQ_BY_DISTRICT",
                  "code": "",
                  "chartType": "table",
                  "filter": "",
                  "headers": [],
                  "tabName": "Boundary"
                }
              ]
            }
          ]
        },
        {
          "row": 6,
          "name": "DSS_REVENUE",
          "vizArray": [
            {
              "id": 331,
              "name": "DSS_FSM_VECHILE_LOG_REPORT",
              "dimensions": {
                "height": 350,
                "width": 10
              },
              "vizType": "chart",
              "label": "",
              "noUnit": false,
              "isCollapsible": true,
              "charts": [
                {
                  "id": "fsmVehicleLogReportByDDR",
                  "name": "DSS_FSM_VECHILE_LOG_REPORT",
                  "code": "",
                  "chartType": "table",
                  "filter": "",
                  "headers": [],
                  "tabName": "Boundary"
                }
              ]
            }
          ]
        }
      ]
    },

Click here for the complete configuration.

Role Dashboard Mappings Configuration

The master dashboard configuration, which was explained earlier, holds the list of dashboards that 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 only 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": "Facial Sludge Management",
          "id": "fsm"
        }
      ]
    },
    {
      "_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-fsm"
        }
      ]
    }

  ]
}

Click here to check the configuration

MDMS Configuration to be added

common-masters/uiCommonConstants.json

"fsm":{
                 "routePath":"/dashboard/fsm",
                 "isOrigin":true
              },
              "ulb-fsm":{
                 "routePath":"/dashboard/ulb-fsm",
                 "isOrigin":true
              }

Click here to check the complete configuration.

roleaction.json

 {
      "rolecode": "STADMIN",
      "actionid": {{PlaceHolder1}},
      "actioncode": "",
      "tenantId": "pb"
    }
    
    
    {
      "rolecode": "STADMIN",
      "actionid": {{PlaceHolder2}},
      "actioncode": "",
      "tenantId": "pb"
    },
     {
      "rolecode": "EMPLOYEE",
      "actionid": {{PlaceHolder2}},
      "actioncode": "",
      "tenantId": "pb"
    },  
     {
      "rolecode": "UC_EMP",
      "actionid": {{PlaceHolder2}},
      "actioncode": "",
      "tenantId": "pb"
    },

Click here to check the complete configuration.

Action test.json:

{
      "id": {{PlaceHolder1}},
      "name": "DSS Dashboard Config Facial Sludge Management",
      "url": "/dashboard-analytics/dashboard/getDashboardConfig/fsm",
      "parentModule": "",
      "displayName": "DSS",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "DSS",
      "code": "null",
      "path": ""
    },
  {
      "id": {{PlaceHolder2}},
      "name": "DSS Dashboard Charts",
      "url": "/dashboard-analytics/dashboard/getChartV2",
      "parentModule": "",
      "displayName": "DSS",
      "orderNumber": 0,
      "enabled": false,
      "serviceCode": "DSS",
      "code": "null",
      "path": ""
    },
    

Click here to check the complete configuration.

FSM-DSS Consists of multiple graphs which represent the data of FSM. Each graph has its own configuration which will describe the chart and its type.

DSS Consists of following charts in FSM:

  • Overview

  • Total Cumulative Collection

  • Top ULB By Performance

  • Bottom ULB by Performance

  • FSM Collection by Usage Type

  • FSTP - Capacity Utilization

  • Monthly Septage Collected

  • Top DSO By Performance

  • Bottom DSO By Performance

  • Desludging Request Report

  • Vehicle Log Report

Overview

Overview graph contains multiple data information as below in the selected time period.

  • Total requests: Which represents the number of FSM applications.

  • Total sludge treated: This represents the total sludge dumped at the yard in KL.

  • Average FSM cost: This represents the average collection amount for the FSM applications.

  • Total collection: This represents the total collection amount for the FSM applications.

  • SLA compliance: This represents the total SLA achieved in percentage.

  • Average citizen rating: This represents the citizen average rating value.

Total Cumulative Collection

This graph contains the 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 ULB By Performance

This graph represents the ULBs based on the SLA achieved in bar chart representation with the percentage of SLA achieved in ascending order. This chart also contains the drill-down to give the complete information regarding each ULB.

Drill chart: If there is a drill-down on the visualisation, then the code of the drill-down visualisation is added here. This will be used by client service to manage drill-downs.

This chart consists of a drill-down, so, we gave the drill-down chart key as a reference in this chart (as shown in the picture above).

Here is the drill down chart config params.

Table chart sample: This chart comes with 2 kinds: Table and xtable.

The table type allows aggregated fields added as available in the query keys. Hence, to extract the values based on the key, aggegationPaths needs to add along with their data type as in pathDataTypeMapping.

Bottom ULB by Performance

This graph represents the ULB’s based on the SLA achieved in bar chart representation with the percentage of SLA achieved in descending order. This chart also contains the drill-down to give the complete information regarding each ULB.

When you click on "Show More," you will navigate to a tabular chart of the bottom ULB by performance.

FSM Collection by Usage Type

This graph shows the collection amount based on the usage/property type, and this amount will change as per the denomination filter change. This also shows the percentage of the top four properties; the remaining properties will go under the 'Others' category.

FSTP - Capacity Utilisation

This graph is in the line chart representation, and shows the data in cumulative format. It contains the information about the waste collecting plant capacity utilisation in percentage as well as the total waste dumped at plant in KL at the top of the graph.

Monthly Septage Collected

This graph shows the data in horizontal bar representation, and the bars contain data monthly wide as well as non-cumulative data. This graph contains the monthly information of septage collected and dumped at the plant in KL.

Top DSO By Performance

This graph represents the DSOs based on the number of DSO requests and on SLA achievement in bar chart representation in ascending order. This chart also contains the drill-down to give the complete information regarding each DSO.

When you click on "Show More", you can see the details of the available DSOs under the selected ULB.

Bottom DSO By Performance

This graph represents the DSOs based on the number of DSO requests and on SLA achievement in bar chart representation in descending order. This chart also contains the drill-down to give the complete information regarding each DSO.

This is the bottom DSO drill-down chart which represents the table chart type.

When you click on "Show More", you can see the details of the available DSOs under the selected ULB.

Desludging Request Report

This tabular chart representation graph shows multiple FSM information, such as the number of open application requests, closed requests, total requests, completion rate in percentage, SLA achieved in percentage, and total collection amount. This table shows the data at the district-level and also has the drill-down chart from each district to ULB, as well from ULB to the ward-level data for the same.

The xtable type allows you to add multiple computed fields with the aggregated fields dynamically added.

To add multiple computed columns, computedFields [] where actionName (IComputedField<T> interface), fields [] names as in exist in query key, newField as name to appear for computation must be defined.

chartSpecificProperty: This is specific to FSM-DSS, and it is used to achieve the xtable column order along with the computed fields. This property is not used in any other module till now.

When you click on any district name, you will see the drill-down charts, which will represent that specific district data.

When you click on the ULB, you will navigate towards under that specific ULB and each ward will show the data specific to that ward.

Vehicle Log Report

This table shows the data of vehicle trips, and it includes the number of trips, total septage collected, total septage dumped, and capacity utilisation in percentage. This graph also contains the drills-downs from district to ULB and from ULB to the vehicle level, which shows the vehicle number.

When you click on any district name, you will see the drill-down charts, which will represent the data specific to that district.

When you click on any boundary/ULB, you will navigate to the specific vehicle details which will be as shown below.

Newly-Introduced Property

isRoundOff: This property is introduced to round-off the decimal values. For example, if the value is 25.43 by using isRoundOff property in configuration, you will get it 25. If value is 22.56, the round-off value will be 23. This can be used for insights configuration as well as overview graph.

Common Properties Available

Key (Example: fsmTotalrequest): This is the visualisation code. This key will be referred to in further visualisation configurations. This is the key which will be used by the client application to indicate which visualisation 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 localisation which will be used by the client side.

queries: Some visualisations 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. Faecal Sludge Management is FSM.

queries.indexName: The name of the index on 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 will 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. 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 a date filter is applied against these visualisations, each of them has to apply it against their own date reference fields. 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 visualisations, this field defines what is the type of chart/visualisation 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 as query

Pie - This represents the aggregated data on grouping. This 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 performance wise.

Table - Represents a form of plots and value with headers as grouped on and list of its key, values pairs.

xtable - Represents an 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, an amount, or a count. To represent them and differentiate the numbers from amount and percentage, this field is used to indicate the type of value that this visualisation will send.

Action: Some visualisations are not just aggregation on data source. There might be cases where we have to do a post-aggregation computation. For example, in the case of top 3 performing ULBs, the target and total collection is obtained, and then the percentage is calculated. In such cases, the action that has to be performed on that data is defined in this parameter.

documentType: The type of document on which the query has to be executed is defined here.

drillChart: If there is a drill-down on the visualisation, 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 have aggregation names in it. To fetch the value out of each aggregation response, the name of the aggregation in the query will be needed. 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 as percentage is increased or decreased.

_comment: To display information on the “i” symbol of each visualisation, the visualisation information is maintained in this field.

Postman collection for fsm-dss: https://www.getpostman.com/collections/119ee90dd54c04617c3a