FSM Calculator v1.0
Details for setting up FSM calculator service

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

    1.
    Deploy the latest version of fsm
    2.
    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
1
[
2
{
3
"id": {{PLACEHOLDER1}},
4
"name": "FSM BillingSlab Create",
5
"url": "/fsm-calculator/v1/billingSlab/_create",
6
"displayName": "FSM BillingSlab Create",
7
"orderNumber": 1,
8
"parentModule": "",
9
"enabled": false,
10
"serviceCode": "",
11
"code": "null",
12
"path": ""
13
},
14
{
15
"id": {{PLACEHOLDER2}},
16
"name": "FSM BillingSlab Update",
17
"url": "/fsm-calculator/v1/billingSlab/_update",
18
"displayName": "FSM BillingSlab Update",
19
"orderNumber": 1,
20
"parentModule": "",
21
"enabled": false,
22
"serviceCode": "",
23
"code": "null",
24
"path": ""
25
},
26
{
27
"id": {{PLACEHOLDER3}},
28
"name": "FSM BillingSlab Search",
29
"url": "/fsm-calculator/v1/billingSlab/_search",
30
"displayName": "FSM BillingSlab Search",
31
"orderNumber": 1,
32
"parentModule": "",
33
"enabled": false,
34
"serviceCode": "",
35
"code": "null",
36
"path": ""
37
},
38
{
39
"id": {{PLACEHOLDER4}},
40
"name": "FSM Estimate",
41
"url": "/fsm-calculator/v1/_estimate",
42
"displayName": "FSM Estimate",
43
"orderNumber": 1,
44
"parentModule": "",
45
"enabled": false,
46
"serviceCode": "",
47
"code": "null",
48
"path": ""
49
}
50
]
Copied!
Role Action Mapping
1
[
2
{
3
"rolecode": "FSM_ADMIN",
4
"actionid": "{{PLACEHOLDER1}}",
5
"actioncode": "",
6
"tenantId": "pb"
7
},
8
{
9
"rolecode": "FSM_ADMIN",
10
"actionid": "{{PLACEHOLDER2}}",
11
"actioncode": "",
12
"tenantId": "pb"
13
},
14
{
15
"rolecode": "FSM_CREATOR_EMP",
16
"actionid": "{{PLACEHOLDER3}}",
17
"actioncode": "",
18
"tenantId": "pb"
19
},
20
{
21
"rolecode": "FSM_EDITOR_EMP",
22
"actionid": "{{PLACEHOLDER3}}",
23
"actioncode": "",
24
"tenantId": "pb"
25
},
26
{
27
"rolecode": "FSM_ADMIN",
28
"actionid": "{{PLACEHOLDER3}}",
29
"actioncode": "",
30
"tenantId": "pb"
31
},
32
{
33
"rolecode": "FSM_DSO",
34
"actionid": "{{PLACEHOLDER3}}",
35
"actioncode": "",
36
"tenantId": "pb"
37
},
38
{
39
"rolecode": "FSM_CREATOR_EMP",
40
"actionid": "{{PLACEHOLDER4}}",
41
"actioncode": "",
42
"tenantId": "pb"
43
},
44
{
45
"rolecode": "FSM_EDITOR_EMP",
46
"actionid": "{{PLACEHOLDER4}}",
47
"actioncode": "",
48
"tenantId": "pb"
49
},
50
{
51
"rolecode": "FSM_ADMIN",
52
"actionid": "{{PLACEHOLDER4}}",
53
"actioncode": "",
54
"tenantId": "pb"
55
}
56
]
Copied!
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
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
1
- name: SERVER_CONTEXTPATH
2
value: /fsm-calculator
3
- name: SPRING_KAFKA_CONSUMER_GROUP_ID
4
value: fsm-calculator
5
- name: PERSISTER_SAVE_BILLING_SLAB_TOPIC
6
value: save-fsm-billing-slab
7
- name: PERSISTER_UPDATE_BILLING_SLAB_TOPIC
8
value: update-fsm-billing-slab
9
- name: SPRING_KAFKA_PRODUCER_KEY_SERIALIZER
10
value: org.apache.kafka.common.serialization.StringSerializer
11
- name: SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER
12
value: org.springframework.kafka.support.serializer.JsonSerializer
13
- name: EGOV_MDMS_HOST
14
valueFrom:
15
configMapKeyRef:
16
name: egov-service-host
17
key: egov-mdms-service
18
- name: EGOV_BILLINGSERVICE_HOST
19
valueFrom:
20
configMapKeyRef:
21
name: egov-service-host
22
key: billing-service
23
- name: EGOV_FSM_HOST
24
valueFrom:
25
configMapKeyRef:
26
name: egov-service-host
27
key: fsm
Copied!

Data Setup

Billing Slab Setup

Create Billing Slab with **a combination of PropertyType refer values form PropertyType Mdms, Slum ( YES/NO), capacityFrom and capacityTo refers to Vehicle Tank Capacity.
Sample Curl
1
curl --location --request POST 'http://localhost:9098/fsm-calculator/v1/billingSlab/_create' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"RequestInfo": {
5
"apiInfo": {
6
"id": "string",
7
"version": "string",
8
"path": "string"
9
},
10
"deviceDetail": {
11
"id": "string",
12
"signature": "string"
13
},
14
"ts": 0,
15
"action": "string",
16
"key": "string",
17
"msgId": "string",
18
"requesterId": "string",
19
"authToken": "a35b5ba7-2d5f-4272-8a67-0303cfab2c9f"
20
},
21
"billingSlab":{
22
23
"tenantId": "pb.amritsar",
24
"capacityFrom": 1000.00,
25
"capacityTo": 50000.00,
26
"propertyType": "RESIDENTIAL.ROW_HOUSES",
27
"slum": "NO",
28
"price": 9000.00,
29
"status": "ACTIVE"
30
},
31
"workflow": null
32
}'
Copied!

Integration

Integration Scope

FSM-calculator will be integrated with FSM Application. FSM Application internally invokes the fsm-calculator service to calculate and generate demand for the charges.

Integration Benefits

    Calculation and demand generation logic will be separated from the FSM service. For each implementation, 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

Interaction Diagram

TBD

Reference Docs

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 Scripts

API List

Title
Link
fsm-calculator/v1/billingSlab/_create
fsm-calculator/v1/billingSlab/_update
fsm-calculator/v1/billingSlab/_search
All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.
Last modified 5mo ago