Trade License Service

Overview

This service is used to issue license to user after verification. The service is designed in such way that it can be used to serve different type of licenses. Currently used to issue trade licenses, perform stakeholder registration and issue lock down pass. The service is integrated with workflow where we can define the steps for approval of the application. Once the application is approved the license is generated.

Pre-requisites

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

  • Java 8

  • Kafka server is up and running

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

  • PSQL server is running  and database is created

Key Functionalities

  • Used for license generations in trade licenses, stakeholder registration and issue lock down pass

  • In stakeholder registration, give roles to applicant on successful application, to access Building Plan Approval services.

  • Generate application number and license number

  • Support workflow

  • Provide notification on various status changes for an application

Interaction Diagram

 

Deployment Details

  1. Add mdms configs required for tradelicense and bpa stake holder registration and restart mdms service

  2. Deploy the latest version of tl-services service

  3. Add tl-service persister yaml path in persister configuration and restart persister service

  4. Add Role-Action mapping for API’s

  5. Create businessService (workflow configuration) according to trade license and stakeholder registration

  6. Add tl-service indexer yaml path in indexer service configuration and restart indexer service

Configuration Details

Following are the properties in application.properties file in trade license service which are configurable.

Property

Value

Remarks

Property

Value

Remarks

egov.idgen.tl.applicationNum.format

PB-TL-[cy:yyyy-MM-dd]-[SEQ_EG_TL_APL]

The format of the TL application number

egov.idgen.tl.licensenumber.format

PB-TL-[cy:yyyy-MM-dd]-[SEQ_EG_PT_LN]

The format of the TL license number

egov.idgen.bpa.applicationNum.format

PB-SK-[cy:yyyy-MM-dd]-[SEQ_EG_TL_APL]

The format of the Stake holder application number

egov.idgen.bpa.licensenumber.format

PB-SK-[cy:yyyy-MM-dd]-[SEQ_EG_PT_LN]

The format of the Stake holder license number

egov.tl.max.limit

100

Max number of records to be returned

citizen.allowed.search.params

tenantId,applicationNumber,limit,offset,licenseNumbers

The search parameters on which citizen can search

employee.allowed.search.params

tenantId,applicationNumber,applicationType,status,mobileNumber,fromDate,toDate,licenseNumbers,oldLicenseNumber,limit,offset

The search parameters on which employee can search

persister.save.tradelicense.topic

save-tl-tradelicense

The name of kafka topic on which create request are published

persister.update.tradelicense.topic

update-tl-tradelicense

The name of kafka topic on which update request are published

persister.update.tradelicense.workflow.topic

update-tl-workflow

The name of kafka topic on which status update request are published


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

{ "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.amritsar", "businessService": "NewTL", "business": "tl-services", "businessServiceSla": 172800000, "states": [ { "tenantId": "pb.amritsar", "sla": null, "state": null, "applicationStatus": null, "docUploadRequired": false, "isStartState": true, "isTerminateState": false, "isStateUpdatable": true, "actions": [ { "tenantId": "pb.amritsar", "action": "INITIATE", "nextState": "INITIATED", "roles": [ "CITIZEN", "TL_CEMP" ] } ] }, { "tenantId": "pb.amritsar", "sla": null, "state": "INITIATED", "applicationStatus": "INITIATED", "docUploadRequired": false, "isStartState": true, "isTerminateState": false, "isStateUpdatable": true, "actions": [ { "tenantId": "pb.amritsar", "action": "APPLY", "nextState": "APPLIED", "roles": [ "CITIZEN", "TL_CEMP" ] }, { "tenantId": "pb.amritsar", "action": "INITIATE", "nextState": "INITIATED", "roles": [ "CITIZEN", "TL_CEMP" ] } ] }, { "tenantId": "pb.amritsar", "sla": null, "state": "APPLIED", "applicationStatus": "APPLIED", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": true, "actions": [ { "tenantId": "pb.amritsar", "action": "FORWARD", "nextState": "FIELDINSPECTION", "roles": [ "TL_DOC_VERIFIER" ] }, { "tenantId": "pb.amritsar", "action": "REJECT", "nextState": "REJECTED", "roles": [ "TL_DOC_VERIFIER" ] } ] }, { "tenantId": "pb.amritsar", "sla": null, "state": "REJECTED", "applicationStatus": "REJECTED", "docUploadRequired": false, "isStartState": false, "isTerminateState": true, "isStateUpdatable": false, "actions": null }, { "tenantId": "pb.amritsar", "sla": 86400000, "state": "FIELDINSPECTION", "applicationStatus": "FIELDINSPECTION", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": true, "actions": [ { "tenantId": "pb.amritsar", "action": "SENDBACKTOCITIZEN", "nextState": "CITIZENACTIONREQUIRED", "roles": [ "TL_FIELD_INSPECTOR" ] }, { "tenantId": "pb.amritsar", "action": "FORWARD", "nextState": "PENDINGAPPROVAL", "roles": [ "TL_FIELD_INSPECTOR" ] }, { "tenantId": "pb.amritsar", "action": "REJECT", "nextState": "REJECTED", "roles": [ "TL_FIELD_INSPECTOR" ] }, { "tenantId": "pb.amritsar", "action": "SENDBACK", "nextState": "APPLIED", "roles": [ "TL_FIELD_INSPECTOR" ] } ] }, { "tenantId": "pb.amritsar", "sla": 43200000, "state": "PENDINGAPPROVAL", "applicationStatus": "PENDINGAPPROVAL", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": false, "actions": [ { "tenantId": "pb.amritsar", "action": "SENDBACK", "nextState": "FIELDINSPECTION", "roles": [ "TL_APPROVER" ] }, { "tenantId": "pb.amritsar", "action": "APPROVE", "nextState": "PENDINGPAYMENT", "roles": [ "TL_APPROVER" ] }, { "tenantId": "pb.amritsar", "action": "REJECT", "nextState": "REJECTED", "roles": [ "TL_APPROVER" ] } ] }, { "tenantId": "pb.amritsar", "sla": 43200000, "state": "PENDINGPAYMENT", "applicationStatus": "PENDINGPAYMENT", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": false, "actions": [ { "tenantId": "pb.amritsar", "action": "ADHOC", "nextState": "PENDINGPAYMENT", "roles": [ "TL_CEMP" ] }, { "tenantId": "pb.amritsar", "action": "PAY", "nextState": "APPROVED", "roles": [ "CITIZEN", "TL_CEMP", "SYSTEM_PAYMENT" ] } ] }, { "tenantId": "pb.amritsar", "sla": null, "state": "APPROVED", "applicationStatus": "APPROVED", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": false, "actions": [ { "tenantId": "pb.amritsar", "action": "EXPIRE", "nextState": "EXPIRED", "roles": [ "SYSTEM" ] }, { "tenantId": "pb.amritsar", "action": "CANCEL", "nextState": "CANCELLED", "roles": [ "TL_APPROVER" ] } ] }, { "tenantId": "pb.amritsar", "sla": null, "state": "CANCELLED", "applicationStatus": "CANCELLED", "docUploadRequired": false, "isStartState": false, "isTerminateState": true, "isStateUpdatable": false, "actions": null }, { "tenantId": "pb.amritsar", "sla": null, "state": "CITIZENACTIONREQUIRED", "applicationStatus": "CITIZENACTIONREQUIRED", "docUploadRequired": false, "isStartState": false, "isTerminateState": false, "isStateUpdatable": true, "actions": [ { "tenantId": "pb.amritsar", "action": "RESUBMIT", "nextState": "FIELDINSPECTION", "roles": [ "TL_CEMP" ] }, { "tenantId": "pb.amritsar", "action": "FORWARD", "nextState": "FIELDINSPECTION", "roles": [ "CITIZEN", "TL_CEMP" ] } ] }, { "tenantId": "pb.amritsar", "sla": null, "state": "EXPIRED", "applicationStatus": "EXPIRED", "docUploadRequired": false, "isStartState": false, "isTerminateState": true, "isStateUpdatable": false, "actions": null } ] } ] }


For renewal application , there are 2 new types. 'Edit Renewal' and 'Direct Renewal' . Edit (EDITRENEWAL) flow will follow the same workflow as normal Trade License. Direct (DIRECTRENEWAL) Renewal will follow a new workflow.

Hence 2 new Business service configs are pushed for each flow respectively.

EDITRENEWAL : EDITRENEWAL Config

DIRECTRENEWAL : DIRECTRENEWAL Config

Integration

 

Integration Scope

The trade-license service is currently used to issue trade licenses, perform stakeholder registration and issue lock down pass.

Integration Benefits

  • Provide backend support for the different license registration process.

  • Mseva and SMS notifications on application status changes.

  • Elastic search index for creating visualizations and Dashboards.

  • Bpa Stakeholder registration provides new roles to the user to access Building Plan Approval system.

  • Supports workflow which is configurable

Steps to Integration

  1. To integrate, host of tl-services service should be overwritten in helm chart.

  2. {servicename}/_create/ _create should be added as the create endpoint for creating any license in the system

  3. {servicename}/_search/ _search should be added as the search endpoint .This method handles all requests to search existing records depending on different search criteria

  4. {servicename}/_update/ _update should be added as the update endpoint. This method is used to update fields in existing records or to update status of application based on workflow.

Reference Docs

Doc Links

Title 

Link

Billing Slabs

https://digit-discuss.atlassian.net/l/c/Z7U7p0Q8

Local Setup

LOCALSETUP.md

API Swagger Documentation (Trade License)

Swagger Documentation TL

API Swagger Documentation (Stakeholder registration)

 

BPA StakeHolder Registration release Doc

https://digit-discuss.atlassian.net/l/c/rPiHmMP7

API List

In all below endpoints if servicename is BPAREG it is treated as stakeholder registration application and if it is TLor if it is absent then the application is treated as tradelicense application.

Stake holder registration APIs:- https://www.getpostman.com/collections/d18b79ccfb69ee8bb526

Trade-License APIs:- https://www.getpostman.com/collections/99f98723c45f97024831

Title 

Link

{servicename}/_create, _create

This API is used to create an application for the license in the system. Whenever an application is created a application number is generated and assigned to the application for future reference.

{servicename}/_search, /_search

This API is used to search the applications in the system based on various search parameters like mobile number, application number,status etc.

{servicename}/_update, _update

The _update API is used to update the application information or to forward the application from one state to another.

In case of stakeholder registration if application reaches last stage the role depending on the license type is given to the user.

{servicename}/{jobname}/_batch, /_batch

Searches trade licenses which are expiring and sends reminder sms to owner's of the licenses