-- Seed legacy dashboard modules
INSERT INTO ui_modals (name, config) VALUES
  ('Accounts', '{}'),
  ('ActionBuilder', '{}'),
  ('AnalyticsDashboard', '{}'),
  ('ApplicationFieldDefs', '{}'),
  ('Applications', '{}'),
  ('Calendar', '{}'),
  ('CardPermissionsManager', '{}'),
  ('CareerPaths', '{}'),
  ('CareerReadiness', '{}'),
  ('Careers', '{}'),
  ('CaseManagement', '{}'),
  ('Companies', '{}'),
  ('ComplianceReports', '{}'),
  ('ContractApprovals', '{}'),
  ('ContractRepository', '{}'),
  ('CountryDeductions', '{}'),
  ('CountryHolidays', '{}'),
  ('CreateUser', '{}'),
  ('CustomizeDashboard', '{}'),
  ('DeductionSettings', '{}'),
  ('Deductions', '{}'),
  ('DetailViewBuilder', '{}'),
  ('DigitalWallet', '{}'),
  ('DmsAdmin', '{}'),
  ('DocumentComments', '{}'),
  ('Documents', '{}'),
  ('EmployeeTypes', '{}'),
  ('Employees', '{}'),
  ('ExecutiveDashboard', '{}'),
  ('ExitManagement', '{}'),
  ('ExpiringDocuments', '{}'),
  ('Feedback', '{}'),
  ('FormBuilder', '{}'),
  ('GoalAlignment', '{}'),
  ('GoalDashboard', '{}'),
  ('GoalProgress', '{}'),
  ('GoalStrategyAlignment', '{}'),
  ('GoalTemplates', '{}'),
  ('HRPerformanceDashboard', '{}'),
  ('InvestigationForm', '{}'),
  ('ItemAssignments', '{}'),
  ('JSATrainingStatus', '{}'),
  ('JobOpeningTemplates', '{}'),
  ('KanbanBoard', '{}'),
  ('LeaveRequests', '{}'),
  ('LedgerEntries', '{}'),
  ('Locations', '{}'),
  ('Logout', '{}'),
  ('ManagePolicies', '{}'),
  ('ModuleBuilder', '{}'),
  ('ModuleManager', '{}'),
  ('MyGoals', '{}'),
  ('MyPolicies', '{}'),
  ('MyReviews', '{}'),
  ('NewHire', '{}'),
  ('OpenPosition', '{}'),
  ('OvertimeSettings', '{}'),
  ('PageConfigBuilder', '{}'),
  ('PageCustomizer', '{}'),
  ('PayCycles', '{}'),
  ('Payments', '{}'),
  ('PayrollProcess', '{}'),
  ('PayrollSubmissions', '{}'),
  ('PayrollVerification', '{}'),
  ('Payslips', '{}'),
  ('PerformanceDashboard', '{}'),
  ('PerformanceManagement', '{}'),
  ('PermissionsManager', '{}'),
  ('PolicyApprovals', '{}'),
  ('Properties', '{}'),
  ('PropertyRates', '{}'),
  ('Reconciliation', '{}'),
  ('Reporting', '{}'),
  ('ReviewCalibration', '{}'),
  ('ReviewCycles', '{}'),
  ('Roles', '{}'),
  ('ScheduleInterviews', '{}'),
  ('SentimentDashboard', '{}'),
  ('SystemSettings', '{}'),
  ('TableBuilder', '{}'),
  ('TableManager', '{}'),
  ('TeamGoalsDashboard', '{}'),
  ('TeamLearningTracker', '{}'),
  ('Training', '{}'),
  ('TrainingCalendar', '{}'),
  ('TrainingCompletion', '{}'),
  ('TrainingDashboard', '{}'),
  ('TrainingGamification', '{}'),
  ('TrainingProfile', '{}'),
  ('UpcomingReviews', '{}'),
  ('ViewBuilder', '{}'),
  ('WorkflowBuilder', '{}'),
  ('WorkflowInstances', '{}'),
  ('WorkflowTasks', '{}')
ON CONFLICT DO NOTHING;

INSERT INTO resources (resource_type_id, tenant_id, branch_id, name, description)
SELECT (SELECT id FROM resource_types WHERE name='module'), NULL, NULL, name, NULL
FROM (VALUES
  ('Accounts'),
  ('ActionBuilder'),
  ('AnalyticsDashboard'),
  ('ApplicationFieldDefs'),
  ('Applications'),
  ('Calendar'),
  ('CardPermissionsManager'),
  ('CareerPaths'),
  ('CareerReadiness'),
  ('Careers'),
  ('CaseManagement'),
  ('Companies'),
  ('ComplianceReports'),
  ('ContractApprovals'),
  ('ContractRepository'),
  ('CountryDeductions'),
  ('CountryHolidays'),
  ('CreateUser'),
  ('CustomizeDashboard'),
  ('DeductionSettings'),
  ('Deductions'),
  ('DetailViewBuilder'),
  ('DigitalWallet'),
  ('DmsAdmin'),
  ('DocumentComments'),
  ('Documents'),
  ('EmployeeTypes'),
  ('Employees'),
  ('ExecutiveDashboard'),
  ('ExitManagement'),
  ('ExpiringDocuments'),
  ('Feedback'),
  ('FormBuilder'),
  ('GoalAlignment'),
  ('GoalDashboard'),
  ('GoalProgress'),
  ('GoalStrategyAlignment'),
  ('GoalTemplates'),
  ('HRPerformanceDashboard'),
  ('InvestigationForm'),
  ('ItemAssignments'),
  ('JSATrainingStatus'),
  ('JobOpeningTemplates'),
  ('KanbanBoard'),
  ('LeaveRequests'),
  ('LedgerEntries'),
  ('Locations'),
  ('Logout'),
  ('ManagePolicies'),
  ('ModuleBuilder'),
  ('ModuleManager'),
  ('MyGoals'),
  ('MyPolicies'),
  ('MyReviews'),
  ('NewHire'),
  ('OpenPosition'),
  ('OvertimeSettings'),
  ('PageConfigBuilder'),
  ('PageCustomizer'),
  ('PayCycles'),
  ('Payments'),
  ('PayrollProcess'),
  ('PayrollSubmissions'),
  ('PayrollVerification'),
  ('Payslips'),
  ('PerformanceDashboard'),
  ('PerformanceManagement'),
  ('PermissionsManager'),
  ('PolicyApprovals'),
  ('Properties'),
  ('PropertyRates'),
  ('Reconciliation'),
  ('Reporting'),
  ('ReviewCalibration'),
  ('ReviewCycles'),
  ('Roles'),
  ('ScheduleInterviews'),
  ('SentimentDashboard'),
  ('SystemSettings'),
  ('TableBuilder'),
  ('TableManager'),
  ('TeamGoalsDashboard'),
  ('TeamLearningTracker'),
  ('Training'),
  ('TrainingCalendar'),
  ('TrainingCompletion'),
  ('TrainingDashboard'),
  ('TrainingGamification'),
  ('TrainingProfile'),
  ('UpcomingReviews'),
  ('ViewBuilder'),
  ('WorkflowBuilder'),
  ('WorkflowInstances'),
  ('WorkflowTasks')
) AS m(name)
ON CONFLICT DO NOTHING;
