
-- public.core_users_journal_entries definition

-- Drop table

-- DROP TABLE public.core_users_journal_entries;

CREATE TABLE public.core_users_journal_entries (
	id bigserial NOT NULL,
	user_id int8 NOT NULL,
	start_time timestamptz NULL DEFAULT now(),
	end_time timestamptz NULL,
	meta jsonb NOT NULL DEFAULT '{}'::json,
	status varchar(3) NULL,
	shift_id int8 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
	 ('PSJOURN','self_journal_view','MSELF','getObjects','','self/journal','self','Permission to view self journal page','PAG','fa-solid fa-book',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
	 ('SJRNLLV','self_journal_list','PSJOURN','getObjects','','self/journal','self','Permission to journal list section','SEC','fa-solid fa-book',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
	 ('BJRNADD','self_journal_list_view_add','SJRNLLV','','','self/journal','self','Permission to journal add button','BUT','fa-solid fa-plus',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
	 ('XJRNADD','self_journal_add','SJRNLLV','addJournalEntry','','self/journal','self','Permission to add journal entry','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
	 ('BJRNEDT','self_journal_list_view_edit','SJRNLLV','','','self/journal','self','Permission to journal edit button','BUT','fas fa-edit',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
	 ('BJRNDEL','self_journal_list_view_delete','SJRNLLV','','','self/journal','self','Permission to journal delete button','BUT','fas fa-trash',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
	 ('SJRNEDT','self_journal_edit','PSJOURN','','','self/journal','self','Permission to journal edit 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
	 ('BJRNSAV','self_journal_list_edit_save','SJRNEDT','','','self/journal','self','Permission to journal save button','BUT','fas fa-save',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
	 ('XJRNGET','self_journal_get','SJRNLLV','getJournalEntry','','self/journal','self','Permission to get journal entry','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
	 ('XJRNIN','self_journal_in','SJRNLLV','journalStatusIN','','self/journal','self','Permission to journal status IN','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
	 ('XJRNOUT','self_journal_out','SJRNLLV','journalStatusOUT','','self/journal','self','Permission to journal status OUT','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
	 ('XJRNBRK','self_journal_brk','SJRNLLV','journalStatusBRK','','self/journal','self','Permission to journal status BRK','EXE','',1,false,false,NULL);
