Bill Genie :: Employee: Group Bills
On the Employee home Screen Bill Genie module card will have all the links related to Bill Genie Screens.
Group Bills Screen:
Parameters required for Searching a bill:
Service Category → It is a mandatory parameter
Locality → It is a mandatory parameter
Consumer ID/Property ID → It is a dynamic ID which is dependent on the selection of Service Category.
→ If selected service category is either Water or Sewerage then Consumer ID is used
→ In all the other services Property ID is used
Search Results
Search Results are shown in a Tabular format with the columns as displayed above.
When the user clicks on a bill number cell that bill is downloaded as a pdf
Merge & Download:
→ There is a download button at the top right of the Group bill screen. Upon clicking this button opens a Download Menu
→ The download options in the menu are dependent on the Service Category selected by the user
If the selected service is Water/Sewerage Connection then the download options will have 2 options to download Water , Water and Sewerage bills or Sewerage, Sewerage and Water Bills respectively.
→ Upon clicking these options an appropriate toast message is shown and a job is started at the Backend side to consolidate these bills as a single pdf. This job is done in the background. This single pdf can be downloaded from the download bill screen. Download bill screen also shows the status of these jobs such as completion percentage , success , failure and also has an option to retry if the job fails at the backend
If other services are selected then only one option is shown which is merge & download which consolidates and downloads all the bills as a single pdf
Technical Implementation Details:
Group Bill Screen’s implementation can be found in this file:
SearchFields i.e., input parameters implementation details can be found here:
Results table implementation details can be found here:
Hooks/Utils Used:
To Download a bill → A util function named downloadBill is used which is defined in this file
This util function is inside Digit Utils hence it can be called anywhere throughout the application like this Digit.Utils.downloadBill(consumerCode, businessService, "consolidatedreceipt")
To Search a bill → A hook named useBillSearch is used to search bills which is defined in this file
Merge & Download(other than water/sewerage) → Two hooks are used in combination to accomplish this task which are shown below
Digit.PaymentService.generatePdf() // To fetch all the bills(inside reuslt there are filestore ids)
Digit.UploadServices.Filefetch() // filestore ids are used to fetch all these bills pdf
Usage of these hooks can be found in this file: Hooks
Merge & Download(water/sewerage) → The following hook is used to accomplish this task.
Digit.WSService.wnsGroupBill()
A flag (true/false) is used to distinguish between water/ water & sewerage download options
Usage of this hooks can be found in this file: Hooks
API Curls:
Search Bill
curl 'https://qa.digit.org/egov-searcher/bill-genie/waterbills/_get?_=1657023178169' \
-H 'authority: qa.digit.org' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'content-type: application/json;charset=UTF-8' \
-H 'origin: https://qa.digit.org' \
-H 'referer: https://qa.digit.org/digit-ui/employee/bills/group-bill' \
-H 'sec-ch-ua: ".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Windows"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: same-origin' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36' \
--data-raw '{"searchCriteria":{"tenantId":"pb.amritsar","businesService":"WS","url":"/bill-genie/waterbills/_get","billActive":"ACTIVE","locality":["SUN11"]},"RequestInfo":{"apiId":"Rainmaker","authToken":"73541f52-2fd8-4c66-8f71-8b1b7cd4fa82","msgId":"1657023178168|en_IN","plainAccessRequest":{}}}' \
--compressed
Download Bill pdf
Merge & Download(other than Water/Sewerage)
Merge & Download (Water & Sewerage)
API(s) Used:
API Endpoint | API description | Access Roles |
---|---|---|
| → Bills search API |
|
| → Bill Download API |
|
| → Merge & Download(other than Water/Sewerage) |
|
| → Merge & Download (Water and Sewerage Bills) |
|