Consumer Creation

Provides Employees to create Consumer/Connection - Process of Onboarding the End Users.

Link. → {base url}/mgramseva/home/consumercreate.

 

 

 

Create Consumer card is available on the home screen as per the defined user role.

Click on the Consumer Create card navigates the user to the consumer creation screen.

Users enter the required details for the creation of Consumer.

If a user logs in for the first time then a walkthrough is populated following the same logic as in the home screen.

 

File Path

Primary Files - https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/screeens/ConsumerDetails/ConsumerDetailsWalkThrough/WalkFlowContainer.dart , https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/screeens/ConsumerDetails/ConsumerDetailsWalkThrough/walkthrough.dart

 

 

 


SL

Fields

Validations

SL

Fields

Validations

1

consumer Name*

[A-Za-z ]

2

Gender*

None

3

Spouse/Parent’s Name*

[A-Za-z ]

4

Phone Number*

[0-9]

5

Old Connection No

None

6

Category

None

7

Sub Category

None

8

Door Number

None

9

Street Name/Number

None

10

Gram Panchayat Name*

None- Disabled

11

Propert Type*

None

12

Service Type*

None

13

Meter Id

[a-zA-Z0-9]

14

Meter Reading

[0-9]

15

Billing Cycle

None

16

Arrears

[0-9.]

17

Advance

[0-9.]

18

Penalty

[0-9.]

Note: All fields are validated on Submit except the Phone number which gets validated on change.

 

API details

SL

API

Params

Description

SL

API

Params

Description

1

/egov-mdms-service/v1/_search

[{"moduleName":"ws-services-masters","masterDetails":[{"name":"connectionType"}]},{"moduleName":"PropertyTax","masterDetails":[{"name":"PropertyType"}]},{"moduleName":"BillingService","masterDetails":[{"name":"TaxPeriod","filter":"[?(@.service=='WS' && @.fromDate <= 1631989800000 && @.toDate >= 1631989800000)]

To get the Property Type and service Type and billing cycle values for the Dropdown

2

egov-location/location/v11/boundarys/_search?

hierarchyTypeCode=REVENUE&boundaryType=Locality&tenantId={tenantID}

To get the values for Locality DropDow

Consumer creation involves 2 sequential Process

  1. Property Creation

  2. Water connection Creation

After creating a property, the Property ID is linked to the WaterConnection Request JSON.

Water connection creation is of two types:

  1. A metered connection that requires Meter ID and meter installation Date/ Last Meter Reading Date and an optional field to capture meter reading.

     

  2. Non-Metered Connection which requires the last billing cycle as mandatory params captured in the field as shown below.

Users can switch between connection Type by selecting a desired value from the Service Type DropDown

.

 

Advance and Penalty

  • For consumer users can give either Advance or Arrears along with Penalty by selecting the respective option from radio buttons, if user selected Advance field will be shown or else Arrears and Penalty will be shown there user can enter required amount.

  • The radio button “Advance” will be displayed only if the config flag “Advance enabled” in MDMS billing service.

  • The “Penalty” field (displayed along with Arrears) on selecting the Arrears Radio button, will be displayed only if the config flag “Penalty enabled” in MDMS billing service, then only arrears field will be shown for user to enter the arrears amount.

 

Logic Implemented for Advance

billing-service/demand/_search api was using for calculating the advance amount for current bill, we can get the advance amount from if taxHeadMasterCode is 'WS_ADVANCE_CARRYFORWARD', here we have two properties, collection amount and tax amount, tax amount is advance amount which is collected and collection amount is how we consumed from the advance amount, we can get the current advance from the taxAmount - collectionAmount

 

Logic Implemented for Time Penalty

billing-service/demand/_search api was using for calculating Penalty amount, we can get the penalty amount from if taxHeadMasterCode is 'WS_TIME_ADHOC_PENALTY' , from tax amount property we can get the penalty amount.

Calculating the due date by adding the billexpirtyDate days with the Demand generation date.

Logic Implemented for First Demand Penalty

If it is the first demand and it is having the taxHeadMasterCode 10201 , we are showing the Penalty place holder in the bill details

SL

API

Description

SL

API

Description

1

property-services/property/_create

Property Creation Request JSON

defined in https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/model/connection/property.dart

2

ws-services/wc/_create

Water Connection Request JSON defined in https://github.com/egovernments/punjab-mgramseva/blob/develop/frontend/mgramseva/lib/model/connection/water_connection.dart

Role Access Mapping

case Routes.CONSUMER_CREATE: return ['GP_ADMIN', 'SUPERUSER'];

Components utilised from Widgets Library

Files Path

Model → https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/model/connection/property.dart , https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/model/connection/water_connection.dart

View → https://github.com/misdwss/punjab-mgramseva/tree/master/frontend/mgramseva/lib/screeens/ConsumerDetails

Controller → https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/repository/consumer_details_repo.dart , https://github.com/misdwss/punjab-mgramseva/blob/master/frontend/mgramseva/lib/providers/consumer_details_provider.dart