CREATE TABLE IF NOT EXISTS payroll_settings (
    id INT UNSIGNED NOT NULL PRIMARY KEY,
    normal_start_time TIME NOT NULL DEFAULT '07:30:00',
    normal_end_time TIME NOT NULL DEFAULT '16:30:00',
    grace_before_minutes INT NOT NULL DEFAULT 15,
    grace_after_minutes INT NOT NULL DEFAULT 15,
    standard_daily_minutes INT NOT NULL DEFAULT 480,
    lunch_minutes INT NOT NULL DEFAULT 60,
    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT IGNORE INTO payroll_settings (
    id, normal_start_time, normal_end_time, grace_before_minutes, grace_after_minutes, standard_daily_minutes, lunch_minutes
) VALUES (1, '07:30:00', '16:30:00', 15, 15, 480, 60);
