Sanitation
PlatformDomainsAcademyDesign SystemFeedback
v1.3.1
v1.3.1
  • Introducing DIGIT Sanitation
    • Roadmap
    • Who can use DIGIT Sanitation?
      • Field Research
  • Platform
    • Features
    • Release Notes
      • Test Cases
      • Service Build Update
        • Release Builds for DIGIT 2.8
      • MDMS Configuration Updates
      • Test Cases for Urban-Rural Convergence
      • Localisation
      • Impel Release Notes
    • Architecture
    • Installation
    • Setup
      • On AWS
    • Operations Guide
    • Development Guide
      • Backend Developer Guide
      • UI Developer Guide
    • Source Code
  • Product
    • Faecal Sludge Management (FSM)
      • Features
      • Sanitation Actors & Interactions
      • User Interface Design
      • FSM Core Service Configuration
        • FSM Implementation Configuration
        • FSM Calculator
        • FSM Vendor Registry
          • Workflow Service
            • Configuring Workflows For New Product/Entity
            • Setting Up Workflows
            • Workflow 2.0 Configuration
          • User Service
            • User Data Encryption Promotion
            • Encryption Client Library
          • API Contract
        • FSM Vehicle Registry
        • Legacy/Re-Indexing the FSM Data
        • FSM UI Docs
          • FSM Citizen UI
          • FSM Employee UI
          • FSM DSO UI
          • FSM FSTPO UI
        • FSM-DSS Technical Documentation
      • FSM User Manual
        • FSM Citizen User Manual
        • FSM Employee User Manual
          • Manage Vendor, Driver and Vehicle Details
        • DSO User Manual
        • Septage Treatment Plant Operator User Manual
      • Test Cases
      • FSM UI/UX Audit
      • FSM Functional Specification
      • FSM Technical Specification
        • Vehicle Technical Specification
        • Vendor Technical Specification
        • Calculator Technical Specification
      • FSM Release Notes
      • Training
  • Programme
    • Functional Customisation
      • Urban-Rural Convergence
    • Technical Customisation
    • Technical Specification: Urban-Rural Convergence
    • Standard Operating Procedure (SOP)
    • Program Rollout Plan
    • Adoption Metrics
    • Implementation Plan
    • Implementation Guide
      • General FSM Implementation Activities
    • Implementation Checklist
  • COMMUNITY
    • Contribute
    • Issues
Powered by GitBook

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

On this page
  • Overview
  • Pre-requisites
  • Key Functionalities
  • Deployment Details
  • Configuration Details
  • Infra Ops Configuration
  • Data Setup
  • Integration
  • Integration Scope
  • Integration Benefits
  • Steps to Integration
  • Interaction Diagram
  • Reference Docs
  • Doc Links
  • API List

Was this helpful?

Export as PDF
  1. Product
  2. Faecal Sludge Management (FSM)
  3. FSM Core Service Configuration

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

  • The following services should be up and running-

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

  • 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.

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.

  • 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.

Deployment Details

  1. Deploy the latest version of FSM.

  2. Add fsm-calculator-persister.yml file in the config folder in GIT, and add that path in persister (the file path is to be added in environment yaml file in param called persist-yml-path):

Configuration Details

MDMS Configuration

FSM MDMS configuration is sufficient.

Business Service / Workflow Configuration

NA

Actions & Role Action Mapping

Actions

[
  {
    "id": {{PLACEHOLDER1}},
    "name": "FSM BillingSlab Create",
    "url": "/fsm-calculator/v1/billingSlab/_create",
    "displayName": "FSM BillingSlab Create",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  },
  {
    "id": {{PLACEHOLDER2}},
    "name": "FSM BillingSlab Update",
    "url": "/fsm-calculator/v1/billingSlab/_update",
    "displayName": "FSM BillingSlab Update",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  },
  {
    "id": {{PLACEHOLDER3}},
    "name": "FSM BillingSlab Search",
    "url": "/fsm-calculator/v1/billingSlab/_search",
    "displayName": "FSM BillingSlab Search",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  },
  {
    "id": {{PLACEHOLDER4}},
    "name": "FSM Estimate",
    "url": "/fsm-calculator/v1/_estimate",
    "displayName": "FSM Estimate",
    "orderNumber": 1,
    "parentModule": "",
    "enabled": false,
    "serviceCode": "",
    "code": "null",
    "path": ""
  }
]

{
  "id": {{PLACEHOLDER5}},
  "name": "FSM Advance Balance Calculation",
  "url": "/fsm-calculator/v1/_advanceBalanceCalculate",
  "displayName": "FSM Advance Balance Calculation",
  "orderNumber": 1,
  "parentModule": "",
  "enabled": false,
  "serviceCode": "",
  "code": "null",
  "path": ""
},
{
  "id": {{PLACEHOLDER6}},
  "name": "FSM Cancellation Fee Calculation",
  "url": "/fsm-calculator/v1/_cancellationFee",
  "displayName": "FSM Advance Balance Calculation",
  "orderNumber": 1,
  "parentModule": "",
  "enabled": false,
  "serviceCode": "",
  "code": "null",
  "path": ""
}

Role Action Mapping

[
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER1}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER2}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_CREATOR_EMP",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_DSO",
    "actionid": "{{PLACEHOLDER3}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_CREATOR_EMP",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_EDITOR_EMP",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  },
  {
    "rolecode": "FSM_ADMIN",
    "actionid": "{{PLACEHOLDER4}}",
    "actioncode": "",
    "tenantId": "pb"
  }
]

{
  "rolecode": "CITIZEN",
  "actionid": {{PLACEHOLDER3}},
  "actioncode": "",
  "tenantId": "pb"
} ,
{
  "rolecode": "CITIZEN",
  "actionid": {{PLACEHOLDER5}},
  "actioncode": "",
  "tenantId": "pb"
},
{
  "rolecode": "FSM_EDITOR_EMP",
  "actionid": {{PLACEHOLDER5}},
  "actioncode": "",
  "tenantId": "pb"
},
{
  "rolecode": "FSM_CREATOR_EMP",
  "actionid": {{PLACEHOLDER6}},
  "actioncode": "",
  "tenantId": "pb"
},

Infra Ops Configuration

Description

name in values.yml

Current Value

contextPath of the api’s

SERVER_CONTEXTPATH

/fsm-calculator

Kafka Consumer Group

SPRING_KAFKA_CONSUMER_GROUP_ID

fsm-calculator

kafka topic to which service push data to save new billing slab

PERSISTER_SAVE_BILLING_SLAB_TOPIC

save-fsm-billing-slab

kafka topic to which service push data to update the existing billing slab

PERSISTER_UPDATE_BILLING_SLAB_TOPIC

update-fsm-billing-slab

mdms service host

EGOV_MDMS_HOST

egov-mdms-service from egov-service-host

billing-service host

EGOV_BILLINGSERVICE_HOST

billing-service from egov-service-host

fsm service host

EGOV_FSM_HOST

fsm from egov-service-host

Configurations sample in Values.yml

 - name: SERVER_CONTEXTPATH
    value: /fsm-calculator
  - name: SPRING_KAFKA_CONSUMER_GROUP_ID
    value: fsm-calculator
  - name: PERSISTER_SAVE_BILLING_SLAB_TOPIC
    value: save-fsm-billing-slab
  - name: PERSISTER_UPDATE_BILLING_SLAB_TOPIC
    value: update-fsm-billing-slab
  - name: SPRING_KAFKA_PRODUCER_KEY_SERIALIZER
    value: org.apache.kafka.common.serialization.StringSerializer
  - name: SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER
    value: org.springframework.kafka.support.serializer.JsonSerializer
  - name: EGOV_MDMS_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: egov-mdms-service
  - name: EGOV_BILLINGSERVICE_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: billing-service
  - name: EGOV_FSM_HOST
    valueFrom:
      configMapKeyRef:
        name: egov-service-host
        key: fsm

Data Setup

Billing Slab Setup

Sample Curl

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
}'

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

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

  6. 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.

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

Workflow Technical Document

User Technical Document

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

SMS Notification Technical Document

NEEDS TO BE UPDATED

API Contract

Postman Scripts

API List

Title

Link

fsm-calulator/v1/_calculate

fsm-calculator/v1/_estimate

fsm-calculator/v1/billingSlab/_create

fsm-calculator/v1/billingSlab/_update

fsm-calculator/v1/billingSlab/_search

fsm-calculator/v1/_cancellationfee

fsm-calculator/v1/_advancebalancecalculate

Last updated 1 year ago

Was this helpful?

Configurations that we can manage through values.yml fsm-calculator in infraops repo are as follows. values.yml for fms-calculator can be found.

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

https://github.com/egovernments/configs/blob/DEV/egov-persister/fsm-calculator-persister.yaml
here
PropertyType Mdms
Workflow Service
User Service
API Contract
Postman Scripts
https://www.getpostman.com/collections/8b9eb951a810486f41a4
https://www.getpostman.com/collections/8b9eb951a810486f41a4
https://www.getpostman.com/collections/8b9eb951a810486f41a4
https://www.getpostman.com/collections/8b9eb951a810486f41a4
https://www.getpostman.com/collections/8b9eb951a810486f41a4
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