<?php
declare(strict_types=1);

return [
    'up' => "
        CREATE TABLE IF NOT EXISTS `rental_entities` (
            `id`                     BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            `entity_type`            VARCHAR(50) NOT NULL COMMENT 'school, university, embassy, federation, private, corporate',
            `name_ar`                VARCHAR(300) NOT NULL,
            `name_en`                VARCHAR(300) NULL,
            `contact_person`         VARCHAR(200) NULL,
            `contact_phone`          VARCHAR(30) NULL,
            `contact_email`          VARCHAR(200) NULL,
            `address`                TEXT NULL,
            `tax_number`             VARCHAR(50) NULL,
            `official_letter_received` TINYINT(1) NOT NULL DEFAULT 0,
            `board_approved`         TINYINT(1) NOT NULL DEFAULT 0,
            `approval_date`          DATE NULL,
            `status`                 VARCHAR(20) NOT NULL DEFAULT 'pending' COMMENT 'pending, approved, active, suspended, blacklisted',
            `notes`                  TEXT NULL,
            `is_archived`            TINYINT(1) NOT NULL DEFAULT 0,
            `archived_at`            TIMESTAMP NULL DEFAULT NULL,
            `archived_by`            BIGINT UNSIGNED NULL,
            `created_at`             TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
            `updated_at`             TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
            `created_by`             BIGINT UNSIGNED NULL,
            `updated_by`             BIGINT UNSIGNED NULL,
            INDEX `idx_rental_entities_type` (`entity_type`),
            INDEX `idx_rental_entities_status` (`status`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    ",
    'down' => "DROP TABLE IF EXISTS `rental_entities`",
];
