G2PRegisterDefinition
g2p_register_definitions - the principal metadata information on Registers
This table - g2p_register_definitions - stores the core metadata definition for all register types within the platform.
Every dataset in the registry whether it is a REGISTER, TABLE, PROGRAM_REGISTER, or CORE_TABLE must have a corresponding entry in this table.
Core Attributes
register_id
Primary key of the table. Uniquely identifies a register definition.
register_mnemonic
Short name for the register. This is a critical configuration field. The platform dynamically derives the underlying models, history models, and service classes based on this mnemonic.
register_subject
A short label describing the subject or entity represented by the register.
register_description
A detailed description of the purpose of the register.
Dynamic Class Resolution
The platform dynamically constructs class names based on the register_mnemonic.
ORM Model
G2PRegister{Mnemonic}
History Model
G2PRegisterHistory{Mnemonic}
Domain Service
G2PRegisterDomainService{Mnemonic}
For example, if the register mnemonic is PrimarySubject, the platform resolves:
ORM Model
G2PRegisterPrimarySubject
History Model
G2PRegisterHistoryPrimarySubject
Domain Service
G2PRegisterDomainServicePrimarySubject
This mechanism allows the platform to load domain-specific implementations dynamically.
Register Hierarchy Configuration
master_register_id
Defines hierarchical relationships between registers and tables.
For example:
Group register
None
Primary subject register
Group register
Child table
Primary subject register
This hierarchy enables the platform to understand parent-child relationships between datasets.
Register Display Configuration
register_rank
Determines the order in which registers appear in UI dropdowns. Registers with a lower rank value appear higher in the list.
register_icon
UI icon associated with the register.
has_image
Indicates whether records in the register include image attributes.
Register Type Configuration
register_purpose
Classification of the register: REGISTER, TABLE, PROGRAM_REGISTER, or CORE_TABLE.
Program Register Configuration
Applicable only when register_purpose is PROGRAM_REGISTER.
program_id
Identifier of the benefit program associated with the program register.
program_mnemonic
Short mnemonic representing the benefit program.
ID Generation Configuration
functional_id_generation_required
Indicates whether the platform should generate a functional identifier for records in this register.
Deduplication Configuration
dedup_is_enabled
Indicates whether deduplication should be applied to the register.
dedup_threshold_score
Threshold score used by the deduplication algorithm to classify potential duplicates.
The attributes used for deduplication are defined as JSON in g2p_register_schemas.
Completion Score Configuration
completion_score_required
Indicates whether section completion scores must be computed for records in this register.
Registrant Authentication Configuration
requires_registrant_authentication
Indicates whether registrants must authenticate before interacting with records in this register.
registrant_authentication_validity_days
Number of days a registrant authentication remains valid.
registrant_re_auth_warning_days_before
Number of days before authentication expiry when a re-authentication warning is shown.
Reference Implementation
A reference implementation of the register metadata configuration can be found in the Farmer Registry extension.
The SQL script that initializes the g2p_register_definition table and other registry metadata is available in the OpenG2P Registry Extensions repository — Farmer Extension.
The g2p_register_definition database script for Farmer Registry is available here.
Last updated
Was this helpful?