- 1. Sample Seed Data
- 2. Steps to add seed data
- 2.1 Create roles in LDAP
- 2.2 Create a Registration Center
- 2.3 Create a Machine
- 2.4 Create a User
- 2.5 Create a Device
- 2.6 Map the User to a Zone
- 2.7 Map the Machine to a Center
- 2.8 Map the User to a Center
- 2.9 Map the Device to a Center
- 2.10 Map Center-Machine-Device
- 2.11 Map Center-Machine-User
- 2.12 Store History of MasterData
- 3. Load updated CSVs to the database using dml sql script
- Registration Centers: master-registration_center
- Machines: master-machine_master
- Users: master-user_detail
- Devices: master-device_master
- Center-Machine Mapping: master-reg_center_machine
- Center-Device Mapping: master-reg_center_device
- Center-User Mapping: master-reg_center_user
- Center-Machine-Device Mapping: master-reg_center_user_machine
- Center Machine User Mapping: master-reg_center_machine_device
- User Zone Mapping: master-zone_user
Before creating the Masterdata, Roles used across MOSIP are needed to be created in LDAP.
Following roles have to be created using the process as mentioned above.(Refer here for help on how to create roles in LDAP.)
- REGISTRATION_ADMIN
- REGISTRATION_SUPERVISOR
- REGISTRATION_OFFICER
- ZONAL_ADMIN
- GLOBAL_ADMIN
- AUTH
- PREREG
- REGISTRATION_PROCESSOR
- ID_AUTHENTICATION
- PRE_REGISTRATION_ADMIN
- Center ID: This should be a 5-digit ID and should be in an incremental sequence for each center added. The sequence should start from 10000. Keeping the length other than 5 digits will fail validations as the same Center ID is used to generate the Request ID (Registration ID). For each Center created, Center ID should be incremented sequentially to avoid inconsistency in data.
- Center Name: Country defined name for the Center
- Center Type Code: (Should be kept as “REG”). Center Type Code will come from a Center Type Masterdata which currently have one center Type defined as “Regular” and Code as “REG”. More Center Types can be defined by the country in the Center Type Masterdata.
- Address Line 1: It is an Optional Field but should be defined to be visible to the resident on the Pre-Registration UI
- Address Line 2: It is an Optional Field
- Address Line 3: It is an Optional Field
- Latitude: Should be defined in format XX.XXXX. minimum 4 digits are need after the decimal for the accuracy to be atleast 11 meters on the GPS map on Pre-Registration Portal
- Longitude: Should be defined in format XX.XXXX. minimum 4 digits are need after the decimal for the accuracy to be atleast 11 meters on the GPS map on Pre-Registration Portal
- Location Code: Maps the Registration Center to a Location. Should be a location code referring to a location defined in the location Masterdata table. Should always be the code of the location which is at the lowest hierarchy level
- Contact Phone: An optional field. Usually a point of contact for a Registration Center
- Contact Person: Name of the person who is a point of contact for a Registration Center
- Number of Kiosk: Number of Registration Kiosk a Registration Center will have to register residents. This number is used by the pre-registration to calculate appointment slots for Registration. This should always be equal to the number of machines assigned to the Center or will be assigned to the Center. Refer point 2.5 in steps below
- Working Hours: Should be the difference of “Center Start Time” and “Center End Time”. Should be in format hh:mm:ss
- Per Kiosk Processing time: Duration of Registration Appointment defined as per the country requirement. This attribute is used by pre-Registration to calculate appointment slots. Should be in format hh:mm:ss
- Center Start Time: Time when Center would start taking registration of Residents. This time is used by Pre-Registration to calculate appointment slots. Should be in format hh:mm:ss
- Center End Time: Time when the Center closes. This time is used by Pre-Registration to calculate appointment slots. Should be in format hh:mm:ss
- Lunch Start Time: Starting of Lunch Time the Center would have in-between the Working hours. It is used by Pre-Registration to calculate appointment slots. Should be in format hh:mm:ss
- Lunch End Time: Ending of Lunch Time the Center would have in-between the Working hours. It is used by Pre-Registration to calculate appointment slots. Should be in format hh:mm:ss
- Time Zone: (GTM+01:00) CENTRAL EUROPEAN TIME
- Holiday Location Code: Refers to the location to which country defined holidays are mapped in holiday location table. Should come from the Holiday master table. Current values can only be “KTA” or “RBT” as holidays are only defined for these two location codes.
- Zone Code: Contains the Zone code to which the Registration Center should be tagged to. The Administrative Zones are defined by a country to better manage the resources(Centers, Machines and Devices) used in Registration Process. These are defined in Masterdata table 'zone' in hierarchical fashion similar to Location masterdata
- Language Code: Should be the language code for the languages supported by the Country as primary/secondary Language. (E.g English - eng, French - fra, Arabic - ara)
- Is_Active: TRUE. If set as false, this Registration will not be shown up in Pre-Registration UI and no appointments will be generated for this Center
- Cr_by:
<username>
ideally name of the admin - cr_dtimes: The time at which the Center is getting created
Note: A Registration Center is needed to be created in all the languages supported by the country. if a country supports primary language as French and Secondary language as arabic, create the same registration center twice. One with language code as fra for French and one with language code as ara for Arabic. Center ID should be same for both the records as both the records are for one center only.
- Machine ID: This should be a 5-digit ID and Ideally should be in an incremental sequence for each machine added. The sequence should start from 10000. Keeping length other than 5 digits will fail validations as the same Machine ID is used to generate the Request ID(Registration ID)
- Machine Name: Machine Host name
- Machine Mac-Address: Machine’s Mac-Address
- Serial Number:
<serial number of machine>
- IP Address: Leave it blank
- Mspecid: 1001. These values come from a Machine Spec table. Putting any value other than these will throw an error
- Zone Code: Should come from a pre-defined list of Administrative Zone codes created in Zone Masterdata. Current values can be “RBT”, “KTA”, “SAL”, “BSN”, “CSB”, ”STT”, ”NDR”, ”BRK”, “JRD”, “SAF“, “YSF“, “TTA“, “TZT”.
- Lang_code: eng
- Is_active: True
- cr_by:
<username>
ideally name of the admin' - cr_dtimes: now()
- Create a User in LDAP (User ID/Password)
- Create a User in DB
- Id: ID used in LDAP
- UIN: Leave it black
- Email: Email used in LDAP
- Mobile: Mobile used in LDAP
- Status Code: ACT
- Lang_code: eng
- last_login_method: PWD
- Is_active: True
- cr_by:
<username>
ideally name of the admin - cr_dtimes: now()
- Device ID: This can be a random ID.
- Device Name:
<Name of the device>
- Device Mac-Address:
<mac-address of device>
- Serial Number:
<serial number of device>
- IP Address: Leave it blank
- Dspecid: Can be either 165(fingerprint scanner), 327 (iris scanner), 736(web camera), 801(Document scanner) or 920(Printer). These values come from a Device Spec table. Putting any value other than these will throw an error
- Zone Code: Should come from a pre-defined list of Administrative Zone codes created in Zone Masterdata. Current values can be “RBT”, “KTA”, “SAL”, “BSN”, “CSB”, ”STT”, ”NDR”, ”BRK”, “JRD”, “SAF“, “YSF“, “TTA“, “TZT”.”
- Lang_code: eng
- Is_active: True
- cr_by:
<username>
ideally name of the admin - cr_dtimes: now()
- User ID: from master_userdetail
- Zone_code: Should come from a pre-defined list of Administrative Zone codes created in Zone Masterdata. Current values can be “RBT”, “KTA”, “SAL”, “BSN”, “CSB”, ”STT”, ”NDR”, ”BRK”, “JRD”, “SAF“, “YSF“, “TTA“, “TZT”.”
Note: While mapping Machine, User, Device to a Center in points 2.6, 2.7, 2.8, 2.9, 2.10, these resources should belong to the same zone code. For example, while mapping a machine to a Center, both machine and a center should belong to same zone.
- Center ID: from master-registration_center
- Machine ID: from master-machine_master (newly created machine)
- Lang_code: eng
- Is_active: True
- cr_by:
<username>
ideally name of the admin - cr_dtimes: now()
Follow the above example in point 2.4.
Follow the above example in point 2.4.
Follow the above example in point 2.4.
Follow the above example in point 2.4.
After adding all these data in the DB, we would need to create the same records in all the History tables for every table mentioned in the “Tables Names” section.
- Each history table has an extra attribute “effective date” other than the standard attributes mentioned for each table.
- The Effective date should be now().and all the attributes should be same as they are stored in the standard tables.
- Find the table names below for history tables
- Registration Centers: master-registration_center_h
- Machines: master-machine_master_h
- Users: master-user_detail_h
- Devices: master-device_master_h
- Center-Machine Mapping: master-reg_center_machine_h
- Center-Device Mapping: master-reg_center_device_h
- Center-User Mapping: master-reg_center_user_h
- Center-Machine-Device Mapping: master-reg_center_user_machine_h
- Center Machine User Mapping: master-reg_center_machine_device_h
- User Zone Mapping: master-zone_user_h
Run dml sql scripts on DB server where master seed data needs to be updates.
mosip_master=#\ir '/mosip/mosip-platform/blob/master/db_scripts/mosip_master/mosip_master_dml_deploy.sql'