CREATE TABLE public.core_settings (
	id serial4 NOT NULL,
	setting_type varchar(255) NOT NULL,
	setting_name varchar(45) NOT NULL,
	value jsonb NULL,
	properties jsonb NULL,
	ord int4 NULL
);


CREATE UNIQUE INDEX core_settings_id_idx ON public.core_settings USING btree (id);


INSERT INTO core_settings (setting_type,setting_name,properties,ord) VALUES
 ('email_settings','email_recipients','{"section_desc": "Manage email settings", "section_icon": "fas fa-mail-bulk", "setting_desc": "System email recipients", "setting_icon": "fas fa-hand-point-right", "section_button": "Change settings", "setting_button": "View"}',10),
 ('email_settings','main_settings','{"section_desc": "Manage email settings", "section_icon": "fas fa-mail-bulk", "setting_desc": "General email settings", "setting_icon": "fas fa-cogs", "section_button": "Change settings", "setting_button": "View"}',10);

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('PSHPREF','shape_preferences','MSHAPE','getObjects','','shape/preferences','shape','Permission to access preferences page','PAG','fas fa-sliders-h',1,false,false,NULL),
	 ('XPREFGT','shape_preferences_get','SSHPREF','getShapePreferences','','shape/preferences','shape','Permission to get preferences list','EXE','',1,false,false,NULL),
	 ('SSHPREF','shape_preferences_list','PSHPREF','','','shape/preferences','shape','Permission to preferences view section','SEC','',1,false,false,NULL);

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XPREFSV','shape_preferences_save','SSHPREF','saveShapePreferences','','shape/preferences','shape','Permission to save preferences list','EXE','',1,false,false,NULL);

INSERT INTO public.core_permissions (code,permission_name,parent,permission_function,default_child,permission_namespace,"module",permission_description,permission_type,icon,ord,hidden,guest,meta) VALUES
	 ('XSDTUPD','shape_settings_details_update','SSETDET','updSettings','','shape/settings','shape','Permission to update settings','EXE','',1,false,false,NULL);
