MDMS Configuration:

State and ULB Setup steps:

Adding a tenant :

  • In MDMS, file tenant.json, under tenant folder holds the details of state and ULBs  to be enabled in that state. 

{

  "tenantId": "pb",  //<ReplaceWithDesiredTenantId>

 "moduleName": "tenant",

 "tenants": [ {

      "code": "pb.citya", //<state.ulbname>

      "name": "City A",  //<name of the ulb>

      "description": "City A", //<ulb description>

      "logoId": "https://s3.ap-south-1.amazonaws.com/pb-egov-assets/pb.citya/logo.png",  //<ulb logo path - To display ulb logo on login>

      "imageId": null,

      "domainUrl": "", //<ulb website url>

      "type": "CITY",

      "twitterUrl": null,

      "facebookUrl": null,

      "emailId": "complaints.citya@gmail.com",  //<ulb email id>

      "OfficeTimings": {

        "Mon - Sat": "10.00 AM - 5.00 PM"

      },

"city": {

"name": "City A",

"localName": null,

"districtCode": "CITYA",

"districtName": null,

"regionName": null,

"ulbGrade": "Municipal Corporation",

"longitude": 75.5761829,

"latitude": 31.3260152,

"shapeFileLocation": null,

"captcha": null,

"code": "1013"

},

"address": "City A Municipal Cornoration Address",

"contactNumber": "001-2345876"

}]}

Note: 

  1. To enable state and ulb the above data should be pushed in tenant.json file. Here "ULB Grade" and City  "Code" are important fields. ULB Grade can have a set of allowed values that determines the ULB type, (Municipal corporation (Nagar Nigam), Municipality (municipal council, municipal board, municipal committee) (Nagar Parishad), etc). City "Code" has to be unique to each tenant.  This city-specific code is used in all transactions. Not permissible to change the code. If changed we will lose the data of the previous transactions done.

Localization should be pushed for ulb grade and ulb name.  Format is given below.
Localization for ULB Grade :

 {

            "code": "ULBGRADE_MUNICIPAL_CORPORATION",

            "message": "MUNICIPAL CORPORATION",

            "module": "rainmaker-common",

            "locale": "en_IN"

        }

Localization for ULB Name : 

{

            "code": "TENANT_TENANTS_UK_HALDWANI",    

            "message": "Haldwani",

            "module": "rainmaker-tl",

            "locale": "en_IN"

        }

Format of localization code for tenant name : <MDMS_State_Tenant_Folder_Name>_<Tenants_Fille_Name>_<Tenant_Code>(replace dot with underscore)

  1. Naming Convention for Tenants Code

    • >

    “Code”:“pb.citya” is StateTenantId.ULBTenantName"

  2. "logoId": "https://s3.ap-south-1.amazonaws.com/pb-egov-assets/pb.citya/logo.png",  Here the last section of the path should be "/<tenantId>/logo.png". If we use anything else, logo will not be displayed on the UI. <tenantId> is the tenant code ie “pb.citya”.



  • citymodule.json file under tenant folder used to activate modules in specific ulb. 

Ex : {

  "module": "TL",

  "code": "TL",   

    "tenants": [{ "code": "pb.citya"},   

            {"code": "pb.cityb"}]

            }

Module TL are enabled in ULB city a and city b. Modules mentioned in this file appears in the menutree of the application.  ULB level module enable or disable are handled here.



Adding a state details :

  • In MDMS, file StateInfo.json, under common-masters folder holds the state data. 

"tenantId": "pb"  ,  //<ReplaceWithDesiredTenantId>

"moduleName": "common-masters",

"StateInfo": [   {

"name": "punjab",

"code":"pb"  , //<ReplaceWithDesiredTenantId>  "bannerUrl":https://amazonaws-url/foldername/file.jpg",  <bannerimage file path>

"logoUrl":"https://amazonaws-url/foldername/file.jpg", <state logo image file path>

"hasLocalisation" : true, <if true, enables multilingual support mentioned below. Or else by default english>

      "languages" : [ {   <languages to be supported are listed here>

          "label": "ENGLISH",

          "value": "en_IN"

        }, {

          "label": "हिंदी",

          "value": "hi_IN"

        }  ],

      "defaultUrl" : {

          "citizen" : "/user/register",

          "employee" : "/user/login"

}  } ]

}

Boundary Data Load :

  • Boundary is ULB specific  master data. For Revenue modules we use Revenue boundary.  It’s pushed under each ulb.

File Path would be : https://github.com/egovernments/state-mdms-data/tree/master/data/tenant/ulb/egov-location/boundary-data.json

Boundary Hierarchy :  Zone -> Ward -> Locality -> Area

Boundary data json is generated using implementation Kit. 



Trade License  Master Data Load:

Trade Type Master :

  • Trade Types of  all ULB’s are pushed under “Trade License” folder of MDMS repo.

File Path would be :

https://github.com/egovernments/state-mdms-data/tree/master/data/tenant/TradeLicense/TradeType.json 

Ex:

{

  "tenantId": "xyz",  //<ReplaceWithDesiredTenantId>

  "moduleName": "TradeLicense",

  "TradeType": [

    {

      "code": "TRADE.INDUSTRY.FM", //<Trade Type Code is mentioned here>

      "uom": null,

      "applicationDocument": [

        "IDPROOF",

        "OTHER"

      ],

      "verificationDocument": [],

      "active": true

    }]

}

For each trade type, subtypes are defined. Each subtype has mandatory documents to be attached.  Unique code will be defined for each trade type, sub type and document.  

"code": "TRADE.INDUSTRY.FM"  // Defines Category -> Trade Type -> Trade Sub Type  

TRADE is category 

INDUSTRY is Trade Type

FM is Trade Subtype(Floor Mill)

Note: Code defines levels of hierarchy.  Dots define the number of hierarchy levels.  TRADE.INDUSTRY specifies two level, which means TradeType INDUSTRY falls under TRADE category. TRADE.INDUSTRY.FM specifies three levels, which means FM is subtype under INDUSTRY.

For all the master data, we are pushing localization messages. Explanation on Inserting localization for master data  is given in Localization section below.



Trade Rates :

  • Trade Rates for each trade subtype are stored in database. Rest endpoints are available to create trade rates and search existing trade rates. Can use below curl command for create and search trade rates.

  • -------------------------- Search Trade Rates ------------------------------------

curl -X POST \  'https://APPLICATION-URL/tl-calculator/billingslab/_search?tenantId=state.ulbname' \

  • H 'Content-Type: application/json' \

  • H 'Postman-Token: 80d84c50-b16e-44dd-9cc5-544def2ecd81' \

  • H 'cache-control: no-cache' \

  • d '{

"RequestInfo": {

"authToken": "3bad8c62-b769-4a69-bf8b-0c6f008a5f01"

}

}'

  • -------------------------- Create Trade Rates ------------------------------------

curl -X POST \  'https://APPLICATION-URL/tl-calculator/billingslab/_create?tenantId=state.ulbname' \

  • H 'Content-Type: application/json' \

  • H 'Postman-Token: 59653a46-0a96-4eb0-a1cd-3e6c47f67aa0' \

  • H 'cache-control: no-cache' \

  • d '{

"RequestInfo": {

"authToken": "796978d5-47d4-48b0-8995-f9e3fbfc32d8"

},

"billingSlab": [

  {

    "tenantId": "state.ulbname",

    "licenseType": "PERMANENT",

    "structureType": "IMMOVABLE.SHED",

    "tradeType": "TRADE.HOTELS.HL30B",

    "accessoryCategory": null,

    "type": "FLAT",

    "uom": null,

    "fromUom": 0,

    "toUom": 0,

    "rate": 1000

  }

}’  //<Replacewith proper application url and the tenantid>

Note: Currently, delete rate is not supported. To delete any specific rate, updating “rate” to null using update endpoint will inactivate the rate for specific subtype.



Adding role, actions to MDMS

Actions-test.json: 

   {

      "id": 1685,  //<Unique identifier>

      "name": "Create TradeLicense",

      "url": "/tl-services/v1/_create", //<url of the feature>

      "parentModule": "",

      "displayName": "Create TradeLicense",

      "orderNumber": 0,

      "enabled": false,

      "serviceCode": "tl-services",

      "code": "null",

      "path": ""

}



  • Role based actions will have mappings between action and roles.  It Specifies which role can perform what actions. Ex: User with TLCreator role mapped to “Create Trade License” action/feature, can only perform create TL application.  A user can have multiple roles and multiple actions mapped.



Roleactions.json:

"roleactions": [

    {

      "rolecode": "TL_CREATOR",

      "actionid": 1685,

      "actioncode": "",

      "tenantId": "pb"  //<ReplacewithTenantId> 



    }]



Localization

  • All the Master data, labels, notifications, validation/Success messages are localized. To support multilingual, we use common code for each field for which messages in different languages will be pushed using endpoints. Create, upsert and search endpoints are used to create/update localization messages.

  • Need to push localization messages for newly added master data.

Localization code format for Masters :  <ModuleName_MasterName_Code>

Ex: Trade Type Master

{

            "code": "TRADELICENSE_TRADETYPE_INDUSTRY",

            "message": "Industry/Factory/Mill",

            "module": "rainmaker-tl",

            "locale": "en_IN"

        }

Trade Sub Type :

{

            "code": "TRADELICENSE_TRADETYPE_TRADE_INDUSTRY_FM",

            "message": "Flour mill, spice mill,cotton machine",

            "module": "rainmaker-tl",

            "locale": "en_IN"

        }

Use the below rest endpoints to push these data.





  • Only boundary localization messages are pushed at ULB level. Rest all are pushed at State Level.

  • -----------------------

Upsert: Update and Insert Localization

  • -------------------------

  • --------

This api, updates if code already exists or else inserts newly

  • ----------------

curl -X POST \  'https://APPLICATION-URL/localization/messages/v1/_upsert?tenantId=XYZ&locale=en_IN' \

  • H 'Content-Type: application/json' \

  • H 'Postman-Token: 39264728-2857-4cb4-825c-53612fce51c0' \

  • H 'cache-control: no-cache' \

  • d '{

  "RequestInfo": {

    "api_id": "org.egov.pgr",

    "ver": "1.0",

    "ts": "16-03-2017 12:09:14",

    "action": null,

    "did": "4354648646",

    "key": "xyz",

    "msg_id": "654654",

    "requester_id": "61",

    "authToken": "8850660e-7d35-4e8e-9d8b-9656c1a91d30"

  },

  "tenantId": "XYZ",

    "messages":[

    {

    "code": "TL_OWNER_NAME",

    "message": "OWNER",

    "module": "rainmaker-tl",

    "locale": "en_IN"

  }

  ]

}'

  • -----------------------Search Localization--------------------------

curl -X POST \  'https://APPLICATION-URL/localization/messages/v1/_search?locale=en_IN&tenantId=XYZ' \

  • H 'Content-Type: application/json' \

  • H 'Postman-Token: 8fae6bd4-17ae-4fa5-afc4-a692f2c74064' \

  • H 'cache-control: no-cache' \

  • d '{

    "RequestInfo": {

        "api_id": "org.egov.pgr",

        "ver": "1.0",

        "ts": "16-03-2017 12:09:14",

        "action": null,

        "did": "4354648646",

        "key": "xyz",

        "msg_id": "654654",

        "requester_id": "61",

        "authToken": "7315d713-773c-4282-97a1-b69b95895711"

    },

    "tenantId": "XYZ"

}'

Note : Product level localized messages are attached in this link. Localization_Messages  Use this json to load the labels and basic master data with the above endpoints.



Employee Creation :

HRMS Admin and SUPERUSER

  • "CreateNoValidate" api is used to create admin and superuser for the first time when no users exists. This endpoint is for User Creation only.

  • For Employee creation, Separate endpoint or UI used. HRMS admin is responsible for employee creation.

  • ----------------------

Create No Validate Api to create first time employees

  • ---------------------

curl -X POST \

 http://localhost:8088/user/users/_createnovalidate \

  • H ‘Content-Type: application/json’ \

  • H ‘Postman-Token: 3c8eb85e-877e-4b0a-a1db-60676fa5eb45’ \

  • H ‘cache-control: no-cache’

{

"RequestInfo": {

  "apiId": "ap.public",

  "ver": "1",

  "ts": null,

  "action": "POST",

  "did": null,

  "key": null,

  "msgId": "8c11c5ca-03bd-11e7-93ae-92361f002671",

  "userInfo": {

    "type" : "SYSTEM",

    "name" : "kiran",

    "id" : 32  },

  "authToken": "{{access_token}}"

},

 "user": {

          "id": 3,

          "userName": "EMP3_SUPER",

          "salutation": "MR",

          "name": "PB_SUPERUSER",

          "gender": "MALE",

          "mobileNumber": "9898989897",

          "emailId": "jamalbhai@maildrop.cc",

          "altContactNumber": "",

          "password": "PBEGOV123",

          "pan": "AITGC5624P",

          "aadhaarNumber": "96a70",

          "permanentAddress": "Dawakhana",

          "permanentCity": "Kaikoo",

          "permanentPinCode": "111111",

          "correspondenceAddress": "correAddress",

          "correspondenceCity": "banglore",

          "correspondencePinCode": "1234",

          "addresses": [

              {

                  "pinCode": "1234",

                  "city": "banglore",

                  "address": "correAddress",

                  "type": "CORRESPONDENCE",

                  "id": 1,

                  "tenantId": "pb.citya",

                  "userId": 1,

                  "addressType": "CORRESPONDENCE",

                  "lastModifiedDate": null,

                  "lastModifiedBy": null

              },

              {

                  "pinCode": "111111",

                  "city": "Kaikoo",

                  "address": "Dawakhana",

                  "type": "PERMANENT",

                  "id": 2,

                  "tenantId": "pb.citya",

                  "userId": 1,

                  "addressType": "PERMANENT",

                  "lastModifiedDate": null,

                  "lastModifiedBy": null

              }

          ],

          "active": true,

          "locale": "string",

          "type": "EMPLOYEE",

          "accountLocked": false,

          "accountLockedDate": 0,

          "fatherOrHusbandName": "Hamaal",

          "signature": "",

          "bloodGroup": "O+",

          "photo": "photo1",

          "identificationMark": null,

          "createdBy": 32,

          "lastModifiedBy": 32,

          "tenantId": "pb.citya",

          "roles": [

              {

                  "code": "SUPERUSER",

                  "tenantId": "pb"

              }

          ],

          "uuid": "1fae1f10-f398-4d05-83f5-7457a946aef9",

          "createdDate": "22-05-2019 12:49:07",

          "lastModifiedDate": "22-05-2019 12:49:07",

          "dob": "03/08/1971",

          "pwdExpiryDate": "20-08-2020 12:49:07"

      }

}



Online Payment Gateway Integration :

Refer below Link for documentation: https://github.com/egovernments/core-services/blob/master/egov-pg-service/Readme.md



SMS Gateway Integration :

  • Set the below configurations in the application.properties file of egov-notification-sms service 

  • Below configuration holds service provider details.

  • ---------------------------

application.properties

  • ---------------------------------------

sms.enabled=true

sms.provider.url=http://placeholder

sms.sender.username=placeholder

sms.sender.password=placeholder

sms.sender=placeholder

#Parameter names are kept compatible with sms service provider(SMSCountry gateway). 

sms.sender.req.param.name=sid

sms.sender.username.req.param.name=user

sms.sender.password.req.param.name=passwd

sms.destination.mobile.req.param.name=mobilenumber

sms.message.req.param.name=message

sms.extra.req.params=smsservicetype=singlemsg

sms.error.codes=401,403,404,405,406,407,408,409,410,411,412,413,414

#SMS priority settings if available

sms.priority.enabled=false

sms.priority.param.name=

sms.high.priority.param.value=

sms.medium.priority.param.value=

sms.low.priority.param.value=



sms.verify.response = false

sms.verify.responseContains=Message submitted successfully

sms.verify.ssl = false

sms.url.dont_encode_url = true



# POST or GET requests

sms.sender.requestType=POST



  • Add the below environment variables to your egov-user deployment. This will enable your login without OTP. 

      CITIZEN_LOGIN_PASSWORD_OTP_FIXED_VALUE:       123456

      CITIZEN_LOGIN_PASSWORD_OTP_FIXED_ENABLED:     true





Implementation Kit Usage Steps : 



Prerequisites:

https://github.com/egovernments/punjab-implementation-kit





Steps to generate Boundary MDMS and Localization data  json :

  • Data file format for a ULB Boundary_Data_template Create a data file in this format with the boundary details.

  • Copy the clean data file into “Punjab-implementation-kit/Source” folder of the git cloned repository.

    • Rename the data file as <ULB Name> in all lower case. Ex: sonum.xlsx



  • Update the script ‘Local.py’  with the ULB name. Here the name of the ULB should be written in this format: Sonum

Ex : [ex: config.CITY_NAME = os.getenv("CITY", None) or "Sonum"]



 

  • Run the script “new_revenue_boundary_gen.py”  

    • The output of the script will show a JSON object of the revenue boundaries. Collect the json and push it into MDMS  (/pb/citya/egov-location)  

 

  • Then Run "process_boundary_localization.py"  for boundary localization messages

    • The output of the script will show a JSON object of the localization message for the boundary data generated. Collect the json and push the message using localization endpoints mentioned above.