Send Back Flow - Edit

Edit Trade License

This feature allows the user to edit the application already created under their mobile number. After verifying employee can send the application back to citizen with remarks of any changes that's need to be done, which can be edited by the user using this flow.

edit application:

In the Application details page, on the employee side, if the application is marked with “Send Back to Citizen”, the edit option will appear dynamically at the end of the application details page, which user can navigate through my applications.

After this, On clicking the button, user can edit the trade license details by going though the create flow again, first it will land on the Summary page, where for each section “change” button is there, on clicking on it, user will be redirected to the particular content, the only exception here will be the values will be pre-populated from the License object received from Trade License Search API, on completing the flow, Update API will be called and License application will get successfully updated.

Acknowledgement Screen:

 

Technical Implementation Details:

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

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

here the main code consist of the function which results in transforming the License object received in Search API to the object structure which is suitable for citizen Apply flow (owner details, units, accessories etc), as the user need to go through Apply flow again with pre-populated details and update the value of any accordingly. it also consist of the routing for the pages in the Apply flow.

getTradeEditDetails() function is being used so that the License object which is received from the Trade Search API, is converted to the Apply flow relevant structure so that the values can be pre-populated for the user convenience, on completing the flow, application is updated. Link for the same can be found below:

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

User can delete and add as many as accessory or units it needs but there should be at-least one unit to complete the application, to add new unit or accessory “Add” button is used which is located at the end of the page. A new array is formed with all the updated details or with the old unit/accessory, when the flow is completed, this new array is then compared with the old array of accessory and units, and new resulting array object is formed for the request body, you can find the respective code in the following method : gettradeupdateaccessories & gettradeupdateunits. this can be found in the below link https://github.com/egovernments/digit-ui-internals/blob/main/packages/modules/tl/src/utils/index.js

Similarly for owners the method which is used to form the new request param array is gettradeownerarray

It is similar as accessory and Units, only difference is in UI, user can’t select multiple owner and only add one owner, it needs to either add more than one owner or select single owner as ownership category and proceed. After the successful update the application next action will be “Pending for document verification” as their is update in the data.

On completing the flow, the same object structure which was being used earlier in the flow, gets changed into the request body structure for the update API: /tl-services/v1/_update, for this, the method which gets used is declared inside Utils folder. Method name: convertToResubmitTrade and it can be found in the below link:

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 trade is same as the Apply for Trade License. Please refer the link for detailed MDMS information.

Trade License - Apply Flow

 

Localization :

For Edit 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.