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 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.
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);
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 | |
---|---|---|---|
1 |
|
| 954 |
2 |
|
| 2043 |
3 |
|
| 2044 |
4 |
|
| 2053 |
5 |
|
| 1429 |
6 |
|
| 2061 |
7 |
|
| 2380 |