# Update Mobile & Alternate Numbers

## Overview <a href="#update-mobile-number-feature-provides-following" id="update-mobile-number-feature-provides-following"></a>

The **PT Update Number & Alternate Number** feature enables secure management of mobile contact details associated with a property in the DIGIT Property Tax system. It allows both **citizens and ULB employees** to correct or enhance owner contact information to ensure reliable communication, authentication, and service delivery.

## Key Functionalities

The functionality supports:

* **Updating the primary mobile number** when the existing number is invalid, outdated, or inaccessible.
* **Adding an alternate mobile number** as a secondary contact for notifications and login-related use cases.

The feature is tightly integrated with **MDMS-based validation rules**, **OTP-based verification**, and **role-based access controls** to maintain data integrity and security. Employee-driven updates can be supported with document uploads, while citizen-driven updates rely on OTP verification through the user service.

Overall, this capability improves data accuracy, reduces service disruption due to incorrect contact details, and enhances the usability of the Property Tax system for both citizens and administrators.

## Configuration Steps

{% stepper %}
{% step %}

### Configure MDMS

The MDMS drives validation rules and mobile number behaviour.

**Configure an `UpdateNumber` section in MDMS**

In your MDMS config for the **PropertyTax** module, include an **UpdateNumber** entry:

```json
"MdmsCriteria": {
  "tenantId": "pb",
  "moduleDetails": [
    {
      "moduleName": "PropertyTax",
      "masterDetails": [
        {
          "name": "UpdateNumber"
        }
      ]
    }
  ]
}
```

**Sample MDMS Response values:**

* `invalidNumber`: e.g., `"9999999999"`
* `invalidPattern`: Regex like `"^[6789][0-9]{9}$"`&#x20;
* `skipEnabled`, `warningEnabled` flags
* `documents`: list of documents required (can be empty)

This config tells the UI which numbers are invalid and how to validate new numbers.
{% endstep %}

{% step %}

### API Endpoints

Use these Property Tax APIs for updating numbers:

<table><thead><tr><th width="247.046875">Purpose</th><th>API Endpoint</th></tr></thead><tbody><tr><td>Update main mobile number</td><td><code>property-services/property/_update</code></td></tr><tr><td>Add alternate mobile number</td><td><code>property-services/property/_addAlternateNumber</code></td></tr></tbody></table>
{% endstep %}

{% step %}

### Steps to Update Primary Mobile Number

* User clicks **Edit** next to the existing owner's mobile number (in UI).
* A pop-up appears asking for the **new mobile number**.
* Click **Send OTP** → API sends OTP via `user-otp/v1/_send` for login.
* If the OTP send fails because the number isn’t registered, try with **type=register** to create the user.
* Enter the OTP — it verifies and validates the user.
* On success, the system triggers the **property update** call to persist the new number.
  * The API updates `owner.mobileNumber`.

{% hint style="info" %}
**Notes:**

* Employee roles must upload supporting documents in the pop-up before proceeding.
* Employee updates skip the OTP send/verify steps because ownership validation is assumed.
  {% endhint %}
  {% endstep %}

{% step %}

### Add or Update Alternate Mobile Number

1. Click **Add Alternate Number** in the property UI.
2. A pop-up opens to enter the new number.
3. The system sends OTP to the **registered primary number** via `user-otp/v1/_send`.
4. Upon OTP validation, the system triggers:
   * **property-services/property/\_addAlternateNumber**, and
   * Sets `owner.alternateMobileNumber`

This allows an additional contact, useful for notifications or multi-contact alerts.
{% endstep %}

{% step %}

### Configure Roles & Action Mapping

Ensure roles have permissions mapped to these API operations:

| API                                              | Action ID | Roles             |
| ------------------------------------------------ | --------- | ----------------- |
| `property-services/property/_addAlternateNumber` | 870       | CITIZEN, PT\_CEMP |
| `property-services/property/_update`             | 954       | CITIZEN, PT\_CEMP |
| `user-otp/v1/_send`                              | 1531      | CITIZEN           |
| `property-services/property/_search`             | 1897      | CITIZEN, PT\_CEMP |

Configure these in your role-action management so that both citizens and employees can perform these updates securely.
{% endstep %}
{% endstepper %}
