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
Deploy the latest version of FSM.
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):
https://github.com/egovernments/configs/blob/DEV/egov-persister/fsm-calculator-persister.yaml
Configuration Details
MDMS Configuration
FSM MDMS configuration is sufficient.
Business Service / Workflow Configuration
NA
Actions & Role Action Mapping
Actions
Role Action Mapping
Infra Ops Configuration
Configurations that we can manage through values.yml fsm-calculator in infraops repo are as follows. values.yml for fms-calculator can be found here.
Configurations sample in Values.yml
Data Setup
Billing Slab Setup
Create billing slab with combination of PropertyType, refer values from PropertyType Mdms, 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
FSM application to call fsm-calulator/v1/_calculate to calculate and generate the demand for the fsm application.
ULB employee can call fsm-calculator/v1/_estimate to get the estimates for the fsm application.
ULB Employee can create billing slab calling fsm-calculator/v1/billingSlab/_create
ULB employee can update billing slab calling fsm-calculator/v1/billingSlab/_update
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.
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
Last updated