Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Sewerage charge calculation

  • Demand generation(here as its always non-metered demand will be generated based on time period)

  • Sewerage charge estimation(one-time cost which involves cost like road-cutting charge , form fee , scrutiny fee etc.)

Deployment Details

  1. Deploy the latest version of sw-service and sw-calculator

  2. Add sewerage-persist.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

Billing Slabs:

Criteria :

  1. connection type

  2. building type

  3. calculation attribute

  4. property usage type

The combination of the above can be used to define the billing slab. Billing Slab is defined in mdms under sw-services-calculation folder with the SCBillingSlab. The following is the sample slab.

...

For application one-time fee, the estimation will return all the related tax head based on criteria. For estimation, all configuration is present in sw-services-calculation.

  1. FeeSlab.json

  2. PlotSizeSlab.json

  3. RoadType.json

All the above master configuration is used for estimation.

...

  • The scheduler can be hit by scheduler API or we can schedule cron job or we can put config to kubectl which will hit scheduler based on config.

  • After the scheduler been hit we will search the list of the tenant (city) present in the database.

  • After getting the tenants we will pickup tenant one by one and generate the demand for that tenant.

  • We will load the consumer codes for the tenant and push the calculation criteria to Kafka. Calculation criteria contain minimal information (We are not pushing large data to Kafka), calculation criteria contain consumer code and one boolean variable.

  • After pushing the data into Kafka we are consuming the records based on the batch configuration. Ex:-> if the batch configuration is 50 so we will consume the 50 calculation criteria at a time.

  • After consuming the record(Calculation criteria) we will process the batch for generating the demand. If the batch is successful so will log the consumer codes which have been processed.

  • If some records failed in batch so we will push the batch into dead letter batch topic. From the dead letter batch topic, we will process the batch one by one.

  • If the record is successful we will log the consumer code, If the record is failed so we will push the data into a dead letter single topic.

  • Dead letter single topic contains information about failure records in Kafka.

Use cases:

  1. If the same job trigger multiple time what will happen?

If the same job triggers multiple times we will process again as mentioned above but at the demand level we will check the demand based on consumer code and billing period, If demand already exists then we will update the demand otherwise we will create the demand.

  1. Are we maintaining success or failure status anywhere?

Currently, we are maintaining the status of failed records in Kafka.

...

SW calculator application is used to calculate the sewerage application one time Fees and connection charges based on the different billing slabs that's why the calculation and demand generation logic will be separate out from SW service.
So in future, if calculation logic need to modify then changes can be carry out for each implementation without modifying the SW service.

Steps to Integration

  1. To Activate the Sewerage Service application, the user needs to pay the ONE_TIME_FEE for the connection. To calculate the ONE_TIME_FEE sw-calculator/sewerageCalculator/_estimate API is use.

  2. To generate the demand for non-metered sewerage connection /sw-calculator/sewerageCalculator/_calculate API is use.

  3. User can pay partial / full / advance amount for the Non-Metered connection bill. In these cases, Billing service would call back /sw-calculator/sewerageCalculator/_updateDemandAPI to update the details of the demand generated.

  4. /sw-calculator/sewerageCalculator/_jobscheduler API is use to generate demand for Non-metered connections. This API can be called periodically.

  5. /sw-calculator/sewerageCalculator/_applyAdhocTax API is use to add Rebate or Penalty on any bill and based on that the bill amount will be adjusted.

Reference Docs

...

Title 

Link

/sw-calculator/sewerageCalculatorr/_estimate

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

/sw-calculator/sewerageCalculator/_calculate

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

/sw-calculator/sewerageCalculator/_updateDemand

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

/sw-calculator/sewerageCalculator/_jobscheduler

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

/sw-calculator/sewerageCalculator/_applyAdhocTax

https://www.getpostman.com/collections/37ec9095f49fea91a45a

/sw-calculator/sewerageCalculator/_jobscheduler

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

(Note: All the API’s are in the same postman collection therefore same link is added in each row)