ID Generation (IDGen)

Overview

DIGIT's IDGen service is used to generate unique complaint IDs for every grievance recorded in the system. This ensures that each complaint is distinctly identifiable and traceable throughout its lifecycle. The IDGen service creates these IDs in a predefined format, driven by configurations stored in the Master Data Management Service (MDMS). By using IDGen, complaint records remain consistent, standardized, and easy to reference across channels (web, mobile, kiosks, or call centers).


Configure IDGen

1

Configure ID format in MDMS

  • Add your ID format in the IdFormat master data (usually inside your MDMS repo):

    Refer to the link here for details.

{
  "format": "PB-BTR-[cy:yyyy-MM-dd]-[SEQ_EG_BTR_ID]",
  "idname": "btr.registrationid"
}

Here -

  • format: Controls the structure of the generated ID.

  • idname: Unique identifier used to reference this format in your application. After adding, restart both the IDGen and MDMS services.

2

Port forward the IDGen Service

To access IDGen locally, forward its port:

kubectl port-forward <IDGEN_SERVICE_POD_NAME> 8285:8080

Now IDGen is available at: http://localhost:8285/

You can also run the IDGen service locally and set the format in application.properties if the DIGIT environment is unavailable.

3

Test the IDGen Format

🔍 Check if the ID generated matches the format you added. If not, check the MDMS config and logs.

Run this curl to test that your format is set up correctly:

curl --location --request POST 'http://localhost:8285/egov-idgen/id/_generate' \
--header 'Content-Type: application/json' \
--data-raw '{
  "RequestInfo": {
    "authToken": "REPLACE_WITH_TOKEN",
    "userInfo": {
      "id": 23299,
      "uuid": "e721639b-c095-40b3-86e2-acecb2cb6efb",
      "userName": "9337682030",
      "name": "Abhilash Seth",
      "type": "EMPLOYEE",
      "mobileNumber": "9337682030",
      "emailId": "[email protected]",
      "roles": [{
        "id": 281,
        "name": "Employee"
      }]
    }
  },
  "idRequests": [{
    "tenantId": "pg.citya",
    "idName": "pgr.servicerequestid"
  }]
}
4

Integrate IDGen into your application

In your service (e.g., getIdList), call IDGen like this:

 private List<String> getIdList(RequestInfo requestInfo, String tenantId, String idKey,
                                   String idformat, int count) {
        List<IdResponse> idResponses = idGenRepository.getId(requestInfo, tenantId, idKey, idformat, count).getIdResponses();

        if (CollectionUtils.isEmpty(idResponses))
            throw new CustomException("IDGEN ERROR", "No ids returned from idgen Service");

        return idResponses.stream()
                .map(IdResponse::getId).collect(Collectors.toList());
    }
5

Add Properties in application.properties

Ensure the following config is added to your app: properties

# IDGen Configuration

egov.idgen.host=http://localhost:8285/ # Update with your IDGen service host

egov.idgen.path=egov-idgen/id/_generate


The IDGen service automatically generates unique application numbers.


Tips

  • Always match idName with what you configured in MDMS.

  • Ensure MDMS and IDGen are restarted after changes.

  • Log or debug the IDGen call if you get an empty or incorrect response.

Last updated

Was this helpful?