<?php
declare(strict_types=1);

return [
    'up' => "
DROP TABLE IF EXISTS `board_offers`;
CREATE TABLE `board_offers` (
  `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `title_ar` VARCHAR(200) NOT NULL,
  `title_en` VARCHAR(200) NULL,
  `description` TEXT NULL,

  `cash_discount_type` ENUM('percentage','fixed_amount') NULL,
  `cash_discount_value` DECIMAL(15,2) NULL,

  `inst_down_payment_pct` DECIMAL(5,2) NULL,
  `inst_months` INT NULL,
  `inst_interest_rate` DECIMAL(5,2) NULL,
  `inst_grace_type` ENUM('first_n_months','full_free_under_n') NULL,
  `inst_grace_months` INT NOT NULL DEFAULT 0,
  `inst_post_grace_rate` DECIMAL(5,2) NULL,

  `branch_id` BIGINT UNSIGNED NULL,
  `applies_to` ENUM('membership_fee','all') NOT NULL DEFAULT 'membership_fee',
  `effective_from` DATE NOT NULL,
  `effective_to` DATE NOT NULL,
  `is_active` TINYINT(1) NOT NULL DEFAULT 1,
  `board_decision_number` VARCHAR(50) NULL,
  `board_decision_date` DATE NULL,
  `notes` TEXT NULL,

  `created_by` INT UNSIGNED NULL,
  `updated_by` INT UNSIGNED NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",

    'down' => "DROP TABLE IF EXISTS `board_offers`",
];
