Sewerage calculator KT document
KT Document For Sewerage Calculator Service:
Description :
This is the egov application, which is responsible for calculating fee estimation, creating demands, applying time-based tax heads on demands. This service is also responsible for sending notification after bill generation.
Application.properties entries :
↠ Port of application: server.port=8084
Application context path : server.context.path=sw-calculator/
Application time zone : app.timezone=UTC
↠ Postgresql driver : spring.datasource.driver-class-name=org.postgresql.Driver
Database URL : spring.datasource.url=jdbc:postgresql://localhost:5432/ws_services
Database username : spring.datasource.username=postgres
Database password : spring.datasource.password=postgres
↠ Flyway config :
flyway.url=jdbc:postgresql://localhost:5432/ws_services
flyway.user=postgres
flyway.password=postgres
flyway.table=public18
flyway.baseline-on-migrate=true
flyway.outOfOrder=true
flyway.locations=db/migration/ddl
flyway.enabled=true
↠ Billing Service url
egov.billingservice.host=http://localhost:8081
egov.demand.update.endpoint=billing-service/demand/_update
egov.demand.create.endpoint=billing-service/demand/_create
egov.demand.search.endpoint=billing-service/demand/_search
egov.bill.gen.endpoint=billing-service/bill/_generate
egov.bill.fetch.endpoint=/billing-service/bill/v2/_fetchbill
egov.taxhead.search.endpoint=billing-service/taxheads/_search
egov.taxperiod.search.endpoint=billing-service/taxperiods/_search
egov.demand.businessservice=SW
↠ Kafka application port :
kafka.config.bootstrap_server_config=localhost:9092
spring.kafka.consumer.value-deserializer=org.egov.tracer.kafka.deserializer.HashMapDeserializer
spring.kafka.consumer.value-deserializer=org.egov.tracer.kafka.deserializer.HashMapDeserializer
spring.kafka.consumer.group-id=egov-sewerage-services
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer
↠ Localization service config:
egov.localization.host=http://localhost:8087/
egov.localization.workDir.path=localization/messages/v1
egov.localization.context.path=localization/messages/v1
egov.localization.search.endpoint=_search
egov.localization.statelevel=true
↠SMS Notification:
kafka.topics.notification.sms=egov.core.notification.sms
notification.sms.enabled=true
notification.sms.link=citizen/egov-common/pay?consumerCode=$consumerCode&tenantId=$tenantId&businessService=SW
↠ Demand Generation Config:
sw.calculator.demand.successful=sw-demand-saved
sw.calculator.demand.failed=sw-demand-failed
egov.demand.billexpirytime=2592000000
sw.module.minpayable.amount=100
↠ Pagination config
egov.sewerageservice.pagination.default.limit=50
egov.sewerageservice.pagination.default.offset=0
↠ Mdms host url :
egov.mdms.host=http://localhost:8094/
egov.mdms.search.endpoint=egov-mdms-service/v1/_search
↠ Sewerage Service url
egov.sw.host=http://localhost:8090
egov.sc.search.endpoint=sw-services/swc/_search
↠ Localization service config:
egov.localization.host=https://egov-micro-dev.egovernments.org/
egov.localization.workDir.path=localization/messages/v1
egov.localization.context.path=localization/messages/v1
egov.localization.search.endpoint=/_search
egov.localization.statelevel=true
↠ Demand saved and failed topic
sw.calculator.demand.successful=sw-demand-saved
sw.calculator.demand.failed=sw-demand-failed
sw.demand.generate=sw-demand-generate-success
sw.demand.failed=sw-demand-generate-failure
sw.calculator.bill.successful=sw-bill-generate-failure
sw.calculator.bill.failed=sw-bill-generate-failure
egov.demand.minimum.payable.amount=100
↠ User search url:
egov.user.host=http://localhost:8081/
egov.user.context.path=user/users
egov.user.search.path=user/_search
↠ Bill notification topic
kafka.topics.billgen.topic=sw-bill-generation
↠ User config:
egov.user.event.notification.enabled=true
egov.ui.app.host=https://egov-micro-dev.egovernments.org
egov.usr.events.create.topic=persist-user-events-async
egov.usr.events.pay.link=citizen/otpLogin?mobileNo=$mobile&redirectTo=egov-common/pay?consumerCode=$consumerCode&tenantId=$tenantId&businessService=SW
egov.usr.events.pay.code=PAY
egov.usr.events.pay.triggers=PENDINGPAYMENT
notification.url = https://egov-micro-dev.egovernments.org/
sw.demand.based.batch.size=10
egov.seweragecalculatorservice.createdemand=sw-generate-demand
↠ Property registery host url :
egov.property.service.host=https://egov-micro-dev.egovernments.org/
egov.property.searchendpoint=property-services/property/_search
Dependency on another microservices :
Microservices | Dependency |
Mdms service | Loading all master data |
Property Service | For searching the property |
Persister service | Persisting the data |
SW service | For Searching the sewerage connection |
Billing Service | For demand related things |
User service | For user search |
Localization service | For searching the notification content |
MDMS Configuration :
File Name | Link | Purpose |
billingPeriod.json | https://github.com/egovernments/egov-mdms-data/blob/master/data/pb/sw-services-calculation/billingPeriod.json | Master Data for billing period. |
CalculationAttribute.json | Master data for calculation attribute. | |
FeeSlab.json | Master data for fee slab. | |
Interest.json | Master data for interest. | |
PipeSize.json | Master data for pipe size. | |
PlotSizeSlab.json | Master data for plot size. | |
PropertyUsageType.json | Master data for property usage type. | |
Rebate.json | Master data for rebate | |
RoadType.json | Master data for road type | |
SCBillingSlab.json | Master data for billing slab |
Penalty.json | Master data for penalty. |
---|
Calculator API’s:
Fee Estimation(/sewerageCalculator/_estimate)
Tax calculation and demand generation (/sewerageCalculator/_calculate)
Adding time based tax head on demand(/sewerageCalculator/_updateDemand)
Job scheduler for demand generation of non-metered connection(/sewerageCalculator/_jobscheduler)
Adhoc tax heads on demand (/sewerageCalculator/_applyAdhocTax)
Fee Estimation(/sewerageCalculator/_estimate) :
This API is responsible for estimating the fee for a given application based on configured master data. This API will not generate the demand it only returns the estimation of an application.
Tax calculation and demand generation (/sewerageCalculator/_calculate) :
This API is responsible for calculating the tax heads of given connections on a given billing cycle. After calculating the tax heads, Demand will be generated by this API.
Adding time based tax head on demand(/sewerageCalculator/_updateDemand) :
This API is responsible for applying the time based tax heads on demand. Penalty / Rebate will be added after expiry of demand or after some given configuration time.
Job scheduler for demand generation of non-metered connection(/sewerageCalculator/_jobscheduler) :
This API is responsible for generating the demand for non-metered connections. The job scheduler will run on each and every billing cycle.
Adhoc tax heads on demand (/sewerageCalculator/_applyAdhocTax) :
This API is responsible for adding the Adhoc penalty / rebate of a given consumer code.