-- Modal listing unapproved case hours
INSERT INTO ui_modals (name, config, tenant_id, branch_id)

SELECT 'Case Hour Approval', '{"title":"Case Hour Approval","body":[{"type":"table","options":{"tableName":"case_hours","tableUrl":"../api/case_hours?approved=0","editFormId":38,"columnsToShow":["id","case_id","user_id","hours","description"],"apiRowActions":[{"buttonText":"Approve","apiUrl":"../api/case_hours/{id}","method":"PUT","body":{"approved":true}},{"buttonText":"Reject","apiUrl":"../api/case_hours/{id}","method":"PUT","body":{"approved":false}}]}}],"footer":[{"type":"button","label":"Close","onClick":"closeModal"}]}' , NULL, NULL

WHERE NOT EXISTS (SELECT 1 FROM ui_modals WHERE name = 'Case Hour Approval');
