Trade License Renewal UI Flow

Renewal Flow

This feature allows the user to renew any trade license applications, which either has been expired or had to be renewed for current financial year (Approved and Paid), it also had integration with the payment component, in order to complete the flow all together for renewal.

Renewal can be two types:

  • DIRECT RENEWAL

  • EDIT RENEWAL

Renewal List

Direct Renewal

Edit Renewal

If the user before renewal need to update the application, they can do so by clicking on the change button on the summary screen, this will tell that the flow has been changed from direct to edit renewal, and user will need to follow the same apply flow in order to complete the edit part of it. the values from the application will be pre-populated in the respective screens, to get the details about the edit flow,one can refer this link. Send Back Flow - Edit.

Once the user click on submit button it will change the current action of the application to pending for document verification as the data has been updated.

Technical Implementation Details

Renewal Trade main index can be found in the below given link:

https://github.com/egovernments/digit-ui-internals/blob/main/packages/modules/tl/src/pages/citizen/Renewal/index.js

in this we are calling the trade license search API, In order to get all the application, through which the sorting is happened to classify which application are eligible for renewal for the current financial year.

the hook which has been used for the API is:

const { isLoading, isError, error, data } = Digit.Hooks.tl.useTradeLicenseSearch({ filters: filter1 }, {});
  if (isLoading) {
    return <Loader />;
  }

The data from here then are sorted into application which doesnโ€™t have any open renewal application for current financial year or which has a status of approved or expired. the significant method to get the renewal list of application is mentioned below:

applicationsList.filter((response)=>response.licenseNumber).map((ob)=>{
    if(applications[ob.licenseNumber]){
    if(applications[ob.licenseNumber].applicationDate<ob.applicationDate)
    applications[ob.licenseNumber]=ob
    }
    else
    applications[ob.licenseNumber]=ob;    
    })

From here the Trade License List Component has been called which displays the list of the renewal application.

https://github.com/egovernments/digit-ui-internals/blob/main/packages/modules/tl/src/pages/citizen/Renewal/TradeLicenseList.js

The main functionality of converting the License Object received from the API to the object structure for formdata for apply flow , following is done at the similar way as the edit trade, and the same method is being used to convert the response object, to know more details please refer to Send Back Flow - Edit

Once the user has completed the flow as required or clicked the submit button directly, the method convertToEditTrade is being called, which re arranges the data for the request body for the update API /tl-services/v1/_update.

If its a direct renewal only one update API is being called which updates the financial year only.

but if its a edit renewal, two updated API is called after the first API successful call the application status gets changed to Initiated but after the second API call its changed to applied. with next action as pending for document verification.

the code for these can be found in utils folder index please refer the below link for the same:

https://github.com/egovernments/digit-ui-internals/blob/main/packages/modules/tl/src/utils/index.js

MDMS

MDMS data which is being used here is same as the Apply flow only, as the flow structure used for edit renew trade is same as the Apply for Trade License. Please refer the link for detailed MDMS information.

Trade License - Apply Flow

Localization

For Renew Trade also, the Localization keys are being added in the โ€˜rainmaker-tlโ€™ locale module. To change, update or adding of any new localization key will be done in the same locale module only.

Last updated

โ€‹All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.