All pages
Powered by GitBook
1 of 3

Loading...

Loading...

Loading...

Services

FSM Service

Learn how to setup and configure FSM service

Overview

Faecal sludge management (FSM) is a system that enables citizens to raise a request for septic tank cleaning with their urban local bodies (ULBs) directly or by reaching out to the ULB counter. Citizens can track the application, make a payment for the charges, and rate the service. This document contains details on how to set up FSM, and describes the functionalities it provides. It contains the details about the feature enhancements being released as part of FSM v1.3.

As part of the FSM v1.4, a new worker registry concept is being introduced. The creation of a worker, updation of details, searching and tagging a worker for different operations on sanitation programmes will be covered. While assigning vehicle for the application, we have the functionalities which will provide the ability to assign multiple sanitation workers for the application.

Plant User Mapping

The fsm service enables mapping plant codes to FSTP employee, ensuring that each is only authorised to manage to their account, enhancing control and accountability. In the mapping process need to check below mention things

  • PlantCode : Unique plant code which is configured in the mdms

  • employeeUuid : Unique user id of the employee which have the type of fsm-fstp.

Pre-requisites

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

  • Java 8

  • Kafka server is up and running

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

  • PSQL server is running and a database is created to store FSM Application data

Key Functionalities

  • Citizens can file, track, and rate the application for cleaning the septic tank.

  • A ULB employee can file application for cleaning the septic tank on behalf of a citizen.

  • A ULB employee can assign a DSO to the given application with a possible service date.

  • A DSO can accept or reject the application.

- FSM_ADVANCE_PAY_SERVICE and FSM_ZERO_PAY_SERVICE .

  • Advance pay service: The number of trips is made editable (increase or decrease based on the requirement), and price calculation will be now based on number of trips entered by the DSO or ULB.

  • Allowed to pay part payment while creating the application.

  • ULB and DSO are allowed to decrease the number of trips if not required and if full payment is not done.

Feature Enhancement

As part of the FSM v1.4, Creation of fstp plant user mapping configuration we moved PlantInfo from mdms v1 to mdms v2 . For the changes follow below steps.

For a new environment these changes are required.

  1. path:- deploy-as-code/helm/charts/sanitation/fsm/values.yaml -

  2. Create plantInfo in PQM.Plant schema .

  3. Use the existing collection to create,update and search

Kafka Topic Details

Description
Topic Name

Users

  • User with userType employee and role FSM_CREATOR_EMP role.

Integration

Idgen changes -

Integration Scope

FSM can be integrated with any ULB or system which wants to track the FSM application. The organisations can customise the workflow depending on their product requirements.

Integration Benefits

  • Easy tracking and resolution of the FSM application.

  • Configurable workflow according to client requirement.

Steps

  1. Citizen/ULB employee can file application request using the /fsm/v1/_create.

  2. An organisation or system can search the FSM Applications using /fsm/v1/_searchendpoint.

  3. Once the application is filed, the organisation or system can call /fsm/v1/_update endpoint to move the application further in the workflow until it gets resolved.

Inbox API

  • Introduced new inbox service to get the FSM applications in registered ULB employee inbox. With this, a ULB employee can track the application or perform the actions based on employee role.

  • ULB employees can also apply the filter to check the particular state or applications or any other filter as required.

Changes for FSMv1.4

Inbox V2 API

  • Inbox v2 provide same feature what ever have in inbox v1 .

  • Introduced new inbox service to get the FSM applications in registered ULB employee inbox. With this, a ULB employee can track the application or perform the actions based on employee role.

  • ULB employees can also apply the filter to check the particular state or applications or any other filter as required.

Integration

  • Add the mdms changes in the given path and restart the mdms service .

Path: data/pg/inbox-v2/InboxConfiguration.json

  • Add the indexer file in the given path and restart the services.

Path: sanitation/egov-indexer/fsm-inbox-indexer.yml

File: file which need to add

FSM Apply As A Service

Currently, we provide FSM as an adhoc service.To avoid multiple times, a user has to create the FSM request every time. In the system itself after some days, we will create the same FSM application and if the user wants a service, he/she will pay the amount.

MDMS Changes

As mentioned above, we need to define the time parameter in order to create a periodic application. For that, we added the periodic service master where we configure the time limit and whether the schedular is enabled or not. Find the configuration and location below

cronjob will read the cron job’s configured in the cronjobapiconfig.json, and based on the schedular time, it will call the API which is configured. Find the configuration and file location below:

We are using the fsm/v1/_schedular API. This API will read the master data for each tenant and based on the time limit configured for that tenant, it will get all eligible applications and create periodic applications for those FSM applications.

data/pb/FSM/AdvancePayment.json

master-config.json

Infra changes

We added a new chart called mdms-read-cronjob. Find the chart location below:

Interaction Diagram

1. Advance Amount Workflow

2. Zero Price Application Workflow

Sequence Diagram

Reference Docs

Doc Links

API List

test

(Optional) Indexer config for FSM is added in egov-indexer yaml paths to index the generated data. An index is required for data visualisation in kibana or in DSS.

  • Following services should be up and running:

    • egov-user

    • egov-workflow-v2

    • egov-perister

    • egov-localisation

    • egov-notification-sms

    • egov-mdms

    • egov-idgen

    • egov-url-shortening

    • vehicle

    • vendor

    • fsm-calculator

    • billing-service

    • collection-services

    • individual-services

  • A DSO or a ULB employee can complete the FSM application after cleaning the septic tank.

  • The FSM admin in a ULB can cancel the application at any stage before completing the application.

  • A ULB employee or an admin can view the audit log of the given application.

  • Capture citizen gender information if not present or pre-populate the gender information when a citizen is creating the FSM application.

  • Add citizen's choice for payment.

  • Introducing pre-pay and post-pay service.

  • Post-pay service: Workflow changes (Desludging application and vehicle trip).

  • Post-pay service: Employee flow enhancements.

  • Add payment selection for DSO.

  • Post-pay service: Number of trips is editable, and price calculation will be now based on the number of trips entered by the DSO.

  • Capture DSO and FSTPO gender.

  • Show citizen gender on FSM DSS.

  • Select vehicle capacity instead of vehicle make.

  • Citizen Notifications | Payment Options | Timeline Enhancements.

  • FSTPO vehicle log inbox enhancements.

  • FSTPO can decline the vehicle trip.

  • Add owner attribute for vehicles.

  • Add ULB contact details in the FSM application flow.

  • DSO can edit pit and property usage details.

  • Show vehicle trip status in employee inbox along with the desludging application.

  • Unrestricted assignment of service requests to a single vehicle.

  • Vehicle logging at FSTP decoupled from the FSM module.

  • Photo and attachment view in the application of the ULB employee UI.

  • Dashboard enhancement.

  • Advance pay service: Employee flow enhancements.

  • Introduced two new workflows in the system:

  • ULB and DSO are allowed to increase or decrease the number of trips n number of times.
  • With the updated number of trips, an updated bill will be generated.

  • Delink the payment from DSO in progress state.

  • Zero pay service: Employee flow enhancements.

  • Zero pay service: System now skips the collection, and will not generate the demand for zero price application.

  • Demand generation process: Generating demand every time the trip is updated.

  • Demand generation process: Added validation not to complete the application from ULB side before completing all payment.

  • Enhancement of FSM receipt.

  • Enhancement of assigning sanitation-worker to fsm application

  • Enhancement of assigning driver to fsm application

  • Update plant user mapping

    update-plant-map-application

    Receipts get pushed to this topic

    egov.collection.payment-create

    SMS Notification topic

    egov.core.notification.sms

    Event (In-app) Notification topic

    persist-user-events-async

    Can view FSM application.

    Through HRMS with role.

    FSM Admin

    FSM_ADMIN

    • Can cancel the application at any stage of the workflow.

    Through HRMS with role.

    DSO

    FSM_DSO

    • Can accept/reject the assigned application.

    • can complete the FSM application.

    Through vendor service, use the create DSO Request from .

    FSTP Operator

    FSM_EMP_FSTPO

    • Can mark the vehicle trip as disposed. Not FSM service user.

    Through HRMS with role.

    Collector

    FSM_COLLECTOR

    • Can collect the payment amount for the application based on demand.

    Through HRMS with role.

    FSM Report Viewer

    FSM_REPORT_VIEWER

    Can view FSM reports

    Through HRMS with role.

    FSM Driver

    FSM_DRIVER

    Driver role for FSM.

    Through HRMS with role.

    NEEDS TO BE UPDATED

    SMS Notification Technical Document

    NEEDS TO BE UPDATED

    HRMS Technical Document

    NEEDS TO BE UPDATED

    API Contract

    Postman Collection

    False

    /fsm/v1/_plainsearch

    False

    /fsm/plantmap/v1/_create

    False

    /fsm/plantmap/v1/_update

    False

    /fsm/plantmap/v1/_search

    False

    /inbox/v1/_search

    True

    /fsm/v1/_schedular

    False

    /inbox/v2/_search

    False

    Save new FSM application

    save-fsm-application

    Update FSM application

    update-fsm-application

    Update FSM application workflow

    update-fsm-workflow-application

    Update vehicle Trip Details

    update-vehicle-trip-Details

    Save plant user mapping

    save-plant-map-application

    User

    Role

    Description

    How to create

    FSM Creator

    FSM_CREATOR_EMP

    • Can create FSM application on behalf of a citizen.

    Through HRMS with role.

    FSM Editor

    FSM_EDITOR_EMP

    • Can edit the application created by a citizen for demand generation.

    • Assign/re-assign DSO.

    • Complete the application.

    Through HRMS with role.

    FSM Viewer

    Title

    Link

    Workflow Technical Document

    Workflow Service

    User Technical Document

    User Service

    MDMS Technical Document

    NEEDS TO BE UPDATED

    IDGen Technical Document

    NEEDS TO BE UPDATED

    Localisation Technical Document

    NEEDS TO BE UPDATED

    Title

    Link

    Deprecation Status

    /fsm/v1/_create

    https://api.postman.com/collections/23418568-946a158e-9391-44b2-9d2b-48f30ea8cd63?access_key=PMAT-01GSPRPC338T9RR0GAKTRCRDP8

    False

    /fsm/v1/_update

    https://api.postman.com/collections/23418568-946a158e-9391-44b2-9d2b-48f30ea8cd63?access_key=PMAT-01GSPRPC338T9RR0GAKTRCRDP8

    False

    /fsm/v1/_search

    https://www.getpostman.com/collections/a51486db12539a2aa597

    False

    /fsm/v1/_audit

    link
    Link
    click here
    SM-499 : mdms file for advanceBalance and cancellationfee · egovernments/egov-mdms-data@3b3233e
    Update AdvancePayment.json · egovernments/egov-mdms-data@a864a90
    Update CancellationFee.json · egovernments/egov-mdms-data@3a614e5
    SM-499 adding advancepayment and cancellationfee · egovernments/egov-mdms-data@c4efb2e
    https://github.com/egovernments/DIGIT-DevOps/tree/master/deploy-as-code/helm/charts/utilities/mdms-read-cronjob

    FSM_VIEW_EMP

    Persister Technical Document

     {
          "module": "fsm",
          "index": "fsm-application",
          "allowedSearchCriteria": [
            {
              "name": "tenantId",
              "path": "Data.tenantId.keyword",
              "isMandatory": false,
              "operator": "EQUAL"
            },
            {
              "name": "status",
              "path": "Data.currentProcessInstance.state.uuid.keyword",
              "isMandatory": false
            },
            {
              "name": "mobileNumber",
              "path": "Data.mobileNumber.keyword",
              "isMandatory": false
            },
            {
              "name": "locality",
              "path": "Data.locality.keyword",
              "isMandatory": false
            },
            {
              "name": "assignee",
              "path": "Data.currentProcessInstance.assignes.uuid.keyword",
              "isMandatory": false
            },
            {
              "name": "applicationNos",
              "path": "Data.applicationNo.keyword",
              "isMandatory": false,
              "operator": "WILDCARD"
            },
            {
              "name": "fromDate",
              "path": "Data.auditDetails.createdTime",
              "isMandatory": false,
              "operator": "GTE"
            },
            {
              "name": "toDate",
              "path": "Data.auditDetails.createdTime",
              "isMandatory": false,
              "operator": "LTE"
            }
          ],
          "sortBy": {
            "path": "Data.@timestamp",
            "defaultOrder": "DESC"
          },
          "sourceFilterPathList": [
            "Data.currentProcessInstance",
            "Data.auditDetails",
            "Data.additionalDetails",
            "Data.tenantId",
            "Data.applicationNo",
            "Data.workflow",
            "Data.locality"
          ]
        }
    { "tenantId": "pb.amritsar",
    "moduleName": "FSM",
    "PeriodicService":[
    {
    "timeLimit" : 864000000,
    "isSchedularConfiguration":true
    }
    ]
    }
    
    { "jobName": "daily",
    "active": "true",
    "method": "POST",
    "url": "http://fsm.egov:8080/fsm/v1/_schedular",
    "payload": {
    "RequestInfo": "{DEFAULT_REQUESTINFO}" },
    "header": { "Content-Type": "application/json"
    }
    
    postman Collection
    FSM API Contract
    FSM Postman Collection
    https://www.getpostman.com/collections/a51486db12539a2aa597
    https://www.getpostman.com/collections/a51486db12539a2aa597
    https://www.getpostman.com/collections/a51486db12539a2aa597
    https://www.getpostman.com/collections/a51486db12539a2aa597
    https://www.getpostman.com/collections/a51486db12539a2aa597
    https://www.getpostman.com/collections/a51486db12539a2aa597
    https://www.getpostman.com/collections/a51486db12539a2aa597
    https://api.postman.com/collections/23418568-dd47ece3-c134-4831-b008-9a86f715cd6e?access_key=PMAT-01HK7JPCNGK90XJAMXRA0YN050

    FSM Calculator

    Details for setting up FSM calculator sevice

    Overview

    FSM calculator is a system that enables the FSM admin to create billing slabs for the FSM application(s) with different combinations of property type, slum, tank, and capacity. It generates the demand after calculating the charges for the given application using the billing slab already configured.

    This document contains the details on how to set up the FSM calculator service, describes the functionalities it provides, and details the enhancements made to the FSM calculator service.

    Pre-requisites

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

    • Java 8

    • Kafka server is up and running

    • egov-persister service is running and has fsm-calculator-persister config path added in it

    • PSQL server is running and database is created to store FSM Application data

    - egov-perister

    - egov-mdms

    - fsm

    - billing-service

    Key Functionalities

    EXISTING

    • FSM admin, an employee of ULB with FSM admin role can create, update billing slab(s).

    • ULB employee with FSM_CREATOR and FSM_EDITOR can search billing slab(s).

    • ULB employee citizen can file, track and rate the application for cleaning septic tank.

    • ULB employee can get the estimate for the FSM application.

    ENHANCEMENT

    • Bill amount is calculated based on the number of trips entered while updating the number of trips in the FSM application.

    • Added validation for advance payment with the configuration.

    • Added validation for maximum total advance payment.

    • Added cancellation charges for canceling the application.

    Data Setup

    Billing Slab Setup

    Create billing slab with combination of PropertyType, refer values from, Slum (YES/NO), capacityFrom and capacityTo refers to the Vehicle Tank Capacity.

    Sample Curl

    Integration

    Integration Scope

    The FSM-calculator will be integrated with the FSM application. The FSM application internally will invoke the fsm-calculator service to calculate and generate demand for the charges.

    Integration Benefits

    • The calculation and demand generation logic will be separated from the FSM service. For each implementation, the calculation implementation can be changed, if required, without modifying the FSM service.

    Steps to Integration

    1. FSM application to call fsm-calulator/v1/_calculate to calculate and generate the demand for the fsm application.

    2. ULB employee can call fsm-calculator/v1/_estimate to get the estimates for the fsm application.

    3. ULB Employee can create billing slab calling fsm-calculator/v1/billingSlab/_create

    4. ULB employee can update billing slab calling fsm-calculator/v1/billingSlab/_update

    FSM application to call fsm-calculator/v1/_advanceBalanceCalculate to calculate the advance charge based on the configuration data, that is, either it will be fixed or a percentage.

    Interaction Diagram

    TBD

    Reference Docs

    Doc Links

    API List

    The following services should be up and running-

  • FSM service internally call fsm-calculator to generate a demand.

  • Vehicle type check has been removed from calculator service and the bill amount is calculated based on the number of trips entered while submitting the FSM application.

  • Validation before completing the request with the payment.

  • Minimum part payment is configurable, that is, it should be fixed or percentage calculation, and the calculation should done based on the mdms config value.

  • Minimum cancellation fee is configurable, that is, it should be fixed or percentage calculation, and the calculation should done based on the mdms config value.

  • Demand generation process: Generating demand every time the trip is updates.

  • Demand generation process: Added validation not to complete the application from the ULB side before completing the payment.

  • ULB Employee can search billing slab calling fsm-calculator/v1/billingSlab/_search

  • FSM application to call fsm-calculator/v1/_cancellationFee to calculate cancellation charge based on the configuration data, that is, either it will be fixed or it will be a percentage.

  • NEEDS TO BE UPDATED

    API Contract

    Postman Scripts

    fsm-calculator/v1/_advancebalancecalculate

    Workflow Technical Document

    Workflow Service

    User Technical Document

    User Service

    MDMS Technical Document

    NEEDS TO BE UPDATED

    IDGen Technical Document

    NEEDS TO BE UPDATED

    Localization Technical Document

    NEEDS TO BE UPDATED

    Persister Technical Document

    NEEDS TO BE UPDATED

    Title

    Link

    fsm-calulator/v1/_calculate

    https://www.getpostman.com/collections/8b9eb951a810486f41a4

    fsm-calculator/v1/_estimate

    https://www.getpostman.com/collections/8b9eb951a810486f41a4

    fsm-calculator/v1/billingSlab/_create

    https://www.getpostman.com/collections/8b9eb951a810486f41a4

    fsm-calculator/v1/billingSlab/_update

    https://www.getpostman.com/collections/8b9eb951a810486f41a4

    fsm-calculator/v1/billingSlab/_search

    https://www.getpostman.com/collections/8b9eb951a810486f41a4

    PropertyType Mdms

    SMS Notification Technical Document

    fsm-calculator/v1/_cancellationfee

    curl --location --request POST 'http://localhost:9098/fsm-calculator/v1/billingSlab/_create' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "RequestInfo": {
            "apiInfo": {
                "id": "string",
                "version": "string",
                "path": "string"
            },
            "deviceDetail": {
                "id": "string",
                "signature": "string"
            },
            "ts": 0,
            "action": "string",
            "key": "string",
            "msgId": "string",
            "requesterId": "string",
            "authToken": "a35b5ba7-2d5f-4272-8a67-0303cfab2c9f"
        },
       "billingSlab":{
              
                "tenantId": "pb.amritsar",
                "capacityFrom": 1000.00,
                "capacityTo": 50000.00,
                "propertyType": "RESIDENTIAL.ROW_HOUSES",
                "slum": "NO",
                "price": 9000.00,
                "status": "ACTIVE"
            },
        "workflow": null
    }'
    API Contract
    Postman Scripts
    https://api.postman.com/collections/23418568-77e3f5fb-dd9d-4f05-92e7-b15dcbeecffe?access_key=PMAT-01GN93ZP6B68E0T5TZ62GR02W0
    https://api.postman.com/collections/23418568-77e3f5fb-dd9d-4f05-92e7-b15dcbeecffe?access_key=PMAT-01GN93ZP6B68E0T5TZ62GR02W0