-- Table: bonus_periods
-- Time periods for bonus calculations (weekly/monthly tracking)

CREATE TABLE `bonus_periods` (
  `id` bigint UNSIGNED NOT NULL,
  `period_type_id` bigint UNSIGNED NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `start_datetime` datetime NOT NULL,
  `end_datetime` datetime NOT NULL,
  `year` int DEFAULT NULL,
  `week_number` int DEFAULT NULL,
  `month` int DEFAULT NULL,
  `month_year` int DEFAULT NULL,
  `is_closed` tinyint(1) NOT NULL DEFAULT '0',
  `bonuses_calculated` tinyint(1) NOT NULL DEFAULT '0',
  `closed_at` datetime DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- Primary key and indexes would be added via ALTER TABLE statements
