Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

INTRODUCTION:

In a bid to avoid unnecessary repetition of codes which generates ids and to have central control over the logic so that burden of maintenance is reduced from the developers.
To create a config based application which can be used without writing even a single line of coding.

...

By default the IDGen service reads will now read it configuration from DBMDMS. DB Configuration requires access to the DB, so the new preferred method for the configuration is to use MDMS. The configuration needs to be stored in common-masters/IdFormat.json in MDMS

It is recommended to have the IdFormat as a state level master. To enable disable the configuration to be read from MDMSDB instead, the environment variable IDFORMAT_FROM_MDMS should be set to true false


ID-FORMAT-REPLACEABLES:

[FY:] -  represents financial year, the string will be replaced by the value of starting year and last two numbers of ending year separated by a hyphen. For eg: 2018-19 incase of financial year 2018 to 2019.

...

If you want a state level sequence then you need use a fixed sequence name

{
"format": "PT/[CITY.CODE]/[fy:yyyy-yy]/[SEQ_RCPT_PT_RECEIPT]",
"idname": "pt.receipt.id"
}

But if you want a ULB level sequence, the sequence name should be dynamic based on the tenantid as given in below example

{
"format": "PT/[CITY.CODE]/[fy:yyyy-yy]/[SEQ_RCPT_PT_[TENANT_ID]]",
"idname": "pt.receipt.id"
}

SEQUENCES AND THEIR CREATION:

...

You can add count parameter to the json request to create multiple ids

{
  "idRequests": [{
   "idName": "pt.receipt.id",
   "tenantId": "pb.jalandhar",
   "format": "PT/[SEQ_PT_RECEIPT_ID]",
   "count": 4
   }]
}