FSM v1.3 Citizen: New Desludging Application Create Flow

Objective

To provide user facilities to add new Desludging applications, Zero pricing & advance applications viewing the application details currently on their number. It also allows the user to make payments and rate the application once the application is marked as completed.

Citizen FSM Card

 

Citizen Apply for Emptying of Septic Tank/ Pit:

Users can add new desludging application using Apply for Emptying of septic Tank/Pit from the FSM card, and User can add all the valid information throughout the flow in the check page and also if needed to change/update any data can do that by clicking on the change option in the review your application page, it will credited them to the said page which data needs to be changes and then the whole flow needs to be repeated again in order to submit the application.

 

Applying for Emptying septic tank/pit creating flow page

New Desludging Application for Zero Pricing:

  • fsm-calculator/v1/billingSlab/_search

  • fsm-calculator/v1/_advancebalancecalculate

Case 1: If the citizen has selected slum:

  • Selecting a slum name from dropdown, vehicle capacity & no of trips api is called fsm-calculator/v1/billingSlab/_search & fsm-calculator/v1/_advancebalancecalculate

Case 2: If the citizen has selected property type and property sub-type and the status is active

Selecting a property type and property sub-type API is called

  • fsm-calculator/v1/billingSlab/_search

  • fsm-calculator/v1/_advancebalancecalculate

 

When a user clicks on Submit and all the validations on frontend are successful then a create post request is sent the this API endpoint “/fsm/v1/_create?" with an fsm Object in the body(payload) which contains all the required details to apply for the amendment and a corresponding success/failure acknowledgement screen is shown on the screen.

The payload sent to the "fsm/v1/_create" endpoint looks like the following for the zero pricing:

{ "citizen": { "gender": "MALE" }, "tenantId": "pb.amritsar", "additionalDetails": { "totalAmount": 0, "tripAmount": 0 }, "propertyUsage": "RESIDENTIAL.APARTMENT", "address": { "tenantId": "pb.amritsar", "additionalDetails": null, "slumName": "SL0001", "city": "Amritsar", "locality": { "code": "SUN04", "name": "Ajit Nagar - Area1" }, "geoLocation": { "additionalDetails": {} } }, "pitDetail": { "additionalDetails": { "fileStoreId": {} } }, "source": "ONLINE", "paymentPreference": null, "noOfTrips": 1, "vehicleCapacity": 1000, "advanceAmount": null }

 

New Desludging Application for Advance Pricing:

  • fsm-calculator/v1/billingSlab/_search

  • fsm-calculator/v1/_advancebalancecalculate

Case 1: If the citizen has selected slum equals to No:

  • Selecting a slum name from dropdown, vehicle capacity & no of trips api is called fsm-calculator/v1/billingSlab/_search & fsm-calculator/v1/_advancebalancecalculate

Case 2: If the citizen has selected property type and property sub-type and the status is active :

Selecting a property type and property sub-type api is called

  • fsm-calculator/v1/billingSlab/_search

  • fsm-calculator/v1/_advancebalancecalculate

When a user clicks on Payment Preference to Pay Now a advance collection API endpoint /fsm-calculator/v1/_advanceBalanceCalculate was called to fetch the advance balance amount.

The headers sent to the "/fsm-calculator/v1/_advanceBalanceCalculate" endpoint looks like the following:

https://qa.digit.org/fsm-calculator/v1/_advanceBalanceCalculate?tenantId=pb.amritsar&totalTripAmount=3000

here is an example how the TotaltripAmount is being calculated

const capacity = formData?.selectTripNo?.vehicleCapacity.capacity; const { slum: slumDetails } = formData.address; const slum = slumDetails ? "YES" : "NO"; const billingDetails = await Digit.FSMService.billingSlabSearch(tenantId, { propertyType: formData?.subtype?.code, capacity, slum, }); const billSlab = billingDetails?.billingSlab?.length && billingDetails?.billingSlab[0]; Digit.SessionStorage.set("amount_per_trip", billSlab.price); if (billSlab?.price) { let totaltripAmount = billSlab.price * formData?.selectTripNo?.tripNo?.code; const { advanceAmount: advanceBalanceAmount } = await Digit.FSMService.advanceBalanceCalculate(tenantId, { totalTripAmount: totaltripAmount, }); setMinAmount(advanceBalanceAmount); setTotalAmount(totaltripAmount);

File path: https://github.com/egovernments/DIGIT-Dev/blob/develop/frontend/micro-ui/web/micro-ui-internals/packages/modules/fsm/src/pageComponents/SelectPaymentPreference.js

When a user clicks on Submit and all the validations on frontend are successful then a create post request is sent the this API endpoint “/fsm/v1/_create?" with an fsm Object in the body(payload) which contains all the required details to apply for the new desuldging application and a corresponding success/failure acknowledgement screen is shown on the screen.

The payload sent to the "fsm/v1/_create" endpoint looks like the following:

Role Action Mapping:

 

 

API

ROLES

ACTION ID

 

 

API

ROLES

ACTION ID

1

/egov-mdms-service/v1/_search

LOA_CREATOR,WO_CREATOR,AE_CREATOR,WORKS_MASTER_CREATOR,UC_EMP,SUPERUSER

954

2

/fsm/v1/_create

FSM_CREATOR_EMP,CITIZEN

2043

3

/fsm/v1/_search

FSM_CREATOR_EMP,CITIZEN,FSM_EDITOR_EMP,FSM_VIEW_EMP,FSM_ADMIN,FSM_DSO,FSM_DRIVER,FSM_EMP_FSTPO,FSM_COLLECTOR

2044

4

/vendor/v1/_search

FSM_CREATOR_EMP,FSM_ADMIN,FSM_DSO,FSM_EDITOR_EMP,FSM_VIEW_EMP,FSM_EMP_FSTPO,CITIZEN

2053

5

/egov-location/location/v11/boundarys/_search

SUPERUSER,DE_CREATOR,CITIZEN,GRO,CSR,EMPLOYEE,PGR-ADMIN,TL_APPROVER,TL_CEMP

1429

6

/fsm-calculator/v1/billingSlab/_search

FSM_CREATOR_EMP,FSM_EDITOR_EMP,FSM_ADMIN,FSM_DSO,CITIZEN,

2061

7

/fsm-calculator/v1/_advanceBalanceCalculate

CITIZEN,FSM_CREATOR_EMP,FSM_EDITOR_EMP

2380