Overview
...
Overview
Ifix-Adapter is a system that works as a mediator between ifix and its clients. This system will receive requests from the client system and convert the data in the Ifix required format This document contains the details on how to set up the ifix-adapter service and describes the functionalities it provides supports.
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 pgr-services persister config path added in it
PSQL server is running and database is created to store complaint data
(Optional) Indexer config for pgr-services is added in egov-indexer yaml paths to index the generated data. Index are required for data visualisation in kibana or in DSS.
(Optional) Report config for pgr-services is added in Report service config paths. Required if reports are to be provided to the user.
Redis
Following services should be up and running:
egov-user
egov-workflow-v2
egov-perister
egov-localization
egov-notification-sms
egov-mdms
egov-idgen
egov-url-shortening
egov-hrms
Key Functionalities
Citizen can file, track and rate the complaint
Citizen can add image and comments related to the complaint
Citizen can re-open the complaint in certain given period of time after resolution
ULB can setup the complaint workflow according to their requirements and staff capacity
ULB can track the SLA for resolving each complaint and can use it as a metric to streamline the process for resolving complaints
- Department wise assignment of the complaint to the LME
Client Service Like mgramseva-ifix-adapter
Target service IFIX- fiscal-event-service
Target Service IFIX-keycloak
IFIX master-data-service
Key Functionalities
IFIX client requests are pushed to IFIX
The authentication token is fetched from keycloak and cached. Token will be re-fetched 5 minutes before expiry
project id is fetched from IFIX and cached
COA id fetched from IFIX and cached
Every push to IFIX is recorded in the table with HTTP status
status series 200 considered success
status 400 are marked client error and reported back to the client
status 500 resubmitted by the scheduler
Deployment Details
API List
...
Title
...
Link
...
/request/_create
...
https://www.getpostman.com/collections/09154f94d2c291a96777
...
/request/_update
...
https://www.getpostman.com/collections/09154f94d2c291a96777
...
Deploy the latest version of pgr-services
Add pgr-service-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
)If any Report Config is created, the config should be added to config folder in git and that path should be added in Report service. (The file path is to be added in file called “reportFileLocationsv1.txt” in Config folder)
If index are to be created add the indexer config path in indexer service. (The file path is to be added in environment yaml file in param called
egov-indexer-yaml-repo-path
)
Configuration Details
Add master data in MDMS service with module name as
RAINMAKER-PGR
. Following is some sample master data for the service:Code Block { "tenantId": "pb", "moduleName": "RAINMAKER-PGR", "ServiceDefs": [ { "serviceCode": "NoStreetlight", "keywords": "streetlight, light, repair, work, pole, electric, power, repair, damage, fix", "department": "Streetlights", "slaHours": 336, "menuPath": "StreetLights", "active": false, "order": 1 }, { "serviceCode": "StreetLightNotWorking", "keywords": "streetlight, light, repair, work, pole, electric, power, repair, fix", "department": "DEPT_1", "slaHours": 336, "menuPath": "StreetLights", "active": true, "order": 2 }, { "serviceCode": "GarbageNeedsTobeCleared", "keywords": "garbage, collect, litter, clean, door, waste, remove, sweeper, sanitation, dump, health, debris, throw", "department": "DEPT_25", "slaHours": 336, "menuPath": "Garbage", "active": true, "order": 3 } ] }
Create businessService (workflow configuration) using the
/businessservice/_create
. Following is the product configuration for PGR:Code Block { "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": "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", "CSR" ] } ] }, { "sla": null, "state": "PENDINGFORASSIGNMENT", "applicationStatus": "PENDINGFORASSIGNMENT", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": false, "actions": [ { "action": "COMMENT", "nextState": "PENDINGFORASSIGNMENT", "roles": [ "CITIZEN" ] }, { "action": "ASSIGN", "nextState": "PENDINGATLME", "roles": [ "GRO", "DGRO" ] }, { "action": "REJECT", "nextState": "REJECTED", "roles": [ "GRO", "DGRO" ] } ] }, { "sla": null, "state": "PENDINGFORREASSIGNMENT", "applicationStatus": "PENDINGFORREASSIGNMENT", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": false, "actions": [ { "action": "COMMENT", "nextState": "PENDINGFORREASSIGNMENT", "roles": [ "CITIZEN" ] }, { "action": "REASSIGN", "nextState": "PENDINGATLME", "roles": [ "GRO", "DGRO" ] }, { "action": "REJECT", "nextState": "REJECTED", "roles": [ "GRO", "DGRO" ] } ] }, { "sla": 259200000, "state": "PENDINGATLME", "applicationStatus": "PENDINGATLME", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": false, "actions": [ { "action": "COMMENT", "nextState": "PENDINGATLME", "roles": [ "CITIZEN" ] }, { "action": "RESOLVE", "nextState": "RESOLVED", "roles": [ "PGR_LME" ] }, { "action": "REASSIGN", "nextState": "PENDINGFORREASSIGNMENT", "roles": [ "PGR_LME" ] } ] }, { "sla": null, "state": "REJECTED", "applicationStatus": "REJECTED", "isStateUpdatable": false, "docUploadRequired": false, "isStartState": false, "isTerminateState": true, "actions": [ { "action": "COMMENT", "nextState": "REJECTED", "roles": [ "CITIZEN" ] }, { "action": "REOPEN", "nextState": "PENDINGFORASSIGNMENT", "roles": [ "CFC", "CSR", "CITIZEN" ] }, { "action": "RATE", "nextState": "CLOSEDAFTERREJECTION", "roles": [ "CFC", "CITIZEN" ] } ] }, { "sla": null, "state": "RESOLVED", "applicationStatus": "RESOLVED", "isStateUpdatable": false, "docUploadRequired": false, "isStartState": false, "isTerminateState": true, "actions": [ { "action": "COMMENT", "nextState": "RESOLVED", "roles": [ "CITIZEN" ] }, { "action": "REOPEN", "nextState": "PENDINGFORASSIGNMENT", "roles": [ "CFC", "CSR", "CITIZEN" ] }, { "action": "RATE", "nextState": "CLOSEDAFTERRESOLUTION", "roles": [ "CFC", "CITIZEN" ] } ] }, { "sla": null, "state": "CLOSEDAFTERREJECTION", "applicationStatus": "CLOSEDAFTERREJECTION", "isStateUpdatable": false, "docUploadRequired": false, "isStartState": false, "isTerminateState": true }, { "sla": null, "state": "CLOSEDAFTERRESOLUTION", "applicationStatus": "CLOSEDAFTERRESOLUTION", "isStateUpdatable": false, "docUploadRequired": false, "isStartState": false, "isTerminateState": true } ] } ] }
Using
/localization/messages/v1/_upsert
, add localisation (templates) for notification messages to be sent. Following are the product notification templates:Code Block { "messages": [ { "code": "PGR_APPLY_PENDINGFORASSIGNMENT_SMS_MESSAGE", "message": "Dear Citizen, Your complaint for <complaint_type> has been submitted with ID <id> on <date>. You can track your complaint status on the mSeva Punjab mobile App (download here - <download link>) or your local municipal web portal.", "module": "rainmaker-pgr", "locale": "en_IN" }, { "code": "PGR_RESOLVE_RESOLVED_SMS_MESSAGE", "message": "Dear Citizen, Your complaint for <complaint_type> with ID <id> submitted on <date> has been resolved by <emp_name>. If you are not satisfied with service you can REOPEN complaint through mSeva Punjab mobile App (download here - <download_link>) or your local municipal web portal or by calling our CSR.", "module": "rainmaker-pgr", "locale": "en_IN" }, { "code": "PGR_REOPEN_PENDINGFORASSIGNMENT_SMS_MESSAGE", "message": "Dear Citizen, Your complaint for <complaint_type> with ID <id> submitted on <date> has been RE-OPEN as per your request. You can track your complaint status and connect with our officials on the mSeva Punjab mobile App (download here - <download_link>) or your local municipal web portal.", "module": "rainmaker-pgr", "locale": "en_IN" }, { "code": "PGR_REJECT_REJECTED_SMS_MESSAGE", "message": "Dear Citizen, Your complaint for <complaint_type> with ID <id> submitted on <date> has been rejected. Reason for Rejection: <reason>, Additional Comments: <additional_comments> If you wish to re-open the complaint, you can download the mSeva Punjab mobile app (download here - <download_link>) or visit your local municipal website.", "module": "rainmaker-pgr", "locale": "en_IN" }, { "code": "PGR_REASSIGN_PENDINGATLME_SMS_MESSAGE", "message": "Dear Citizen, Your complaint for <complaint_type> with ID <id> submitted on <date> has been re-assigned to <reassign_emp_name>, <emp_designation>, <emp_department>. You can track your complaint status and connect with our officials on the mSeva Punjab mobile App (download here - <download_link>) or your local municipal web portal.", "module": "rainmaker-pgr", "locale": "en_IN" } ] }
Add Role-Action mapping for the API’s in MDMS. Following are the required entries. They should be mapped to both CITIZEN and appropriate employee roles.
Code Block { { "id": {{ID_PLACEHOLDER}}, "name": "Create PGR Request", "url": "/pgr-services/v2/request/_create", "parentModule": "", "displayName": "Create PGR Request", "orderNumber": 0, "enabled": false, "serviceCode": "pgr-services", "code": "null", "path": "" }, { "id": {{ID_PLACEHOLDER}}, "name": "Update PGR Request", "url": "/pgr-services/v2/request/_update", "parentModule": "", "displayName": "Update PGR Request", "orderNumber": 0, "enabled": false, "serviceCode": "pgr-services", "code": "null", "path": "" }, { "id": {{ID_PLACEHOLDER}}, "name": "Search PGR Request", "url": "/pgr-services/v2/request/_search", "parentModule": "", "displayName": "Search PGR Request", "orderNumber": 0, "enabled": false, "serviceCode": "pgr-services", "code": "null", "path": "" }, { "id": {{ID_PLACEHOLDER}}, "name": "Search PGR Request", "url": "/pgr-services/v2/request/_count", "parentModule": "", "displayName": "Count PGR Request", "orderNumber": 0, "enabled": false, "serviceCode": "pgr-services", "code": "null", "path": "" }
Integration
Integration Scope
PGR service can be integrated with any organisation or system which wants to track customer queries or complaint. The organisations can customise the workflow depending on there product requirements
Integration Benefits
Easy tracking and resolution of complaints
Configurable workflow according to client requirement
Steps to Integration
Customer can raise a complaint using the
/requests/_create
Organisation or System can search the complaint using
/requests/_search
endpointOnce the complaint is raised the organisation or system can call
/requests/_update
endpoint to move the application further in workflow until it get resolved
Interaction Diagram
...
Reference Docs
Doc Links
...
Title
...
Link
...
Workflow Technical Document
...
...
User Technical Document
...
...
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
...
HRMS Technical Document
...
NEEDS TO BE UPDATED
ifix-reference-adapter
Environment Variables | Description |
| Topic in which client requests are put . From this further listen and posting happens |
| Host name of the key cloak authentication token provider |
| key cloak authentication token url |
| userid of for authentication token |
| password for authentication token |
| host name of IFIX server |
| IFIX post URL |
| Host name of the redis server |
| top level tenant id of the client |
| url for COA search in IFIX |
| Url for the project code search in IFIX |
| dialect for JPA. you can change this to oracle or my sql etc |
| will generate the required tables in the respective database . This feature is used instead of flyway to get database in-dependency |
Configuration Details
Update Key cloak credentials in dev.yaml,qa.yaml,prod.yaml according to environment The credentials are “
keycloak.credentials.clientid
and “keycloak.credentials.clientsecret
” Example is given in here and hereMap clientcode, ifixcoacode, ifixid in ifix_adapter_coa_map table
“clientcode” is the tax head like “WATER_CHARGES” or ‘10011’ used in IFIX client like mgramseva
“ifixcoacode” is the 16 digit glcode in IFIX. 16 digit code is mapped then this can be ported to any environment like dev to qa ,or qa to uat or from uat to prod. Prefer mapping ifixcoacode
Another way is to map the IFIX COA ID itself. Since these are generated ids you cant port to other environments. ID mapping has to be done for every environment.
Preference is given to COA Code, if it is null ID will be used
example is INSERT INTO public.ifix_adapter_coa_map(
id, clientcode, ifixcoacode, ifixid, tenantid)
VALUES (1,'10101', '0215-01-102-00-00-01', '6cbcb4a1-2431-4f78-89d7-b4f0565aba37', 'pb');
If client “project code” and IFIX project code are the same then no need for mapping. If it is different then map clientprojectcode, ifixprojectid in ifix_adapter_project_map table. Ideally, you should keep both codes the same for getting meaningful data on the dashboard. This way you don't have to do any mapping for project code for any environment. But if for any reason you have different project codes in IFIX and its client or has multiple projects having the same project code then only go for this mapping. The adapter will first check in the IFIX for the supplied “projectCode”, If found it will use it and caches it. If multiple projects or not found it will look into this table for mapping
example is INSERT INTO public.ifix_adapter_project_map(
id, clientprojectcode, ifixprojectid, tenantid)
VALUES (1, '7374', 'e42db9bb-8427-40a6-9939-4f2189d032bf','pb');
state.goverment.code
set this value to the clients top level tenantid
Interaction Diagram
...
Reference Docs
Doc Links
Title | Link |
Api Swagger document | https://github.com/egovernments/iFix-Dev/blob/adaptor-dev/reference-adapter/iFix-adapter-v1.0.yaml |
Postman |
/request/_count
API List
API | Description |
---|---|
events/v1/_push | Api for receiving data from client (mgram). This is the only api present in adapter |