Every database action needed to populate the EKYC 3.0 new codebase with data from old system, external sources, and config
These tables need automated pipelines that run on a schedule. Entity + table already exist. You need to build the ETL/sync code + schedule it.
| # | New Table | Old Source | Frequency | Columns to Sync | Used In | Action | |
|---|---|---|---|---|---|---|---|
| 1 | client_master |
MOSL_FEED_CLIENT_DETAILS |
Daily | ClientCode, PanHash, Mobile, Email, ClientName, ProductType, ClCode, IsActive, InactiveDate, BranchCode, Segments | Stage 1 | BUILD SYNC JOB | |
| 2 | branch_master |
MOSL_FEED_BRANCH |
Daily | BranchCode, Mobile, BaEmail, CorrEmail, PanHash, Code1200 | Stage 1 | BUILD SYNC JOB | |
| 3 | subbroker_master |
MOSL_FEED_SUBBROKERS |
Daily | SubbrokerCode, Mobile, BaEmail, CorrEmail, PanHash, Code1200 | Stage 1 | BUILD SYNC JOB | |
| 4 | employee_pan_master |
MOSL_SDLC_EMPLOYEEDETAILS |
Daily | PanHash, EmpName, EmpActiveStatus, ResignedRaisedOn, HrStatus, DepartmentStatus | Stage 4 | BUILD SYNC JOB | |
| 5 | franchise_pan_whitelist |
Franchise ops team (manual CSV) | On-demand | PanHash, FranchiseName, Mobile, PanType | Stage 4 | BUILD SYNC JOB | |
| 6 | negative_list_entries |
TBL_FFF_NOT_ALLOW + SEBI debarred list |
Daily + SEBI trigger | IdentifierType (MOBILE/PAN/IP), IdentifierHash, Source (MOFSL/SEBI), Reason, ExpiresAt | Stage 1 | BUILD SYNC JOB | |
| 7 | bank_ifsc_master |
RBI IFSC directory | Monthly | IfscCode, BankName, BranchName, MicrCode, City, State | Stage 6 | BUILD SYNC JOB |
api_audit_logs, (5) run via cron or Hangfire on schedule shown above.
These tables need a one-time data migration from old system tables or manual entry from BRD docs. Entity + table already exist. Run the migration SQL once.
| # | New Table | Copy From | Key Columns | Used In | Row Est. | Action | |
|---|---|---|---|---|---|---|---|
| 8 | restricted_mobiles |
Ops / Compliance team list | Mobile, MobileHash, Reason, IsActive | Stage 1 | ~50-200 | ONE-TIME LOAD | |
| 9 | restricted_email_domains |
TBL_RESTRICT_EMAIL_DOMAIN |
Domain, Reason, IsActive | Stage 3 | ~100-500 | ONE-TIME LOAD | |
| 10 | suspicious_contacts |
Usp_GetSuspiciousPhoneOrEMailId source |
IdentifierHash, IdentifierType, Reason | Stage 1, 3 | ~500-2K | ONE-TIME LOAD | |
| 11 | duplicate_bypass_whitelist |
TBL_PAN_MOBILE_EMAIL_WHITELIST |
PanHash, Mobile, Email, Reason, IsActive | Stage 1 | ~100-1K | ONE-TIME LOAD | |
| 12 | allowed_email_domains |
TBL_ALLOW_EMAIL |
Domain, Reason, IsActive | Stage 3 | ~50-200 | ONE-TIME LOAD | |
| 13 | location_exception_whitelist |
TBL_LIVE_PHOTO_LOCATION_EXCEPTION |
PanHash, Reason, IsActive | Stage 7 | ~10-50 | ONE-TIME LOAD | |
| 14 | referral_codes |
MOSL_FEED_CLIENT_DETAILS.CL_code + marketing |
Code, ReferrerName, Channel, IsActive, ExpiresAt | Stage 0-1 | ~1K-10K | ONE-TIME LOAD | |
| 15 | state_master |
TBL_STATE_CITY_MASTER_LSQ |
StateCode, StateName, IsSouth | Stage 0, 9 | ~36 | ONE-TIME LOAD | |
| 16 | city_master |
MST_CITY_STATE |
CityName, StateCode, IsMetro | Stage 0, 9 | ~5K | ONE-TIME LOAD | |
| 17 | pincode_master |
India Post / old pincode table | Pincode, City, District, State, StateCode | Stage 9 | ~30K | ONE-TIME LOAD |
These tables already have seed SQL scripts in backend/database/. The data is config/BRD-derived and doesn't need old DB access. Just execute the scripts.
| # | New Table | Seed Script | Content | Used In | Action | |
|---|---|---|---|---|---|---|
| 18 | lookups(= personal_field_master) |
03_seed_data.sql + 11_seed_lookups.sql |
12 categories: OCCUPATION, EDUCATION, ANNUAL_INCOME, MARITAL_STATUS, NOMINEE_RELATIONSHIP, GENDER, INVESTMENT_EXPERIENCE, SETTLEMENT_PREFERENCE, DIS_BOOKLET, MTF, RELATION, GUARDIAN_RELATIONSHIP | Stage 9 | SEED SQL EXISTS | |
| 19 | cvl_status_mapping |
03_seed_data.sql |
KRA_VALIDATED, KRA_MOD, NON_KRA, RESTRICTED, INVALID_PAN mappings from CVL raw codes | Stage 2 | SEED SQL EXISTS | |
| 20 | nsdl_error_master |
03_seed_data.sql |
NSDL error codes, messages, IsFatal flag | Stage 2, 4 | SEED SQL EXISTS | |
| 21 | application_config |
03_seed_data.sql |
STP thresholds, feature flags, campaign routing, toggle keys | All stages | SEED SQL EXISTS | |
| 22 | provider_configurations |
03_seed_data.sql |
External provider URLs, timeouts, retries, priority rankings | All stages | SEED SQL EXISTS |
Sample SQL to migrate data from old tables into new tables. Adapt connection/schema as needed.
| Phase | When | Tables | Action |
|---|---|---|---|
| Phase 0 Before go-live |
Day 1 (dev env) | lookups, cvl_status_mapping, nsdl_error_master, application_config, provider_configurations |
Run 01_create_tables.sql → 02_create_indexes.sql → 03_seed_data.sql → 11_seed_lookups.sql |
| Phase 1 One-time migrations |
After old DB access granted | state_master, city_master, pincode_master, restricted_email_domains, allowed_email_domains, restricted_mobiles, suspicious_contacts, duplicate_bypass_whitelist, location_exception_whitelist, referral_codes |
Export CSVs from old DB → run migration SQLs from Section D above |
| Phase 2 Build sync pipelines |
Before UAT | client_master, branch_master, subbroker_master, employee_pan_master, franchise_pan_whitelist |
Build daily sync jobs (Hangfire / cron) from old MOSL_FEED tables |
| Phase 3 External syncs |
Before UAT | negative_list_entries, bank_ifsc_master |
Build sync from SEBI list (daily) + RBI IFSC directory (monthly) |
personal_field_master: The BRD called for a separate personal_field_master table, but the new codebase uses the lookups table (same schema: Category + Code + DisplayName + SortOrder + IsActive) as its superset replacement. No separate table is needed. Seed data already covers all 12 dropdown categories.