Skip to content

Instantly share code, notes, and snippets.

View krisbuist's full-sized avatar

Kris Buist krisbuist

View GitHub Profile
@krisbuist
krisbuist / gist:1a88dad89c7b182e265204e783a2076b
Created September 15, 2025 13:49
hourshours is_editable is_deletable
CASE
/* LEAVE BRANCH */
WHEN cef.id IS NOT NULL THEN
CASE
WHEN cef.start_date IS NULL OR cef.end_date IS NULL
THEN 'leave_has_no_period'
WHEN DATEDIFF(DATE(cef.end_date), DATE(cef.start_date)) > 0
THEN 'period_spans_multiple_days'
WHEN EXISTS (
SELECT 1