Skip to content

Commit

Permalink
GITBOOK-1200: No subject
Browse files Browse the repository at this point in the history
  • Loading branch information
venky-ganapathy authored and gitbook-bot committed Dec 3, 2024
1 parent 6ebf9b9 commit 006c838
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions social-registry/features/unique-social-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ OpenG2P's Social Registry supports the feature of generating randomized unique I

{% embed url="https://docs.mosip.io/1.2.0/modules/commons/id-generator" %}

{% embed url="https://miro.com/app/board/uXjVKsusfaU=/?share_link_id=212808513356" %}
### Design & Implementation

{% embed url="https://miro.com/app/board/uXjVLEvaZAs=/" %}

### Technical design

* It is implemented as an [Odoo](https://www.odoo.com/documentation/17.0/) module.
* It involves two new table creation. 
* **g2p.reference.id.config** table for the Configurations.
* **g2p.pending.reference\_id** table for storing the registrant if reference ID is not generated for them.
* The ID generation is implemented in an asynchronous pattern
* New Registrants are inserted into a table — g2p\_que\_id\_generation - with status = PENDING
* The celery beat producer - a cron based beat producer - periodically scans this table for PENDING records and emits the registrant IDs one by one
* The celery workers listening on this beat - pick up these registrant IDs - Each worker picks up one registrant ID at a time
* To scale, the celery worker POD can be spawned into multiple PODs
* The worker requests MOSIP ID Generator for an ID and on receipt of the ID - updates the res\_partner table in the Social Registry Postgre Database - "res\_partner.unique\_id". The worker also updates the g2p\_que\_id\_generation.status to "COMPLETED"
* Any failure during this process, the worker updates the g2p\_que\_id\_generation - retry attempts. If the attempts cross a specified threshold, the g2p\_que\_id\_generation - status is updated as FAILED
* Till the g2p\_que\_id\_generation - status is updated to FAILED, the beat producer will regularly pick up that record for retries

### Source Code

WIP

### Dependencies
[openg2p-social-registry-bg-tasks](https://github.com/OpenG2P/openg2p-social-registry-bg-tasks)

It requires the MOSIP [id-generator](https://docs.mosip.io/1.1.5/modules/kernel/uin-and-vid-generation-service-functionality) service.
[openg2p-social-registry-bg-tasks-deployment](https://github.com/OpenG2P/openg2p-social-registry-bg-tasks-deployment)

0 comments on commit 006c838

Please sign in to comment.