<?php
declare(strict_types=1);

return [
    'up' => "
ALTER TABLE `seasonal_memberships` ADD COLUMN `nationality_type` ENUM('egyptian','foreign') NOT NULL DEFAULT 'egyptian' AFTER `branch_id`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `duration_months` TINYINT UNSIGNED NOT NULL DEFAULT 6 AFTER `nationality_type`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `person_type` ENUM('member','spouse','child') NOT NULL DEFAULT 'member' AFTER `duration_months`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `person_name` VARCHAR(200) NULL AFTER `person_type`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `person_age` TINYINT UNSIGNED NULL AFTER `person_name`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `age_category` ENUM('under_15','15_to_21','over_21','over_60') NULL AFTER `person_age`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `currency` ENUM('EGP','USD') NOT NULL DEFAULT 'EGP' AFTER `fee_amount`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `vat_amount` DECIMAL(15,2) NOT NULL DEFAULT 0.00 AFTER `currency`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `discount_amount` DECIMAL(15,2) NOT NULL DEFAULT 0.00 AFTER `vat_amount`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `discount_type` VARCHAR(100) NULL AFTER `discount_amount`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `total_amount` DECIMAL(15,2) NOT NULL DEFAULT 0.00 AFTER `discount_type`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `parent_seasonal_id` BIGINT UNSIGNED NULL AFTER `member_id`;
ALTER TABLE `seasonal_memberships` ADD COLUMN `includes_pool` TINYINT(1) NOT NULL DEFAULT 0 AFTER `carnet_marking`;
ALTER TABLE `seasonal_memberships` ADD INDEX `idx_seasonal_nationality` (`nationality_type`);
ALTER TABLE `seasonal_memberships` ADD INDEX `idx_seasonal_parent` (`parent_seasonal_id`)",

    'down' => "
ALTER TABLE `seasonal_memberships` DROP INDEX IF EXISTS `idx_seasonal_parent`;
ALTER TABLE `seasonal_memberships` DROP INDEX IF EXISTS `idx_seasonal_nationality`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `includes_pool`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `parent_seasonal_id`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `total_amount`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `discount_type`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `discount_amount`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `vat_amount`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `currency`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `age_category`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `person_age`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `person_name`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `person_type`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `duration_months`;
ALTER TABLE `seasonal_memberships` DROP COLUMN IF EXISTS `nationality_type`",
];
