-- MySQL dump 10.13  Distrib 8.0.40, for Linux (x86_64)
--
-- Host: localhost    Database: happy_paradise
-- ------------------------------------------------------
-- Server version	8.0.40-0ubuntu0.22.04.1

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `events_list`
--

DROP TABLE IF EXISTS `events_list`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `events_list` (
  `uid` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cagent_uid` int unsigned NOT NULL,
  `event_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '活動代碼',
  `start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '活動開始時間',
  `end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '活動結束時間',
  `is_active` tinyint(1) NOT NULL DEFAULT '1' COMMENT '該活動的即時狀態，若須關閉活動，則可切換此狀態',
  `is_show_carousel` tinyint(1) NOT NULL DEFAULT '0' COMMENT '該活動是否顯示在輪播畫面上',
  `is_show_pop_up` tinyint(1) DEFAULT '0' COMMENT '是否顯示在彈跳視窗',
  `participating_platforms` json DEFAULT NULL COMMENT '所有參與此活動的平台、廠商',
  `vip_group` json DEFAULT NULL COMMENT '限制可以參與此活動的VIP等級，如果為空則代表不設限',
  `tags_group` json DEFAULT NULL COMMENT '限制可以參與此活動的標籤族群，如果為空則代表不設限',
  `enable_currency_limit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否啟用幣別限制，啟用後玩家一次只能參與一種幣別屬性',
  `default_language` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '預設語言',
  `include_currency` json DEFAULT NULL COMMENT '預先建立的幣別種類',
  `event_show_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活動的類型：儲值、達成洗碼、等等...',
  `settlement_hour` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '每次結算的時間，預設為0點，時區都使用+08:00',
  `settlement_interval` enum('day','week','month') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'day' COMMENT '結算的週期單位：天、周、月，每隔兩天，每一周...',
  `settlement_interval_count` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '結算週期的設定值，預設為1，搭配週期單位預設為day，就是預設每天都結算一次。',
  `settlement_day` tinyint unsigned DEFAULT '1' COMMENT '搭配結算周期的日子，day:無視這參數，week:代表每周的星期幾，month:代表每月的幾號。',
  `auto_publish` tinyint(1) NOT NULL DEFAULT '1' COMMENT '如果true，獎勵都會自動發放，false則為玩家自行領取。',
  `enable_initial_condition` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否啟用初始化條件，啟用後子類別將會以初始幣別換匯成所有幣別。',
  `initial_currency` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '幣別',
  `initial_type` enum('deposit','withdraw','wager','win','lose','others') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '種類',
  `initial_subtype` enum('>','>=','=','<=','<') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '判斷符號',
  `initial_value` double DEFAULT NULL COMMENT '條件基準值',
  `initial_value_basis` enum('single','cumulative') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'cumulative' COMMENT '獎勵基於單次或累積金額',
  `initial_single_amount_target` enum('max','min','latest','earliest') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '單次金額目標為最大、最小、最晚或最早',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `events_list_event_code_unique` (`event_code`),
  KEY `events_list_start_time_index` (`start_time`),
  KEY `events_list_end_time_index` (`end_time`),
  KEY `events_list_is_active_index` (`is_active`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `events_list`
--

LOCK TABLES `events_list` WRITE;
/*!40000 ALTER TABLE `events_list` DISABLE KEYS */;
REPLACE INTO `events_list` VALUES (9,2,'HAPPY1','2025-01-11 00:00:00','2025-12-31 00:00:00',1,1,0,'[]','[]','[]',0,'','[\"TWD\"]','',0,'day',1,NULL,0,1,'TWD','deposit','>=',1000,'single','earliest','2025-01-10 10:10:28','2025-01-13 10:47:03'),(10,2,'HAPPY2','2025-01-11 00:00:00','2026-01-01 00:00:00',1,1,0,'[\"WM\", \"DG\", \"SALONG\", \"ALLBET\", \"QTECH\", \"SIMPLEPLAY\", \"BNG\", \"RSG\", \"ATG\"]','[]','[3]',1,'','[\"TWD\"]','',0,'day',1,NULL,0,1,'TWD','wager','>=',0,'single','min','2025-01-10 10:21:50',NULL),(11,2,'P43J1L','2025-01-11 00:00:00','2030-01-31 00:00:00',1,1,0,'[]','[]','[]',0,'','[\"TWD\"]','',0,'day',1,NULL,1,1,'TWD','deposit','>=',1,'cumulative','','2025-01-10 14:16:29','2025-01-14 01:56:03');
/*!40000 ALTER TABLE `events_list` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-01-20 19:22:29
