# Property Tax System Service Configuration

## **Overview** <a href="#overview" id="overview"></a>

The Property Tax System is one of the major applications of the eGov stack, which helps municipalities and citizens to handle property tax payments and other related functions on the property, such as assessments, mutation, and so on.

## **Pre-requisites**

* Prior knowledge of Java/J2EE.
* Prior knowledge of Spring Boot.
* Prior knowledge of REST APIs and related concepts like path parameters, headers, JSON etc.
* Prior knowledge of Git
* Prior knowledge of the demand-based systems.
* The following services should be up and running:
  * user
  * MDMS
  * Persister
  * Location
  * Localization
  * Id-Gen
  * Billing-service
  * URL-shortener

These services must be up so the Property Tax System can interact with identity, master data, persistence, billing, and UI resolution.

## **Key Functionality**

The Property Service provides multiple functionalities, starting from serving as a central repository where property information is registered for the reference of citizens and other municipality-provided services such as water connection and sewerage management.

An assessment can be done so as to calculate and pay tax on the property. The different services provided by the property services include -

* Property Registry
* Assessment
* Mutation
* Bifurcation
* Consolidation

{% hint style="info" %}
**Registry Explanation**

* The registry flow helps the Citizen/Employee to create a property in the system with the minimal information required.
* Other workflows, such as assessment or mutation, can be triggered on the existing ACTIVE Property in the registry.
* The property can be created, updated, cancelled, searched, followed by the process of Mutation and Assessment.
* The same entry in the registry can be referred to by other modules for their business purposes(Water charges).
  {% endhint %}

## **Configuration Steps**

{% stepper %}
{% step %}

### **Configure Master Data**&#x20;

The Master Data Management System (MDMS) drives master data like workflow definitions, business services, and field mappings.

* [x] Navigate to the DIGIT MDMS config repository:

  ```
  https://github.com/egovernments/egov-mdms-data/tree/DEV/data/pb/PropertyTax
  ```
* [x] Review and customise the JSON files there for:

  * Workflow definitions
  * Business services
  * State-specific master values

  This defines how property tax processes behave.
  {% endstep %}

{% step %}

### Add Persister Configuration

The Persister service needs to know how to store Property Tax records.

* Open your `persister` service config repo.
* Add the [**property-services-registry.yml**](https://github.com/egovernments/configs/blob/master/egov-persister/property-services-registry.yml) file to the Persister configs.
* This config informs Persister how to persist property registry flows and objects.
  {% endstep %}

{% step %}

### Add Workflow Configuration

Configure workflows for different Property Tax operations.

* [x] Identify the **workflow config section** in your config files.
* [x] Define keys like:

  * `is.workflow.enabled` — enable/disable workflow
  * `property.workflow.name` — workflow name
  * `property.update.workflow.name` — update workflow
  * `property.legacy.entry.workflow.name` — legacy workflow\
    Example:

  ```properties
  is.workflow.enabled=true
  property.workflow.name=PT.CREATE
  property.update.workflow.name=PT.UPDATE
  property.legacy.entry.workflow.name=PT.LEGACY
  ```
* [x] If property creation is triggered from other modules (e.g., Water & Sewerage), enable corresponding workflow objects in MDMS so the system uses the right path.

**Sample configurations**

```
{
 "tenantId": "pb",
 "moduleName": "PropertyTax",
 "PTWorkflow":[
     {
         "businessService":"PT.CREATEWITHWNS",
         "initialAction":"OPEN",
         "inWorkflowStatusAllowed":false,
         "enable":false
     },
     {
      "businessService":"PT.CREATE",
      "initialAction":"open",
      "inWorkflowStatusAllowed":true,
      "enable":true
  }
     
 ]
}
```

**Fields in the above MDMS file**

<table><thead><tr><th width="229.78515625">MDMS Fields</th><th>Description</th></tr></thead><tbody><tr><td><strong>businessService</strong></td><td>Name of workflow config</td></tr><tr><td><strong>initialAction</strong></td><td>Indicate the start(initial) action of the particular workflow mention in businessService.</td></tr><tr><td><strong>inWorkflowStatusAllowed</strong></td><td>This field indicate whether the property with application status as “<strong>inWorkflow</strong>” can be use with water and sewerage connection creation. If this field is true then for that particular use case, the property with “<strong>inWorkflow</strong>” status can be use with water and sewerage connection creation and vice versa</td></tr><tr><td><strong>enable</strong></td><td>If this filed is set as true, then the other fields associate with the particular object is use for property creation.</td></tr></tbody></table>

Below is another sample workflow config where a property is created from the Water and Sewerage module -

```
{
    "BusinessServices": [
      {
        "tenantId": "pb",
        "businessService": "PT.CREATEWITHWNS",
        "business": "PT",
        "businessServiceSla": null,
        "states": [
          {
            "sla": null,
            "state": null,
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": true,
            "isTerminateState": false,
            "isStateUpdatable": false,
            "actions": [
              {
                "action": "OPEN",
                "nextState": "INITIATED",
                "roles": [
                  "CITIZEN",
                  "WS_CEMP",
                  "SW_CEMP"
                ]
              }
            ]
          },
          {
            "sla": null,
            "state": "INITIATED",
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": true,
            "isTerminateState": false,
            "isStateUpdatable": true,
            "actions": [
              {
                "action": "SUBMIT",
                "nextState": "APPROVED",
                "roles": [
                  "EMPLOYEE",
                  "CITIZEN",
                  "SW_CEMP",
                  "WS_CEMP"
                ]
              },
              {
                "action": "BACK",
                "nextState": "INWORKFLOW",
                "roles": [
                  "EMPLOYEE",
                  "CITIZEN",
                  "SW_CEMP",
                  "WS_CEMP"
                ]
              }
            ]
          },
          {
            "sla": null,
            "state": "INWORKFLOW",
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": true,
            "isTerminateState": false,
            "isStateUpdatable": true,
            "actions": [
              {
                "action": "SUBMIT",
                "nextState": "APPROVED",
                "roles": [
                  "EMPLOYEE",
                  "CITIZEN",
                  "SW_CEMP",
                  "WS_CEMP"
                ]
              }
            ]
          },
          {
            "sla": null,
            "state": "APPROVED",
            "applicationStatus": "ACTIVE",
            "docUploadRequired": false,
            "isStartState": false,
            "isTerminateState": true,
            "isStateUpdatable": false,
            "actions": null
          }
        ]
      }
    ]
  }
```

Sample workflow config for update property

```
 {
  "RequestInfo": {
    "apiId": "Rainmaker",
    "action": "",
    "did": 1,
    "key": "",
    "msgId": "20170310130900|en_IN",
    "requesterId": "",
    "ts": 1513579888683,
    "ver": ".01",
    "authToken": "b39181b1-5c6b-484a-b825-6be2f62012b8"
  },
 "BusinessServices": [
  {
    "tenantId": "pb",
    "businessService": "PT.CREATE",
    "business": "PT",
    "businessServiceSla": null,
    "states": [
        {
            "tenantId": "pb",
            "sla": null,
            "state": null,
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": true,
            "isTerminateState": false,
            "actions": [
                {
                    "tenantId": "pb",
                    "action": "OPEN",
                    "nextState": "OPEN",
                    "roles": [
                        "CITIZEN",
                        "EMPLOYEE"
                    ]
                }
            ]
        },
        {
            "tenantId": "pb",
            "sla": null,
            "state": "OPEN",
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": true,
            "isTerminateState": false,
            "actions": [
                {
                    "tenantId": "pb",
                    "action": "VERIFY",
                    "nextState": "DOCVERIFIED",
                    "roles": [
                        "PT_DOC_VERIFIER"
                    ]
                },
                {
                  "tenantId": "pb",
                  "action": "REJECT",
                  "nextState": "REJECTED",
                  "roles": [
                      "PT_DOC_VERIFIER"
                  ]
              },
              {
                "tenantId": "pb",
                "action": "SENDBACKTOCITIZEN",
                "nextState": "CORRECTIONPENDING",
                "roles": [
                    "PT_DOC_VERIFIER"
                ]
            }
            ]
        },
        {
            "tenantId": "pb",
            "sla": null,
            "state": "DOCVERIFIED",
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": false,
            "isTerminateState": false,
            "actions": [
                {
                    "tenantId": "pb",
                    "action": "FORWARD",
                    "nextState": "FIELDVERIFIED",
                    "roles": [
                        "PT_FIELD_INSPECTOR"
                    ]
                }
            ]
        },
        {
            "tenantId": "pb",
            "sla": null,
            "state": "FIELDVERIFIED",
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": false,
            "isTerminateState": false,
            "actions": [
                {
                    "tenantId": "pb",
                    "action": "APPROVE",
                    "nextState": "APPROVED",
                    "roles": [
                        "PT_APPROVER"
                    ]
                },
                {
                    "tenantId": "pb",
                    "action": "REJECT",
                    "nextState": "REJECTED",
                    "roles": [
                        "PT_APPROVER"
                    ]
                }
            ]
        },
        {
            "tenantId": "pb",
            "sla": null,
            "state": "REJECTED",
            "applicationStatus": "INACTIVE",
            "docUploadRequired": false,
            "isStartState": false,
            "isTerminateState": true,
            "actions": null
        },
        {
            "tenantId": "pb",
            "sla": null,
            "state": "APPROVED",
            "applicationStatus": "ACTIVE",
            "docUploadRequired": false,
            "isStartState": false,
            "isTerminateState": true,
            "actions": null
        },
        {
          "tenantId": "pb",
          "sla": null,
          "state": "CORRECTIONPENDING",
          "applicationStatus": "INWORKFLOW",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
              {
                  "tenantId": "pb",
                  "action": "REOPEN",
                  "nextState": "OPEN",
                  "roles": [
                    "CITIZEN",
                    "PT_CEMP"
                  ]
              },
              {
                  "tenantId": "pb",
                  "action": "REJECT",
                  "nextState": "REJECTED",
                  "roles": [
                    "CITIZEN",
                    "PT_CEMP"
                  ]
              }
          ]
      }
    ]
}
  ]
}	
```

Sample property tax legacy workflow config&#x20;

```
{
    "RequestInfo": {
      "apiId": "Rainmaker",
      "action": "",
      "did": 1,
      "key": "",
      "msgId": "20170310130900|en_IN",
      "requesterId": "",
      "ts": 1513579888683,
      "ver": ".01",
      "authToken": "{{authToken_amritsar}}"
    },
    "BusinessServices": [
      {
        "tenantId": "pb",
        "businessService": "PT.LEGACY",
        "business": "PT",
        "businessServiceSla": null,
        "states": [
          {
            "tenantId": "pb",
            "sla": null,
            "state": null,
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": true,
            "isTerminateState": false,
            "actions": [
              {
                "tenantId": "pb",
                "action": "OPEN",
                "nextState": "APPROVALPENDING",
                "roles": [
                  "CITIZEN",
                  "EMPLOYEE"
                ]
              }
            ]
          },
          {
            "tenantId": "pb",
            "sla": null,
            "state": "APPROVALPENDING",
            "applicationStatus": "INWORKFLOW",
            "docUploadRequired": false,
            "isStartState": true,
            "isTerminateState": false,
            "actions": [
              {
                "tenantId": "pb",
                "action": "APPROVE",
                "nextState": "APPROVED",
                "roles": [
                  "EMPLOYEE"
                ]
              },
              {
                "tenantId": "pb",
                "action": "REJECT",
                "nextState": "REJECTED",
                "roles": [
                  "EMPLOYEE"
                ]
              }
            ]
          },
          {
            "tenantId": "pb",
            "sla": null,
            "state": "REJECTED",
            "applicationStatus": "INACTIVE",
            "docUploadRequired": false,
            "isStartState": false,
            "isTerminateState": true,
            "actions": null
          },
          {
            "tenantId": "pb",
            "sla": null,
            "state": "APPROVED",
            "applicationStatus": "INACTIVE",
            "docUploadRequired": false,
            "isStartState": false,
            "isTerminateState": true,
            "actions": null
          }
        ]
      }
    ]
  }
```

{% endstep %}

{% step %}

### Setup Notifications

Configure notification settings to keep citizens/employees informed:

* [x] In your notification config:

  ```properties
  notif.sms.enabled=true
  ```
* [x] Add notification URL templates, for example:

  ```properties
  egov.notif.view.property = citizen/property-tax/my-properties/property/{PROPERTYID}/{TENANTID}
  egov.notif.view.mutation = citizen/pt-mutation/search-preview?applicationNumber={APPID}&tenantId={TENANTID}
  egov.notif.commonpay = citizen/egov-common/pay?consumerCode={CONSUMERCODE}&tenantId={TENANTID}
  ```
* [x] Define notification messages and message localisation keys (sample localisation given below).

```
[
        {
            "code": "PT_NOTIF_WF_STATE_LOCALE_OPEN",
            "message": "Open",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_STATE_LOCALE_DOCVERIFIED",
            "message": "Document Verified",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_STATE_LOCALE_FIELDVERIFIED",
            "message": "Field verified",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_STATE_LOCALE_APPROVED",
            "message": "Approved",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_STATE_LOCALE_REJECTED",
            "message": "Rejected",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_STATE_LOCALE_PAID",
            "message": "Paid",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_MT_OPEN",
            "message": "Dear {OWNER_NAME}, Your application to edit ownership details of property ID {PROPERTYID} has been submitted successfully. Your application no. for future reference is {APPID}. You can track your application on the link given below - {MTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_MT_STATE_CHANGE",
            "message": "Dear {OWNER_NAME}, Status for your application no. {APPID} for property {PROPERTYID} to edit ownership has been changed to {STATUS}. You can track your application on the link given below - {MTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_MT_PAYMENT_PENDING",
            "message": "Dear {OWNER_NAME}, Payment is pending for your application no. {APPID} for property ID {PROPERTYID} to edit ownership. You can pay your mutation fee on the below link - {PAYLINK} or visit your ULB to pay your dues. Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_MT_PAID",
            "message": "Dear {OWNER_NAME}, You’ve successfully paid mutation fee - INR {AMOUNT} for application no. {APPID} for property ID {PROPERTYID}. You can download your receipt on the below link - {MTURL} Thank you ",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_MT_APPROVED",
            "message": "Dear {OWNER_NAME}, Your property ownership has been changed as per the application no. {APPID} for property {PROPERTYID}. You can download your mutation certificate on the below link - {MTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_MT_NONE",
            "message": "Dear {OWNER_NAME}, Your property with property-id {PROPERTYID} has been mutated. You can view your property on the link given below - {MTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_OPEN",
            "message": "Dear {OWNER_NAME}, Your application to {updated/created} property with Id {PROPERTYID} has been submitted successfully. Your application no. for future reference is {APPID}. You can track your application on the link given below - {PTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_STATUS_CHANGE",
            "message": "Dear {OWNER_NAME}, Status for your application no. {APPID} for property {PROPERTYID} to {updated/created} property has been changed to {STATUS}. You can track your application on the link given below - {PTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_APPROVED",
            "message": "Dear {OWNER_NAME}, Your property has been {updated/created} as per the application no. {APPID} for property {PROPERTYID}. You can view your property on the link given below - {PTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        },
        {
            "code": "PT_NOTIF_WF_UPDATE_NONE",
            "message": "Dear {OWNER_NAME}, Your property with property-id {PROPERTYID} has been {updated/created}. You can view your property on the link given below - {PTURL} Thank you",
            "module": "rainmaker-pt",
            "locale": "en_IN"
        }
    ]
```

{% endstep %}

{% step %}

### Define Application Properties

Define important ID-generation and search parameter formats in your `app.properties` file:

```properties
egov.idgen.ack.format=PB-AC-[cy:yyyy-MM-dd]-[SEQ_EG_PT_ACK]
egov.idgen.mutation.format=PB-MT-[CITY]-[SEQ_EG_PT_MUTATION]
egov.idgen.assm.format=PB-AS-[cy:yyyy-MM-dd]-[SEQ_EG_PT_ASSM]
egov.idgen.ptid.format=PB-PT-[cy:yyyy-MM-dd]-[SEQ_EG_PT_PTID]

citizen.allowed.search.params=accountId,ids,propertyDetailids,mobileNumber,oldpropertyids
employee.allowed.search.params=accountId,ids,propertyDetailids,mobileNumber,oldpropertyids
```

These formats ensure unique references for property, assessment, and mutations.
{% endstep %}

{% step %}

### Configure Integrations

#### Integration Scope <a href="#integration-scope" id="integration-scope"></a>

Property service can be integrated with any organisation or system that wants to maintain a record of the property and collect taxes with ease.

#### Integration Benefits

* Easy to create and a simple process of self-assessment to avoid the hassle.
* Helps maintain property data which can be used in the integration of other essential services like asset management, water connection and so on.
* provides additional functionalities like mutation, assessment of properties.

#### Steps to Integration

To let external systems use the PT service:

* [x] Provide API access for:
  * **Create property:** `/property/_create`
  * **Search property:** `/property/_search`
  * **Update property:** `/property/_update`
* [x] The same update endpoint supports mutation actions.
* [x] Ensure other systems handle the workflow status appropriately (e.g., water connection or asset systems).
  {% endstep %}
  {% endstepper %}

## **Reference Docs**

<table><thead><tr><th width="240.2265625">Title</th><th>Link</th></tr></thead><tbody><tr><td>USER Service</td><td><a href="https://docs.digit.org/platform/platform/core-services/user">User Service</a></td></tr><tr><td>url-shortening</td><td><a href="https://docs.digit.org/platform/platform/core-services/url-shortening-service">URL Shortening service</a></td></tr><tr><td>MDMS</td><td><a href="https://docs.digit.org/platform/platform/core-services/mdms-v2-master-data-management-service">MDMS (Master Data Management Service)</a></td></tr><tr><td>Billing-service</td><td><a href="../../../deploy/configure-digit/services-overview/business-services/billing-service">Billing Service</a></td></tr><tr><td>Location</td><td><a href="https://docs.digit.org/platform/platform/core-services/location">Location Service</a></td></tr><tr><td>Workflow</td><td><a href="https://docs.digit.org/platform/platform/core-services/workflow">Workflow Service</a></td></tr><tr><td>Persister</td><td><a href="https://docs.digit.org/platform/platform/core-services/persister-service">Persister Service</a></td></tr><tr><td>Localisation</td><td><a href="https://docs.digit.org/platform/platform/core-services/localization-service">Localisation Service</a></td></tr><tr><td>Id-Gen service</td><td><a href="https://docs.digit.org/platform/platform/core-services/id-generation-service">ID-Gen Service</a></td></tr></tbody></table>

**API LIST:**

<table><thead><tr><th width="193.47265625">Title</th><th>Link</th></tr></thead><tbody><tr><td>/Property/_create</td><td><a href="https://www.getpostman.com/collections/02d01e7b46c79c140863">https://www.getpostman.com/collections/02d01e7b46c79c140863</a></td></tr><tr><td>/Property/_update</td><td><a href="https://www.getpostman.com/collections/02d01e7b46c79c140863">https://www.getpostman.com/collections/02d01e7b46c79c140863</a></td></tr><tr><td>/property/_search</td><td><a href="https://www.getpostman.com/collections/02d01e7b46c79c140863">https://www.getpostman.com/collections/02d01e7b46c79c140863</a></td></tr></tbody></table>
