# Public Grievance Redressal Data Model

The objective of the PGR service is to provide the functionality to raise a complaint or grievance by citizens in the system. Citizens can track the status of their complaint or grievance on the application and notifications of any updates is triggered to their registered mobile number whenever there is any change in the status of the complaint.

## PGR Service Entity Details

* [eg\_pgr\_address](#eg_pgr_address)
* [eg\_pgr\_service](#eg_pgr_service)
* [eg\_pgr\_action](#eg_pgr-action)

### eg\_pgr\_address

{% tabs %}
{% tab title="Description" %}
Representation of an address. The postal location details of the area where the complaint needs to be acted upon. Individual APIs may choose to extend from this using all if more details need to be added in their case.&#x20;

Set of location-related details in commonly accepted formats to identify an entity uniquely in a city or village. Conventionally used by postal or courier services to deliver mails or parcels to that location.
{% endtab %}

{% tab title="Attributes" %}

<table><thead><tr><th>Attribute Name</th><th>Data Type</th><th width="276">Definition</th><th>Mandatory (Y/N)</th></tr></thead><tbody><tr><td><mark style="background-color:red;">tenantid (PK)</mark></td><td>character varying (256)</td><td>Unique identifier for a tenant to which user primarily belongs</td><td>Y</td></tr><tr><td><mark style="background-color:red;">uuid (PK)</mark></td><td>character varying (256)</td><td>system generated id for the address</td><td>Y</td></tr><tr><td>housenoandstreetname<br></td><td>character varying (512)</td><td>house no and street name of complainant</td><td>N</td></tr><tr><td>mohalla</td><td>character varying (256)</td><td>locality of the complainant</td><td>N</td></tr><tr><td>landmark</td><td>character varying (1024)</td><td>additional location detail to help find the property</td><td>N</td></tr><tr><td>city</td><td>character varying (512)</td><td>city of the address..can be representated by the tenantid</td><td>N</td></tr><tr><td>pincode</td><td>character varying (16)</td><td>pincode of the address. Indian pincodes constitute numbers only</td><td>N</td></tr><tr><td>latitude</td><td>numeric (9, 6)</td><td>the latitude location details of the property</td><td>N</td></tr><tr><td>longitude</td><td>numeric (10, 7)</td><td>the longitude location details of the property</td><td>N</td></tr><tr><td>createdby</td><td>character varying (128)</td><td>username (preferred) or userid of the user that created the object</td><td>Y</td></tr><tr><td>createdtime</td><td>bigint</td><td>epoch of the time object is created</td><td>Y</td></tr><tr><td>lastmodifiedby</td><td>character varying (128)</td><td>username (preferred) or userid of the user that last modified the object</td><td>N</td></tr><tr><td>lastmodifiedtime</td><td>bigint</td><td>epoch of the time object is modified last</td><td>N</td></tr><tr><td>additionaldetails</td><td>jsonb</td><td>Json object to capture any extra information which is not accommodated in the model</td><td>N</td></tr></tbody></table>
{% endtab %}

{% tab title="Mapping" %}

| Attribute Name                  | Mapping Details                                         |
| ------------------------------- | ------------------------------------------------------- |
| tenantid                        | services.\*.addressDetail.tenantId                      |
| uuid                            | services.\*.addressDetail.uuid                          |
| <p>housenoandstreetname<br></p> | services.\*.addressDetail.houseNoAndStreetName          |
| mohalla                         | services.\*.addressDetail.mohalla                       |
| landmark                        | services.\*.addressDetail.landmark                      |
| city                            | services.\*.addressDetail.city                          |
| pincode                         |                                                         |
| latitude                        | services.\*.addressDetail.latitude                      |
| longitude                       | services.\*.addressDetail.longitude                     |
| createdby                       | services.\*.addressDetail.auditDetails.createdBy        |
| createdtime                     | services.\*.addressDetail.auditDetails.createdTime      |
| lastmodifiedby                  | services.\*.addressDetail.auditDetails.lastModifiedBy   |
| lastmodifiedtime                | services.\*.addressDetail.auditDetails.lastModifiedTime |
| additionaldetails               |                                                         |
| {% endtab %}                    |                                                         |
| {% endtabs %}                   |                                                         |

### eg\_pgr\_service

{% tabs %}
{% tab title="Description" %}
Complaints or service requests raised by a citizen. Typically, involves concerns raised about the poor quality of service or when the promised services are not delivered as expected. This entity holds the complaint or service request details comprising of a unique id, type of complaint and its description.
{% endtab %}

{% tab title="Attributes" %}

<table><thead><tr><th>Attribute Name</th><th width="167">Data Type</th><th width="308">Definition</th><th>Mandatory (Y/N)</th></tr></thead><tbody><tr><td><mark style="background-color:red;">tenantid (PK)</mark> </td><td>character varying (256)</td><td>system generated id for the address</td><td>Y</td></tr><tr><td>servicecode</td><td>character varying (256)</td><td>The unique identifier for service</td><td>Y</td></tr><tr><td><mark style="background-color:red;">servicerequestid (PK)</mark></td><td>character varying (256)</td><td>The unique formatted id for service request.</td><td>Y</td></tr><tr><td>description</td><td>character varying (4000)</td><td>Additional information or description of the service request - Application to raise grievances and track the progress.<br>- It allows any citizen registered in the system to raise a complaint (based on the service definition provided in the master data) for any ULB belonging to the state.</td><td>N</td></tr><tr><td>accountid</td><td>character varying (256)</td><td>userid of the user requesting the srervice - in our case it may be same as phone as we are using mobile number as the userid</td><td>N</td></tr><tr><td></td><td></td><td>This is the json object that will carry the actual input (where ever the metadata requries input)</td><td>N</td></tr><tr><td>applicationstatus</td><td>character varying (128)</td><td>The current status of the service request.</td><td>N</td></tr><tr><td>rating</td><td>smallint</td><td>Evaluation posted by the citizen on complaint resolution.</td><td>N</td></tr><tr><td>source</td><td>character varying (256)</td><td>captures the source of the service request(ex:- whatsapp, ivr, Swachhata etc)</td><td>N</td></tr><tr><td>createdby</td><td>character varying (256)</td><td>username (preferred) or userid of the user that created the object</td><td>Y</td></tr><tr><td>createdtime</td><td>bigint</td><td>epoch of the time object is created</td><td>N</td></tr><tr><td>lastmodifiedby</td><td>character varying (256)</td><td>username (preferred) or userid of the user that last modified the object</td><td>N</td></tr><tr><td>lastmodifiedtime</td><td>bigint</td><td>epoch of the time object is modified last</td><td>N</td></tr><tr><td>addressid</td><td>character varying (64)</td><td>Reference to linked address with the grievance.</td><td>N</td></tr><tr><td>phone</td><td>character varying (64)</td><td>Contact number of the individual who lodged the complaint</td><td>Y</td></tr><tr><td>status</td><td>character varying (64)</td><td>The current status of the service request</td><td>N</td></tr><tr><td>feedback</td><td>character varying (500)</td><td>Information/Comments posted by the citizen on complaint resolution.</td><td>N</td></tr></tbody></table>
{% endtab %}

{% tab title="Mapping" %}

| Attribute Name   | Mapping Details                                    |
| ---------------- | -------------------------------------------------- |
| tenantid         | services.\*.tenantId                               |
| servicecode      | services.\*.serviceCode                            |
| servicerequestid | <p>services.\*.serviceRequestId<br></p>            |
| description      | services.\*.description                            |
| accountid        | services.\*.accountId                              |
| rating           | services.\*.rating                                 |
| source           | <p>services.\*.source<br></p>                      |
| createdby        | <p>services.\*.auditDetails.createdBy<br></p>      |
| createdtime      | <p>services.\*.auditDetails.createdTime<br></p>    |
| lastmodifiedby   | <p>services.\*.auditDetails.lastModifiedBy<br></p> |
| lastmodifiedtime | services.\*.auditDetails.lastModifiedTime          |
| addressid        | <p>services.\*.addressId<br></p>                   |
| phone            | <p>services.\*.phone<br></p>                       |
| status           | services.\*.status                                 |
| feedback         | services.\*.feedback                               |
| {% endtab %}     |                                                    |
| {% endtabs %}    |                                                    |

### eg\_pgr-action

{% tabs %}
{% tab title="Description" %}
Refers to the broad steps or actions required to handle the grievances. Some steps may be optional depending on the context. This entity holds the information about the action being taken on the complaint as it goes through the redressal workflow.
{% endtab %}

{% tab title="Attributes" %}

<table><thead><tr><th>Attribute Name</th><th width="181">Data Type</th><th width="252">Definition</th><th>Mandatory (Y/N)</th></tr></thead><tbody><tr><td><mark style="background-color:red;">uuid (PK)</mark></td><td>character varying (256)</td><td>system generated id for the address</td><td>Y</td></tr><tr><td><mark style="background-color:red;">tenantid (PK)</mark></td><td>character varying (256)</td><td>Unique identifier for a tenant to which user primarily belongs</td><td>Y</td></tr><tr><td>when</td><td>bigint</td><td>EPOC timestamp on when that particular entity is created in a DB.</td><td>N</td></tr><tr><td>businesskey</td><td>character varying (256)</td><td>Connector used to reference a complaint to its action.</td><td>Y</td></tr><tr><td>status</td><td>character varying (64)</td><td>The current status of the service request</td><td>N</td></tr><tr><td>assignee</td><td>character varying (256)</td><td>The individual responsible for taking next action on a complaint</td><td>N</td></tr><tr><td>media</td><td>jsonb</td><td>Supporting evidence by citizen while lodging a complaint</td><td>N</td></tr><tr><td>comments</td><td>character varying (1024)</td><td>Additional information with respect to a grievance/ process.</td><td>N</td></tr><tr><td>action</td><td>character varying (64)</td><td>Action on the application in certain</td><td>N</td></tr></tbody></table>
{% endtab %}

{% tab title="Mapping" %}

| Attribute Name | Mapping Details                   |
| -------------- | --------------------------------- |
| uuid           | <p>actionInfo.\*.uuid<br></p>     |
| tenantid       | <p>actionInfo.\*.tenantId<br></p> |
| when           | actionInfo.\*.when                |
| businesskey    | actionInfo.\*.businessKey         |
| status         | <p>actionInfo.\*.status<br></p>   |
| assignee       | <p>actionInfo.\*.assignee<br></p> |
| media          | <p>actionInfo.\*.media<br></p>    |
| comments       | <p>actionInfo.\*.comments<br></p> |
| action         | <p>actionInfo.\*.action<br></p>   |
| {% endtab %}   |                                   |
| {% endtabs %}  |                                   |

## Mapping Constructs

![](/files/HDZaRkGCfLQJ3KmdoSB2)

[![Creative Commons License](https://i.creativecommons.org/l/by/4.0/80x15.png)](http://creativecommons.org/licenses/by/4.0/)All content on this page by [eGov Foundation ](https://egov.org.in/)is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://specs.digit.org/archived-docs/digit-urban-service-specs/public-grievance-redressal-module-standards/pgr-data-modelling-standards.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
