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
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.
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.
Test the IDGen Format
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"
}]
}
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());
}
The IDGen service automatically generates unique application numbers.
Last updated
Was this helpful?