FSM Calculator v1.0
Overview
FSM Calculator is a system that enables FSM Admin to create billing slab for the FSM application(s) with different combination of propertyType , slum , tank capacity and etc..
Generates the Demand after calculating the charges for the given application using the billing slab already configured. This document contains the details about how to setup the fsm-calculator service and description the functionalities it provides.
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
Following services should be up and running:
egov-perister
egov-mdms
fsm
billing-service
Key Functionalities
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 FSM Application
FSM service internally call fsm-calculator to generate a demand
Deployment Details
Deploy the latest version of fsm
Add fsm-calculator-persister.yml file in 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": ""
}
]
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"
}
]
Infra Ops Configuration
Configurations that we can manage through values.yml fsm-calculator in infraops repo as follows
values.yml for fms-calculator can be found here
Description | name in values.yml | Current Value |
---|---|---|
contextPath of the api’s |
|
|
Kafka Consumer Group |
|
|
kafka topic to which service push data to save new billing slab |
|
|
kafka topic to which service push data to update the existing billing slab |
|
|
mdms service host |
|
|
billing-service host |
|
|
fsm 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
Create Billing Slab with combination of PropertyType refer values form PropertyType Mdms, Slum ( YES/NO), capacityFrom and capacityTo refers to Vehicle Tank Capacity.
Sample Curl
Integration
Integration Scope
FSM-calculator will be integrated with FSM Application. FSM Application internally invoke the fsm-calculator service to calculate and generate demand for the charges.
Integration Benefits
Calculation and demand generation logic will be separated from FSM service, For each implementation calculation implementation can be changed if required with out modifying the fsm service.
Steps to Integration
FSM application to call
fsm-calulator/v1/_calculate
to calculate and generate the demand for the fsm applicationULB Employee can call
fsm-calculator/v1/_estimate
to get the estimates for the fsm applicationULB 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
Interaction Diagram
TBD
Reference Docs
Doc Links
Title | Link |
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 Sripts |
API List
Title | Link |
| |
| |
| |
| |
|