--
-- Host: localhost    Database: desafiointeligencias
-- ------------------------------------------------------


--
-- Table structure for table `achievements`
--

CREATE TABLE `achievements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(100) NOT NULL,
  `description` text,
  `category` enum('seed','sprout','tree','special') NOT NULL,
  `intelligence_id` int DEFAULT NULL,
  `threshold` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `intelligence_id` (`intelligence_id`),
  CONSTRAINT `achievements_ibfk_1` FOREIGN KEY (`intelligence_id`) REFERENCES `intelligences` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `achievements`
--

INSERT INTO `achievements` VALUES (1,'Primeiro Passo','Complete o primeiro dia de jornada','seed',1,1,'2025-11-15 15:54:03'),(2,'Equipe Afinada','Finalize um desafio em família','sprout',2,1,'2025-11-15 15:54:03');

--
-- Table structure for table `challenge_responses`
--

CREATE TABLE `challenge_responses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `challenge_id` int NOT NULL,
  `response_text` text,
  `response_audio_url` varchar(255) DEFAULT NULL,
  `response_image_url` varchar(255) DEFAULT NULL,
  `validation_status` enum('pending','valid','invalid','manual_review') NOT NULL DEFAULT 'manual_review',
  `validation_feedback` text,
  `submitted_at` datetime NOT NULL,
  `validated_at` datetime DEFAULT NULL,
  `points_earned` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `challenge_id` (`challenge_id`),
  CONSTRAINT `challenge_responses_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `challenge_responses_ibfk_2` FOREIGN KEY (`challenge_id`) REFERENCES `challenges` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `challenge_responses`
--

INSERT INTO `challenge_responses` VALUES (1,2,1,'Compartilhei minhas emoções em casa.',NULL,NULL,'valid','Excelente abertura para o diálogo!','2025-11-15 12:05:00','2025-11-15 12:45:00',20),(2,6,1,NULL,NULL,NULL,'manual_review',NULL,'2025-11-17 22:38:40',NULL,20),(3,6,2,NULL,NULL,NULL,'manual_review',NULL,'2025-11-17 22:38:47',NULL,30),(4,6,3,NULL,NULL,NULL,'manual_review',NULL,'2025-11-17 22:38:56',NULL,25),(5,8,2,NULL,NULL,NULL,'manual_review',NULL,'2025-11-17 23:28:28',NULL,30),(6,8,1,NULL,NULL,NULL,'manual_review',NULL,'2025-11-17 23:28:36',NULL,20),(7,12,1,NULL,NULL,NULL,'manual_review',NULL,'2025-11-18 19:49:59',NULL,20),(8,12,1,NULL,NULL,NULL,'manual_review',NULL,'2025-11-18 19:50:08',NULL,20),(9,12,2,NULL,NULL,NULL,'manual_review',NULL,'2025-11-18 19:50:15',NULL,30),(10,15,2,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 11:36:22',NULL,30),(11,16,2,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 13:48:11',NULL,30),(12,26,1,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 19:29:11',NULL,20),(13,8,3,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 20:14:26',NULL,25);

--
-- Table structure for table `challenges`
--

CREATE TABLE `challenges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `day_id` int DEFAULT NULL,
  `title` varchar(150) NOT NULL,
  `description` text,
  `start_time` datetime DEFAULT NULL,
  `end_time` datetime DEFAULT NULL,
  `points` int NOT NULL DEFAULT '0',
  `is_special` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `day_id` (`day_id`),
  CONSTRAINT `challenges_ibfk_1` FOREIGN KEY (`day_id`) REFERENCES `days` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `challenges`
--

INSERT INTO `challenges` VALUES (1,NULL,'Mapa das Emoções','Liste três emoções sentidas hoje e compartilhe com alguém.','2025-11-10 09:00:00','2025-12-31 21:00:00',20,0,'2025-11-15 15:54:03'),(2,NULL,'Missão Colaborativa','Planeje uma atividade em grupo onde cada pessoa tenha um papel.','2025-11-12 09:00:00','2025-12-31 21:00:00',30,1,'2025-11-15 15:54:03'),(3,NULL,'Gratidão em Família','Escreva ou grave um agradecimento para alguém e compartilhe.','2025-11-15 09:00:00','2025-12-31 21:00:00',25,0,'2025-11-15 15:54:03');

--
-- Table structure for table `classes`
--

CREATE TABLE `classes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `school_id` int NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `school_id` (`school_id`),
  CONSTRAINT `classes_ibfk_1` FOREIGN KEY (`school_id`) REFERENCES `schools` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `classes`
--

INSERT INTO `classes` VALUES (1,1,'Turma 1A','Turma do primeiro ano A','2025-11-15 15:54:03'),(2,1,'Turma 1B','Turma do primeiro ano B','2025-11-15 15:54:03'),(3,2,'Turma 2A','Turma do segundo ano A','2025-11-15 15:54:03');

--
-- Table structure for table `coins_transactions`
--

CREATE TABLE `coins_transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `amount` int NOT NULL,
  `transaction_type` enum('earned','spent','reverted') NOT NULL,
  `source` varchar(50) NOT NULL,
  `reference_id` int DEFAULT NULL,
  `description` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `coins_transactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `coins_transactions`
--

INSERT INTO `coins_transactions` VALUES (1,2,30,'earned','day_completion',1,'Concluiu o Dia 1 e recebeu moedas.','2025-11-15 11:05:00'),(2,2,10,'spent','reward_redeem',1,'Resgatou o pôster digital.','2025-11-15 12:40:00'),(3,6,20,'earned','challenge',1,'Pontuação por desafio','2025-11-18 01:38:40'),(4,6,30,'earned','challenge',2,'Pontuação por desafio','2025-11-18 01:38:47'),(5,6,25,'earned','challenge',3,'Pontuação por desafio','2025-11-18 01:38:56'),(6,6,-10,'spent','reward',1,'Resgate de recompensa','2025-11-18 01:44:26'),(7,8,30,'earned','challenge',2,'Pontuação por desafio','2025-11-18 02:28:28'),(8,8,20,'earned','challenge',1,'Pontuação por desafio','2025-11-18 02:28:36'),(9,8,1,'earned','quiz',3,'Pontuação por quiz','2025-11-18 18:56:57'),(10,8,1,'earned','quiz',3,'Pontuação por quiz','2025-11-18 19:10:18'),(11,8,1,'earned','quiz',4,'Pontuação por quiz','2025-11-18 19:10:22'),(12,8,1,'earned','quiz',3,'Pontuação por quiz','2025-11-18 20:10:15'),(13,8,1,'earned','quiz',4,'Pontuação por quiz','2025-11-18 20:10:18'),(14,9,1,'earned','quiz',3,'Pontuação por quiz','2025-11-18 21:33:45'),(15,9,1,'earned','quiz',4,'Pontuação por quiz','2025-11-18 21:33:47'),(16,10,1,'earned','quiz',3,'Pontuação por quiz','2025-11-18 21:51:30'),(17,10,1,'earned','quiz',4,'Pontuação por quiz','2025-11-18 21:51:33'),(18,11,1,'earned','quiz',3,'Pontuação por quiz','2025-11-18 22:06:38'),(19,11,1,'earned','quiz',4,'Pontuação por quiz','2025-11-18 22:06:41'),(20,12,1,'earned','quiz',3,'Pontuação por quiz','2025-11-18 22:45:51'),(21,12,1,'earned','quiz',4,'Pontuação por quiz','2025-11-18 22:46:00'),(22,12,1,'earned','quiz',5,'Pontuação por quiz','2025-11-18 22:46:52'),(23,12,20,'earned','challenge',1,'Pontuação por desafio','2025-11-18 22:49:59'),(24,12,20,'earned','challenge',1,'Pontuação por desafio','2025-11-18 22:50:08'),(25,12,30,'earned','challenge',2,'Pontuação por desafio','2025-11-18 22:50:15'),(26,11,1,'earned','quiz',5,'Pontuação por quiz','2025-11-19 13:07:56'),(27,15,1,'earned','quiz',3,'Pontuação por quiz','2025-11-23 14:31:35'),(28,15,1,'earned','quiz',5,'Pontuação por quiz','2025-11-23 14:32:29'),(29,15,30,'earned','challenge',2,'Pontuação por desafio','2025-11-23 14:36:22'),(30,15,-10,'spent','reward',1,'Resgate de recompensa','2025-11-23 14:39:55'),(31,16,1,'earned','quiz',5,'Pontuação por quiz','2025-11-23 14:49:10'),(32,16,1,'earned','quiz',3,'Pontuação por quiz','2025-11-23 16:23:36'),(33,16,1,'earned','quiz',4,'Pontuação por quiz','2025-11-23 16:23:41'),(34,16,30,'earned','challenge',2,'Pontuação por desafio','2025-11-23 16:48:11'),(35,16,-10,'spent','reward',1,'Resgate de recompensa','2025-11-23 16:59:07'),(36,26,20,'earned','challenge',1,'Pontuação por desafio','2025-11-23 22:29:11'),(37,8,25,'earned','challenge',3,'Pontuação por desafio','2025-11-23 23:14:26'),(38,8,20,'earned','daily_challenge',1,'Pontuação por desafio diário','2025-11-23 23:39:14'),(39,8,20,'earned','daily_challenge',1,'Pontuação por desafio diário','2025-11-23 23:39:14'),(40,8,25,'earned','daily_challenge',2,'Pontuação por desafio diário','2025-11-23 23:39:38'),(41,8,15,'earned','daily_challenge',3,'Pontuação por desafio diário','2025-11-23 23:41:00'),(42,8,10,'earned','daily_challenge',4,'Pontuação por desafio diário (quiz)','2025-11-24 00:53:00'),(43,27,15,'earned','daily_challenge',3,'Pontuação por desafio diário','2025-11-24 01:04:04'),(44,27,10,'earned','daily_challenge',4,'Pontuação por desafio diário (quiz)','2025-11-24 01:04:22'),(45,28,10,'earned','daily_challenge',4,'Pontuação por desafio diário (quiz)','2025-11-24 01:08:33'),(46,28,10,'earned','daily_challenge',4,'Pontuação por desafio diário','2025-11-24 01:08:34'),(47,28,15,'earned','daily_challenge',3,'Pontuação por desafio diário (quiz)','2025-11-24 01:12:43'),(48,28,15,'earned','daily_challenge',3,'Pontuação por desafio diário','2025-11-24 01:12:43'),(49,31,1,'earned','quiz',3,'Pontuação por quiz','2025-11-24 12:17:25'),(50,31,1,'earned','quiz',4,'Pontuação por quiz','2025-11-24 12:17:29'),(51,31,1,'earned','quiz',5,'Pontuação por quiz','2025-11-24 12:18:13'),(52,32,1,'earned','quiz',5,'Pontuação por quiz','2025-11-24 12:45:38'),(53,33,1,'earned','quiz',5,'Pontuação por quiz','2025-11-24 12:49:00'),(54,34,1,'earned','quiz',5,'Pontuação por quiz','2025-11-24 12:57:51'),(55,35,1,'earned','quiz',5,'Pontuação por quiz','2025-11-24 13:02:47'),(56,35,1,'earned','quiz',3,'Pontuação por quiz','2025-11-24 13:06:28'),(57,35,1,'earned','quiz',3,'Pontuação por quiz','2025-11-24 13:07:21'),(58,35,1,'earned','quiz',4,'Pontuação por quiz','2025-11-24 13:07:24'),(59,36,1,'earned','quiz',3,'Pontuação por quiz','2025-11-24 13:22:29'),(60,36,1,'earned','quiz',4,'Pontuação por quiz','2025-11-24 13:22:33'),(61,36,1,'earned','quiz',5,'Pontuação por quiz','2025-11-24 13:24:40'),(62,36,1,'earned','quiz',6,'Pontuação por quiz','2025-11-24 13:25:08'),(63,37,1,'earned','quiz',3,'Pontuação por quiz','2025-11-24 13:36:07'),(64,37,1,'earned','quiz',4,'Pontuação por quiz','2025-11-24 13:36:09'),(65,37,1,'earned','quiz',5,'Pontuação por quiz','2025-11-24 13:36:28'),(66,37,1,'earned','quiz',6,'Pontuação por quiz','2025-11-24 13:36:53'),(67,42,15,'earned','daily_challenge',3,'Pontuação por desafio diário (quiz)','2025-11-25 14:33:57'),(68,42,15,'earned','daily_challenge',3,'Pontuação por desafio diário','2025-11-25 14:33:57'),(69,42,10,'earned','daily_challenge',4,'Pontuação por desafio diário (quiz)','2025-11-25 14:34:44'),(70,42,10,'earned','daily_challenge',4,'Pontuação por desafio diário','2025-11-25 14:34:44'),(71,45,10,'earned','referral',20,'Indicação aceita','2025-11-26 12:28:06');

--
-- Table structure for table `daily_challenge_contents`
--

CREATE TABLE `daily_challenge_contents` (
  `id` int NOT NULL AUTO_INCREMENT,
  `daily_challenge_id` int NOT NULL,
  `content_type` enum('text','image','audio','video','pdf','link','quiz','movie','challenge') NOT NULL DEFAULT 'text',
  `language` enum('pt','es','en') NOT NULL DEFAULT 'pt',
  `order_index` smallint NOT NULL DEFAULT '0',
  `title` varchar(150) DEFAULT NULL,
  `body_text` text,
  `media_url` varchar(255) DEFAULT NULL,
  `reference_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `daily_challenge_id` (`daily_challenge_id`),
  CONSTRAINT `fk_daily_contents_daily` FOREIGN KEY (`daily_challenge_id`) REFERENCES `daily_challenges` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `daily_challenge_contents`
--

INSERT INTO `daily_challenge_contents` VALUES (4,3,'audio','pt',1,'Compartilhe gratidão','Grave um áudio agradecendo alguém especial e envie para a família.',NULL,NULL,'2025-11-22 23:00:00'),(5,4,'text','pt',1,'Teste titulo','teste descrição',NULL,NULL,'2025-11-24 00:51:23');

--
-- Table structure for table `daily_challenge_responses`
--

CREATE TABLE `daily_challenge_responses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `daily_challenge_id` int NOT NULL,
  `response_text` text,
  `response_audio_url` varchar(255) DEFAULT NULL,
  `response_image_url` varchar(255) DEFAULT NULL,
  `validation_status` enum('pending','valid','invalid','manual_review') NOT NULL DEFAULT 'manual_review',
  `validation_feedback` text,
  `submitted_at` datetime NOT NULL,
  `validated_at` datetime DEFAULT NULL,
  `points_earned` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `daily_challenge_id` (`daily_challenge_id`),
  CONSTRAINT `fk_daily_resp_challenge` FOREIGN KEY (`daily_challenge_id`) REFERENCES `daily_challenges` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_daily_resp_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `daily_challenge_responses`
--

INSERT INTO `daily_challenge_responses` VALUES (4,8,3,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 20:41:00',NULL,15),(5,27,3,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 22:04:04',NULL,15),(6,28,4,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 22:08:34',NULL,10),(7,28,3,NULL,NULL,NULL,'manual_review',NULL,'2025-11-23 22:12:43',NULL,15),(8,42,3,NULL,NULL,NULL,'manual_review',NULL,'2025-11-25 11:33:57',NULL,15),(9,42,4,NULL,NULL,NULL,'manual_review',NULL,'2025-11-25 11:34:44',NULL,10);

--
-- Table structure for table `daily_challenges`
--

CREATE TABLE `daily_challenges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `challenge_date` date NOT NULL,
  `title` varchar(150) NOT NULL,
  `description` text,
  `intelligence_id` int DEFAULT NULL,
  `language` enum('pt','es','en') NOT NULL DEFAULT 'pt',
  `points` int NOT NULL DEFAULT '0',
  `video_url` varchar(255) DEFAULT NULL,
  `video_duration` varchar(50) DEFAULT NULL,
  `badge_label` varchar(120) DEFAULT NULL,
  `response_type` enum('text','audio','image','video','upload','quiz','mixed') NOT NULL DEFAULT 'text',
  `quiz_id` int DEFAULT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `intelligence_id` (`intelligence_id`),
  CONSTRAINT `fk_daily_challenges_intelligence` FOREIGN KEY (`intelligence_id`) REFERENCES `intelligences` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `daily_challenges`
--

INSERT INTO `daily_challenges` VALUES (3,'2025-11-23','Gratidão em Família','Escreva ou grave um agradecimento para alguém e compartilhe. 2',1,'pt',15,NULL,NULL,'Trabalha: Empatia','audio',18,1,'2025-11-22 23:00:00','2025-11-24 01:44:00'),(4,'2025-11-23','Teste Desafio diario','Teste Desafio diario',1,'pt',10,'https://www.youtube.com/watch?v=2tBm6fLRuKU',NULL,'Trabalha inteligência emocional','text',17,1,'2025-11-24 00:51:23','2025-11-24 00:52:27');

--
-- Table structure for table `day_contents`
--

CREATE TABLE `day_contents` (
  `id` int NOT NULL AUTO_INCREMENT,
  `day_id` int NOT NULL,
  `content_type` enum('text','image','audio','video','pdf','link','quiz','movie','challenge') DEFAULT NULL,
  `language` enum('pt','es','en') NOT NULL DEFAULT 'pt',
  `order_index` smallint NOT NULL DEFAULT '0',
  `title` varchar(150) DEFAULT NULL,
  `body_text` text,
  `media_url` varchar(255) DEFAULT NULL,
  `reference_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `day_id` (`day_id`),
  CONSTRAINT `day_contents_ibfk_1` FOREIGN KEY (`day_id`) REFERENCES `days` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `day_contents`
--

INSERT INTO `day_contents` VALUES (4,4,'image','pt',1,NULL,'Post:','https://cliente.carmeltec.com.br/desafio-inteligencias/admin_panel/uploads/day_contents/4/day4_20251118_170315_ed4b250c.jpg',NULL,'2025-11-18 20:02:08'),(5,5,'video','pt',1,NULL,'Vídeo:','https://www.youtube.com/watch?v=L-UPDDoPOd0&authuser=0',NULL,'2025-11-18 22:31:02'),(6,6,'video','pt',1,NULL,'Responda as perguntas em familia!',NULL,NULL,'2025-11-19 13:41:08'),(7,7,'video','pt',1,NULL,'Assista ao filme:','https://www.youtube.com/watch?v=0XxCLLrWXxE&authuser=0',NULL,'2025-11-19 13:50:31');

--
-- Table structure for table `days`
--

CREATE TABLE `days` (
  `id` int NOT NULL AUTO_INCREMENT,
  `trail_id` int NOT NULL,
  `day_number` tinyint NOT NULL,
  `day_type` enum('content','family_challenge','special') NOT NULL DEFAULT 'content',
  `release_time` datetime NOT NULL,
  `is_active` tinyint(1) NOT NULL DEFAULT '0',
  `activated_at` datetime DEFAULT NULL,
  `manual_override` enum('auto','force_on','force_off') NOT NULL DEFAULT 'auto',
  `description` text,
  `video_url` varchar(255) DEFAULT NULL,
  `title` varchar(150) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `trail_id` (`trail_id`),
  CONSTRAINT `days_ibfk_1` FOREIGN KEY (`trail_id`) REFERENCES `trails` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `days`
--

INSERT INTO `days` VALUES (4,1,1,'content','2025-11-18 15:28:00',1,'2025-11-23 21:52:31','force_on','🧠  Desafio Day 1 (1/3)\r\n\r\n1) Leia o post explicativo sobre a Inteligência Intrapessoal;\r\n2) Veja o video ilustrado do resumo do livro Ö Poder do Subconsiente\";\r\n3) Responda as duas perguntas sobre o conteúdo do livro;\r\n4) Missão dada, missão cumprida. Agora só falta nos marcar no instagram.\r\n\r\n\r\nUauuu! Parabéns por ser corajoso em dizer sim para o desenvolvimento pessoal. Vamos iniciar 60 dias de desafios para potencializar suas inteligências.\r\n\r\nFoi dada a largada e a 1a inteligência a ser desenvolvida, é a Inteligência Intrapessoal.\r\n\r\nNesta semana o objetivo dos desafios serão o autoconhecimento, um treinamento para você se conhecer um pouco mais. Vamos?',NULL,'Dia 01 (1/3) - Inteligência Intrapessoal','2025-11-18 18:28:33'),(5,1,1,'content','2025-11-18 19:28:00',1,'2025-11-24 12:17:51','force_on','🧠  Desafio Day 1 (2/3)\r\n\r\n1) Leia o post explicativo sobre a Inteligência Intrapessoal;\r\n2) Veja o video ilustrado do resumo do livro Ö Poder do Subconsiente\";\r\n3) Responda as duas perguntas sobre o conteúdo do livro;\r\n4) Missão dada, missão cumprida. Agora só falta nos marcar no instagram.\r\n\r\n🎥 Veja aqui o resumo do livro de forma ilustrada..','https://www.youtube.com/watch?v=L-UPDDoPOd0&authuser=0','Dia 01 (2/3) - Inteligência Intrapessoal','2025-11-18 22:31:02'),(6,1,2,'family_challenge','2025-11-19 10:40:00',0,NULL,'force_off','🧠 Desafio Day 2 \r\n\r\nFeliz Sábado!!! Sabadouuu... 🎉\r\n\r\nNo fim de semana vamos sempre pensar em desafios para a família se envolver ainda mais. Uhuuu!\r\n\r\nMostre a seus pais como funciona o desafio, compartilhe com ele o que já aprendeu em apenas 1 dia.\r\n\r\nComo vimos a Inteligência Intrapessoal nos ajuda olhar para dentro de nós, é o habito da introspecção, do pensar, do refletir que é tão importante para tomada de decisões responsáveis .\r\n\r\nEntão o desafio de hoje é para você responder as 4 perguntas do post e também fazer com pelo menos mais duas pessoas da sua family responda as 4 perguntas.\r\n\r\nIsso mesmo, faça o seu e depois o de mais duas pessoas. Combinado?\r\n\r\nVamos conhecer mais profundamente a si próprio e o outro. 😉',NULL,'Dia 02 - Inteligência Intrapessoal','2025-11-19 13:41:08'),(7,1,3,'family_challenge','2025-11-19 10:49:00',1,'2025-11-24 14:21:04','force_on','🧠 Desafio Day 3\r\n\r\nDia de Cine Sabedoria!!! 🎞️\r\n\r\nDia de curtir uma \"preguicinha de leve\", mas não vamos deixar de aprender algo. Afinal somos os escolhidos, os jardineiros e estamos empenhados em cultivar nosso jardim. 🌱🌱🌱🌱🌱🌱\r\n\r\nComo nossa semana é Inteligência Intrapessoal, que tal um filmaço para gerar aquela reflexão que muda a vida?\r\n\r\n▪️ Filme: Poder além da vida\r\n▪️ Direção: Kevin Bernhardt\r\n\r\nFaz uma pipoca, brigadeiro, pizza, sorvete... E se divirta aprendendooooo... . Combinado? 🍿🍫🍕🍩🍟🥤🍰🍉🍌\r\n\r\nAh! Posta sua resposta, mas também uma fotinha da sua family se divertindo no Cine Sabedoria!!!! Uhuuuuuu...\r\n\r\n🎥  Observações:\r\n1) Sempre enviamos o desafio de domingo no sábado, para poder optar com sua família o melhor dia para ver o filme.\r\n2) Quando é possível enviamos o link do filme no Youtube. Veja na próxima postagem o link.','https://www.youtube.com/watch?v=0XxCLLrWXxE&authuser=0','Dia 03 - Inteligência Intrapessoal','2025-11-19 13:50:31');

--
-- Table structure for table `families`
--

CREATE TABLE `families` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `families`
--

INSERT INTO `families` VALUES (1,'Família Massari','2025-11-15 15:54:03');

--
-- Table structure for table `intelligences`
--

CREATE TABLE `intelligences` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name_pt` varchar(100) NOT NULL,
  `name_es` varchar(100) NOT NULL,
  `name_en` varchar(100) NOT NULL,
  `description` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `intelligences`
--

INSERT INTO `intelligences` VALUES (1,'Autoconhecimento','Autoconocimiento','Self Awareness','Aprender a identificar as próprias emoções.','2025-11-15 15:54:03'),(2,'Colaboração','Colaboración','Collaboration','Desenvolver habilidades para trabalhar em equipe.','2025-11-15 15:54:03');

--
-- Table structure for table `movies`
--

CREATE TABLE `movies` (
  `id` int NOT NULL AUTO_INCREMENT,
  `day_id` int NOT NULL,
  `title` varchar(150) NOT NULL,
  `description` text,
  `video_url` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `day_id` (`day_id`),
  CONSTRAINT `movies_ibfk_1` FOREIGN KEY (`day_id`) REFERENCES `days` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `movies`
--


--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(150) NOT NULL,
  `message` text NOT NULL,
  `send_time` datetime NOT NULL,
  `language` enum('pt','es','en') NOT NULL DEFAULT 'pt',
  `target_type` enum('all','class','family','user') NOT NULL,
  `target_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` VALUES (1,'Novo dia liberado','O Dia 2 já está disponível para você continuar sua jornada.','2025-11-11 08:00:00','pt','user',2,'2025-11-11 08:00:00');

--
-- Table structure for table `progress_intelligence`
--

CREATE TABLE `progress_intelligence` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `intelligence_id` int NOT NULL,
  `progress_percent` decimal(5,2) NOT NULL DEFAULT '0.00',
  `streak_days` int NOT NULL DEFAULT '0',
  `last_activity` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_progress` (`user_id`,`intelligence_id`),
  KEY `intelligence_id` (`intelligence_id`),
  CONSTRAINT `progress_intelligence_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `progress_intelligence_ibfk_2` FOREIGN KEY (`intelligence_id`) REFERENCES `intelligences` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `progress_intelligence`
--

INSERT INTO `progress_intelligence` VALUES (1,2,1,75.00,3,'2025-11-17','2025-11-15 18:00:00'),(2,6,1,28.58,1,'2025-11-17','2025-11-18 01:41:59'),(4,7,1,75.00,3,'2025-11-17','2025-11-18 01:54:25'),(5,8,1,42.87,2,'2025-11-18','2025-11-18 02:16:02'),(6,9,1,14.29,1,'2025-11-18','2025-11-18 21:33:47'),(7,10,1,14.29,1,'2025-11-18','2025-11-18 21:51:34'),(8,11,1,57.16,1,'2025-11-23','2025-11-18 22:06:41'),(9,12,1,42.87,1,'2025-11-25','2025-11-18 22:46:00'),(10,3,1,14.29,1,'2025-11-19','2025-11-19 13:46:23'),(11,13,1,14.29,1,'2025-11-23','2025-11-23 14:21:10'),(12,15,1,28.58,1,'2025-11-23','2025-11-23 14:31:42'),(13,16,1,57.16,1,'2025-11-23','2025-11-23 14:49:35'),(14,31,1,14.29,1,'2025-11-24','2025-11-24 12:18:53'),(15,32,1,14.29,1,'2025-11-24','2025-11-24 12:46:36'),(16,33,1,14.29,1,'2025-11-24','2025-11-24 12:49:33'),(17,34,1,14.29,1,'2025-11-24','2025-11-24 12:58:06'),(18,35,1,28.58,1,'2025-11-24','2025-11-24 13:03:13'),(19,36,1,28.58,1,'2025-11-24','2025-11-24 13:22:49'),(20,37,1,14.29,1,'2025-11-24','2025-11-24 13:37:10');

--
-- Table structure for table `quiz_options`
--

CREATE TABLE `quiz_options` (
  `id` int NOT NULL AUTO_INCREMENT,
  `quiz_id` int NOT NULL,
  `option_text` varchar(255) NOT NULL,
  `is_correct` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `quiz_id` (`quiz_id`),
  CONSTRAINT `quiz_options_ibfk_1` FOREIGN KEY (`quiz_id`) REFERENCES `quizzes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `quiz_options`
--

INSERT INTO `quiz_options` VALUES (10,3,'Conhecimento de si mesmo',1,'2025-11-18 18:48:39'),(11,3,'Conhecimento dos outros',0,'2025-11-18 18:48:39'),(12,3,'Conhecimentos gerais',0,'2025-11-18 18:48:39'),(13,3,'Conhecimento sobre pessoas',0,'2025-11-18 18:48:39'),(14,4,'Verdadeiro',1,'2025-11-18 18:56:42'),(15,4,'Falso',0,'2025-11-18 18:56:42'),(16,5,'Verdadeiro',1,'2025-11-18 22:35:23'),(17,5,'Falso',0,'2025-11-18 22:35:23'),(18,17,'Verdadeiro',1,'2025-11-24 00:52:27'),(19,17,'Falso',0,'2025-11-24 00:52:27'),(20,18,'Verdadeiro',1,'2025-11-24 01:12:01'),(21,18,'Falso',0,'2025-11-24 01:12:01');

--
-- Table structure for table `quiz_pairs`
--

CREATE TABLE `quiz_pairs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `quiz_id` int NOT NULL,
  `prompt` varchar(255) NOT NULL,
  `match` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `quiz_id` (`quiz_id`),
  CONSTRAINT `quiz_pairs_ibfk_1` FOREIGN KEY (`quiz_id`) REFERENCES `quizzes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `quiz_pairs`
--


--
-- Table structure for table `quizzes`
--

CREATE TABLE `quizzes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `day_id` int DEFAULT NULL,
  `daily_challenge_id` int DEFAULT NULL,
  `quiz_type` enum('multiple_choice','true_false','match','fill_in','essay','photo','audio') NOT NULL,
  `question` text NOT NULL,
  `language` enum('pt','es','en') NOT NULL DEFAULT 'pt',
  `points` int NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `day_id` (`day_id`),
  KEY `daily_challenge_id` (`daily_challenge_id`),
  CONSTRAINT `quizzes_ibfk_1` FOREIGN KEY (`day_id`) REFERENCES `days` (`id`) ON DELETE SET NULL,
  CONSTRAINT `quizzes_ibfk_2` FOREIGN KEY (`daily_challenge_id`) REFERENCES `daily_challenges` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `quizzes`
--

INSERT INTO `quizzes` VALUES (3,4,NULL,'multiple_choice','É considerado inteligência interpessoal:','pt',1,'2025-11-18 18:48:39'),(4,4,NULL,'true_false','Você sente que se conhece melhor agora que  adquiriu estes conhecimentos de inteligência intrapessoal?','pt',1,'2025-11-18 18:56:42'),(5,5,NULL,'true_false','O subconsciente influencia nossas decisões mesmo quando não percebemos','pt',1,'2025-11-18 22:35:23'),(6,5,NULL,'essay','O que você aprendeu nesta lição?','pt',1,'2025-11-19 13:07:16'),(7,6,NULL,'essay','Qual seu maior sonho a realizar?','pt',1,'2025-11-19 13:43:00'),(8,6,NULL,'essay','Qual sua comida favorita?','pt',1,'2025-11-19 13:43:22'),(9,6,NULL,'essay','Qual seu maior medo?','pt',1,'2025-11-19 13:43:47'),(10,6,NULL,'essay','Qual foi o dia mais feliz da sua vida?','pt',1,'2025-11-19 13:44:23'),(11,7,NULL,'essay','O que mais gostou no filme?','pt',1,'2025-11-19 13:51:24'),(12,7,NULL,'essay','Como vai aplicar este conhecimento na sua vida?','pt',1,'2025-11-19 13:51:47'),(13,7,NULL,'photo','Envie uma foto da sua familia assistindo ao filme da semana!','pt',1,'2025-11-23 14:17:43'),(14,5,NULL,'photo','Teste foto','pt',1,'2025-11-23 14:47:58'),(16,6,NULL,'audio','teste audio','pt',1,'2025-11-23 16:35:31'),(17,NULL,4,'true_false','Teste vdd ou falso','pt',1,'2025-11-24 00:52:27'),(18,NULL,3,'true_false','Teste','pt',1,'2025-11-24 01:12:01'),(19,4,NULL,'essay','O que aprendeu nesta lição?','pt',10,'2025-11-24 13:07:02');

--
-- Table structure for table `referrals`
--

CREATE TABLE `referrals` (
  `id` int NOT NULL AUTO_INCREMENT,
  `referrer_id` int NOT NULL,
  `referral_code` varchar(20) NOT NULL,
  `referred_email` varchar(150) DEFAULT NULL,
  `referred_user_id` int DEFAULT NULL,
  `status` enum('pending','accepted','rejected') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `accepted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `referrer_id` (`referrer_id`),
  KEY `referred_user_id` (`referred_user_id`),
  KEY `idx_referrals_code` (`referral_code`),
  CONSTRAINT `referrals_ibfk_1` FOREIGN KEY (`referrer_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `referrals_ibfk_2` FOREIGN KEY (`referred_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `referrals`
--

INSERT INTO `referrals` VALUES (1,2,'65230E84',NULL,NULL,'pending','2025-11-15 16:02:15',NULL),(2,6,'35040DC7',NULL,NULL,'pending','2025-11-15 18:27:14',NULL),(3,7,'A95ECE53',NULL,NULL,'pending','2025-11-18 01:54:44',NULL),(4,9,'B3F68F20',NULL,NULL,'pending','2025-11-18 20:58:21',NULL),(5,10,'CDC8B42C',NULL,NULL,'pending','2025-11-18 21:50:55',NULL),(6,8,'D1F288F5',NULL,NULL,'pending','2025-11-18 22:05:41',NULL),(7,11,'3CC75B2C',NULL,NULL,'pending','2025-11-19 13:14:06',NULL),(8,15,'C02DC784',NULL,NULL,'pending','2025-11-23 14:37:40',NULL),(9,17,'73329C51',NULL,NULL,'pending','2025-11-23 14:50:32',NULL),(10,16,'E1FF2ACF',NULL,NULL,'pending','2025-11-23 16:58:46',NULL),(11,19,'D1E2727A',NULL,NULL,'pending','2025-11-23 20:55:34',NULL),(12,22,'FD14B780',NULL,NULL,'pending','2025-11-23 22:07:45',NULL),(13,23,'41916539',NULL,NULL,'pending','2025-11-23 22:10:13',NULL),(14,25,'619154D0',NULL,NULL,'pending','2025-11-23 22:28:08',NULL),(15,26,'7A06D0F9',NULL,NULL,'pending','2025-11-23 22:28:30',NULL),(16,28,'5825C70A',NULL,NULL,'pending','2025-11-24 01:13:15',NULL),(17,12,'493CF3BE',NULL,NULL,'pending','2025-11-24 02:06:47',NULL),(18,29,'DBE292EF',NULL,NULL,'pending','2025-11-24 10:50:54',NULL),(19,42,'5828E720',NULL,NULL,'pending','2025-11-25 14:38:05',NULL),(20,45,'949EDF47',NULL,46,'accepted','2025-11-26 12:28:06','2025-11-26 09:28:06');

--
-- Table structure for table `rewards`
--

CREATE TABLE `rewards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(150) NOT NULL,
  `description` text,
  `cost_coins` int NOT NULL,
  `available_quantity` int DEFAULT NULL,
  `valid_from` date DEFAULT NULL,
  `valid_to` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `rewards`
--

INSERT INTO `rewards` VALUES (1,'Poster Digital','Arte exclusiva do desafio para imprimir em casa.',10,97,'2025-11-10','2025-12-31','2025-11-15 15:54:03');

--
-- Table structure for table `schools`
--

CREATE TABLE `schools` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `location` varchar(150) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `schools`
--

INSERT INTO `schools` VALUES (1,'Escola Alfa','Cidade A','2025-11-15 15:54:03'),(2,'Escola Beta','Cidade B','2025-11-15 15:54:03');

--
-- Table structure for table `testimonials`
--

CREATE TABLE `testimonials` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `rating` tinyint NOT NULL,
  `comment` text NOT NULL,
  `approved` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `testimonials_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `testimonials`
--

INSERT INTO `testimonials` VALUES (1,2,5,'Aplicativo incrível para conversar sobre sentimentos.',1,'2025-11-15 13:00:00'),(2,15,4,'Achei o aplicativo bacana.',0,'2025-11-23 14:37:30');

--
-- Table structure for table `trails`
--

CREATE TABLE `trails` (
  `id` int NOT NULL AUTO_INCREMENT,
  `intelligence_id` int NOT NULL,
  `week_number` int NOT NULL,
  `title` varchar(150) NOT NULL,
  `description` text,
  `available_from` date NOT NULL,
  `available_to` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `intelligence_id` (`intelligence_id`),
  CONSTRAINT `trails_ibfk_1` FOREIGN KEY (`intelligence_id`) REFERENCES `intelligences` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `trails`
--

INSERT INTO `trails` VALUES (1,1,1,'Semana 1 - Autoconhecimento','Primeiros passos para identificar emoções.','2025-11-10','2025-11-17','2025-11-15 15:54:03'),(2,2,1,'Semana 1 - Colaboração','Atividades para fortalecer o trabalho em equipe.','2025-11-10','2025-11-17','2025-11-15 15:54:03');

--
-- Table structure for table `user_achievements`
--

CREATE TABLE `user_achievements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `achievement_id` int NOT NULL,
  `earned_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_user_achievement` (`user_id`,`achievement_id`),
  KEY `achievement_id` (`achievement_id`),
  CONSTRAINT `user_achievements_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_achievements_ibfk_2` FOREIGN KEY (`achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_achievements`
--

INSERT INTO `user_achievements` VALUES (1,2,1,'2025-11-17 22:50:27'),(4,7,1,'2025-11-17 22:54:24');

--
-- Table structure for table `user_challenges`
--

CREATE TABLE `user_challenges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `challenge_id` int NOT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `points_earned` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `challenge_id` (`challenge_id`),
  CONSTRAINT `user_challenges_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_challenges_ibfk_2` FOREIGN KEY (`challenge_id`) REFERENCES `challenges` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_challenges`
--

INSERT INTO `user_challenges` VALUES (1,2,1,'2025-11-15 12:00:00','2025-11-15 12:30:00',20,'2025-11-15 12:30:00'),(2,6,1,'2025-11-17 22:38:40','2025-11-17 22:38:40',20,'2025-11-18 01:38:40'),(3,6,2,'2025-11-17 22:38:47','2025-11-17 22:38:47',30,'2025-11-18 01:38:47'),(4,6,3,'2025-11-17 22:38:56','2025-11-17 22:38:56',25,'2025-11-18 01:38:56'),(5,8,2,'2025-11-17 23:28:28','2025-11-17 23:28:28',30,'2025-11-18 02:28:28'),(6,8,1,'2025-11-17 23:28:36','2025-11-17 23:28:36',20,'2025-11-18 02:28:36'),(7,12,1,'2025-11-18 19:49:59','2025-11-18 19:50:08',20,'2025-11-18 22:49:59'),(8,12,2,'2025-11-18 19:50:15','2025-11-18 19:50:15',30,'2025-11-18 22:50:15'),(9,15,2,'2025-11-23 11:36:22','2025-11-23 11:36:22',30,'2025-11-23 14:36:22'),(10,16,2,'2025-11-23 13:48:11','2025-11-23 13:48:11',30,'2025-11-23 16:48:11'),(11,26,1,'2025-11-23 19:29:11','2025-11-23 19:29:11',20,'2025-11-23 22:29:11'),(12,8,3,'2025-11-23 20:14:26','2025-11-23 20:14:26',25,'2025-11-23 23:14:26');

--
-- Table structure for table `user_classes`
--

CREATE TABLE `user_classes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `class_id` int NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `class_id` (`class_id`),
  CONSTRAINT `user_classes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_classes_ibfk_2` FOREIGN KEY (`class_id`) REFERENCES `classes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_classes`
--

INSERT INTO `user_classes` VALUES (1,6,1,'2025-11-15 18:26:36'),(2,7,1,'2025-11-18 01:54:08'),(3,8,1,'2025-11-18 02:15:36'),(4,9,1,'2025-11-18 20:57:45'),(5,10,1,'2025-11-18 21:50:26'),(6,11,1,'2025-11-18 22:06:28'),(7,12,1,'2025-11-18 22:45:10'),(8,13,1,'2025-11-23 14:20:00'),(9,15,1,'2025-11-23 14:22:40'),(10,16,1,'2025-11-23 14:48:41'),(11,17,1,'2025-11-23 14:50:13'),(12,18,1,'2025-11-23 14:51:58'),(13,19,1,'2025-11-23 20:54:46'),(14,20,1,'2025-11-23 21:32:18'),(15,21,1,'2025-11-23 22:07:16'),(16,22,1,'2025-11-23 22:07:22'),(17,23,1,'2025-11-23 22:08:50'),(18,25,1,'2025-11-23 22:27:19'),(19,26,1,'2025-11-23 22:27:33'),(20,27,1,'2025-11-24 01:03:22'),(21,28,1,'2025-11-24 01:08:15'),(22,29,1,'2025-11-24 10:50:05'),(23,30,1,'2025-11-24 11:16:18'),(24,31,1,'2025-11-24 11:18:35'),(25,32,1,'2025-11-24 12:45:27'),(26,33,1,'2025-11-24 12:48:45'),(27,34,1,'2025-11-24 12:57:36'),(28,35,1,'2025-11-24 13:02:32'),(29,36,1,'2025-11-24 13:22:14'),(30,37,1,'2025-11-24 13:35:56'),(31,38,1,'2025-11-24 13:50:13'),(32,40,1,'2025-11-25 12:53:17'),(33,41,1,'2025-11-25 14:04:49'),(34,42,1,'2025-11-25 14:08:22'),(35,43,1,'2025-11-25 14:54:38'),(36,44,1,'2025-11-25 14:55:46'),(37,45,1,'2025-11-26 11:55:50'),(38,46,1,'2025-11-26 12:28:06');

--
-- Table structure for table `user_daily_challenges`
--

CREATE TABLE `user_daily_challenges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `daily_challenge_id` int NOT NULL,
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `points_earned` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_user_daily` (`user_id`,`daily_challenge_id`),
  KEY `daily_challenge_id` (`daily_challenge_id`),
  CONSTRAINT `fk_user_daily_challenge` FOREIGN KEY (`daily_challenge_id`) REFERENCES `daily_challenges` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_user_daily_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_daily_challenges`
--

INSERT INTO `user_daily_challenges` VALUES (3,8,3,'2025-11-23 20:41:00','2025-11-23 20:41:00',15,'2025-11-23 23:41:00'),(4,8,4,'2025-11-23 21:53:00','2025-11-23 21:53:00',10,'2025-11-24 00:53:00'),(5,27,3,'2025-11-23 22:04:04','2025-11-23 22:04:04',15,'2025-11-24 01:04:04'),(6,27,4,'2025-11-23 22:04:22','2025-11-23 22:04:22',10,'2025-11-24 01:04:22'),(7,28,4,'2025-11-23 22:08:33','2025-11-23 22:08:34',10,'2025-11-24 01:08:33'),(8,28,3,'2025-11-23 22:12:43','2025-11-23 22:12:43',15,'2025-11-24 01:12:43'),(9,42,3,'2025-11-25 11:33:57','2025-11-25 11:33:57',15,'2025-11-25 14:33:57'),(10,42,4,'2025-11-25 11:34:44','2025-11-25 11:34:44',10,'2025-11-25 14:34:44');

--
-- Table structure for table `user_day_progress`
--

CREATE TABLE `user_day_progress` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `day_id` int NOT NULL,
  `status` enum('locked','unlocked','completed') NOT NULL DEFAULT 'locked',
  `started_at` datetime DEFAULT NULL,
  `completed_at` datetime DEFAULT NULL,
  `points_earned` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uq_day_user` (`user_id`,`day_id`),
  KEY `day_id` (`day_id`),
  CONSTRAINT `user_day_progress_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_day_progress_ibfk_2` FOREIGN KEY (`day_id`) REFERENCES `days` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_day_progress`
--

INSERT INTO `user_day_progress` VALUES (7,8,4,'completed',NULL,'2025-11-18 16:10:24',10,'2025-11-18 19:10:24'),(8,9,4,'completed',NULL,'2025-11-18 18:33:47',10,'2025-11-18 21:33:47'),(9,10,4,'completed',NULL,'2025-11-18 18:51:34',10,'2025-11-18 21:51:34'),(10,11,4,'completed',NULL,'2025-11-18 19:06:41',10,'2025-11-18 22:06:41'),(11,12,4,'completed',NULL,'2025-11-18 19:46:00',10,'2025-11-18 22:46:00'),(12,12,5,'completed',NULL,'2025-11-18 19:46:52',10,'2025-11-18 22:46:52'),(13,11,5,'completed',NULL,'2025-11-19 10:08:24',10,'2025-11-19 13:08:24'),(14,11,6,'completed',NULL,'2025-11-19 10:41:58',10,'2025-11-19 13:41:58'),(15,3,6,'completed',NULL,'2025-11-19 10:46:23',10,'2025-11-19 13:46:23'),(16,13,7,'completed',NULL,'2025-11-23 11:21:10',10,'2025-11-23 14:21:10'),(17,15,4,'completed',NULL,'2025-11-23 11:31:42',10,'2025-11-23 14:31:42'),(18,15,5,'completed',NULL,'2025-11-23 11:32:53',10,'2025-11-23 14:32:53'),(19,11,7,'completed',NULL,'2025-11-23 11:38:32',10,'2025-11-23 14:38:32'),(20,16,5,'completed',NULL,'2025-11-23 11:49:35',10,'2025-11-23 14:49:35'),(21,16,7,'completed',NULL,'2025-11-23 12:52:54',10,'2025-11-23 15:52:54'),(22,16,4,'completed',NULL,'2025-11-23 13:24:21',10,'2025-11-23 16:24:21'),(23,16,6,'completed',NULL,'2025-11-23 13:44:25',10,'2025-11-23 16:44:25'),(24,31,5,'completed',NULL,'2025-11-24 09:18:53',10,'2025-11-24 12:18:53'),(25,32,5,'completed',NULL,'2025-11-24 09:46:36',10,'2025-11-24 12:46:36'),(26,33,5,'completed',NULL,'2025-11-24 09:49:33',10,'2025-11-24 12:49:33'),(27,34,5,'completed',NULL,'2025-11-24 09:58:06',10,'2025-11-24 12:58:06'),(28,35,5,'completed',NULL,'2025-11-24 10:03:13',10,'2025-11-24 13:03:13'),(29,35,4,'completed',NULL,'2025-11-24 10:07:34',10,'2025-11-24 13:07:34'),(30,36,4,'completed',NULL,'2025-11-24 10:22:49',10,'2025-11-24 13:22:49'),(31,36,5,'completed',NULL,'2025-11-24 10:25:28',10,'2025-11-24 13:25:28'),(32,37,5,'completed',NULL,'2025-11-24 10:37:10',10,'2025-11-24 13:37:10'),(33,12,7,'completed',NULL,'2025-11-25 10:19:08',10,'2025-11-25 13:19:08');

--
-- Table structure for table `user_families`
--

CREATE TABLE `user_families` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `family_id` int NOT NULL,
  `role` enum('parent','teen') NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `family_id` (`family_id`),
  CONSTRAINT `user_families_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_families_ibfk_2` FOREIGN KEY (`family_id`) REFERENCES `families` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_families`
--

INSERT INTO `user_families` VALUES (1,2,1,'teen','2025-11-15 15:54:03');

--
-- Table structure for table `user_notifications`
--

CREATE TABLE `user_notifications` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `notification_id` int NOT NULL,
  `delivered_at` datetime NOT NULL,
  `read_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `notification_id` (`notification_id`),
  CONSTRAINT `user_notifications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_notifications_ibfk_2` FOREIGN KEY (`notification_id`) REFERENCES `notifications` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_notifications`
--

INSERT INTO `user_notifications` VALUES (1,2,1,'2025-11-11 08:01:00','2025-11-11 08:05:00');

--
-- Table structure for table `user_quiz_answers`
--

CREATE TABLE `user_quiz_answers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `quiz_id` int NOT NULL,
  `selected_option_id` int DEFAULT NULL,
  `answer_text` text,
  `answer_audio_url` varchar(255) DEFAULT NULL,
  `answer_image_url` varchar(255) DEFAULT NULL,
  `is_correct` tinyint(1) DEFAULT NULL,
  `validation_status` enum('pending','valid','invalid','manual_review') DEFAULT NULL,
  `validation_feedback` text,
  `ai_model` varchar(80) DEFAULT NULL,
  `ai_confidence` decimal(5,3) DEFAULT NULL,
  `ai_response_json` mediumtext,
  `answered_at` datetime NOT NULL,
  `points_earned` int NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `quiz_id` (`quiz_id`),
  KEY `selected_option_id` (`selected_option_id`),
  CONSTRAINT `user_quiz_answers_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_quiz_answers_ibfk_2` FOREIGN KEY (`quiz_id`) REFERENCES `quizzes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_quiz_answers_ibfk_3` FOREIGN KEY (`selected_option_id`) REFERENCES `quiz_options` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_quiz_answers`
--

INSERT INTO `user_quiz_answers` VALUES (3,8,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 15:56:57',1,'2025-11-18 18:56:57'),(4,8,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 16:10:18',1,'2025-11-18 19:10:18'),(5,8,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 16:10:22',1,'2025-11-18 19:10:22'),(6,8,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 17:10:15',1,'2025-11-18 20:10:15'),(7,8,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 17:10:18',1,'2025-11-18 20:10:18'),(8,9,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 18:33:45',1,'2025-11-18 21:33:45'),(9,9,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 18:33:47',1,'2025-11-18 21:33:47'),(10,10,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 18:51:30',1,'2025-11-18 21:51:30'),(11,10,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 18:51:33',1,'2025-11-18 21:51:33'),(12,11,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 19:06:38',1,'2025-11-18 22:06:38'),(13,11,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 19:06:41',1,'2025-11-18 22:06:41'),(14,12,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 19:45:51',1,'2025-11-18 22:45:51'),(15,12,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 19:46:00',1,'2025-11-18 22:46:00'),(16,12,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-18 19:46:52',1,'2025-11-18 22:46:52'),(17,11,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-19 10:07:56',1,'2025-11-19 13:07:56'),(18,11,6,NULL,'A conhecer melhor a mim mesmo, e que nem tudo acontece só de forma consciente, mas também inconsciente.',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-19 10:08:24',0,'2025-11-19 13:08:24'),(19,3,7,NULL,'Ir para a disney',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-19 10:45:32',0,'2025-11-19 13:45:32'),(20,3,8,NULL,'Chocolate.',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-19 10:45:50',0,'2025-11-19 13:45:50'),(21,3,9,NULL,'Lobisomem.',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-19 10:46:02',0,'2025-11-19 13:46:02'),(22,3,10,NULL,'Quando fui na praia com meus avós.',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-19 10:46:22',0,'2025-11-19 13:46:22'),(23,11,11,NULL,'A historia',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:18:09',0,'2025-11-23 14:18:09'),(24,11,12,NULL,'Prestar mais atenção em meus sentimentos',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:18:28',0,'2025-11-23 14:18:28'),(25,13,11,NULL,'Tudo, principalmente o protagonista',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:20:30',0,'2025-11-23 14:20:30'),(26,13,12,NULL,'Vou prestar mais atenção nas minhas emoções',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:20:43',0,'2025-11-23 14:20:43'),(27,13,13,NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL,NULL,'2025-11-23 11:21:09',0,'2025-11-23 14:21:09'),(28,15,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 11:31:35',1,'2025-11-23 14:31:35'),(29,15,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 11:32:29',1,'2025-11-23 14:32:29'),(30,15,6,NULL,'aprendi que não aprendi nada',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:32:52',0,'2025-11-23 14:32:52'),(31,11,11,NULL,'wqde2d3 fewfwefwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:37:59',0,'2025-11-23 14:37:59'),(32,11,12,NULL,'wefwef wefwefewf wefewfwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:38:03',0,'2025-11-23 14:38:03'),(33,11,13,NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL,NULL,'2025-11-23 11:38:31',0,'2025-11-23 14:38:31'),(34,16,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 11:49:10',1,'2025-11-23 14:49:10'),(35,16,6,NULL,'Muitas coisas, principalmente sobre mim mesmo',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 11:49:21',0,'2025-11-23 14:49:21'),(36,16,14,NULL,NULL,NULL,NULL,NULL,'pending',NULL,NULL,NULL,NULL,'2025-11-23 11:49:35',0,'2025-11-23 14:49:35'),(37,16,11,NULL,'we8fgweihf iweufhiweufh iuwefhiwufh',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:30:14',0,'2025-11-23 15:30:14'),(38,16,12,NULL,'efiuwhewiufhw weiufhweiufhiwhf weifhiweuh',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:30:22',0,'2025-11-23 15:30:22'),(39,16,11,NULL,'ewiufhuwefhw fwehfiuwehf weiufhweifhu',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:45:39',0,'2025-11-23 15:45:39'),(40,16,12,NULL,'efiuhewfhwe weufhiewufh weufhweiufh',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:45:44',0,'2025-11-23 15:45:44'),(41,16,11,NULL,'efwfe wefewfew wefwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:48:02',0,'2025-11-23 15:48:02'),(42,16,12,NULL,'wefwfe wefwefwef wefwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:48:05',0,'2025-11-23 15:48:05'),(43,16,11,NULL,'ewfewf wefwefew wefwefw',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:52:26',0,'2025-11-23 15:52:26'),(44,16,12,NULL,'ewfewfwef wefwefwef wfwefwefwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:52:36',0,'2025-11-23 15:52:36'),(45,16,13,NULL,NULL,NULL,'uploads/quiz_answers/image_20251123_125253_c91c7a7f.png',NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 12:52:53',0,'2025-11-23 15:52:53'),(46,16,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 13:23:36',1,'2025-11-23 16:23:36'),(47,16,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 13:23:41',1,'2025-11-23 16:23:41'),(49,16,7,NULL,'wfewfwef wefwefwefwef wfeewfwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:35:57',0,'2025-11-23 16:35:57'),(50,16,8,NULL,'wfwefwfew wefewfweef wefwefwefwefwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:36:04',0,'2025-11-23 16:36:04'),(51,16,9,NULL,'fwefewfewf wefewfwefwef weft',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:36:14',0,'2025-11-23 16:36:14'),(52,16,10,NULL,'fweewfcewefwefwef wefwefwef',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:36:19',0,'2025-11-23 16:36:19'),(53,16,7,NULL,'efwefewf wfwefewf fewf',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:40:08',0,'2025-11-23 16:40:08'),(54,16,8,NULL,'efwefewf wfwefewf fewf',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:40:14',0,'2025-11-23 16:40:14'),(55,16,9,NULL,'efwefewf wfwefewf fewfefwefewf wfwefewf fewf',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:40:26',0,'2025-11-23 16:40:26'),(56,16,10,NULL,'efwefewf wfwefewf fewf',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:40:29',0,'2025-11-23 16:40:29'),(57,16,7,NULL,'The method or property expo-file-system.getInfoAsync is not available on web, are you sure you\'ve linked all the native dependencies properly?',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:43:56',0,'2025-11-23 16:43:56'),(58,16,8,NULL,'The method or property expo-file-system.getInfoAsync is not available on web, are you sure you\'ve linked all the native dependencies properly?',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:43:59',0,'2025-11-23 16:43:59'),(59,16,9,NULL,'The method or property expo-file-system.getInfoAsync is not available on web, are you sure you\'ve linked all the native dependencies properly?',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:44:03',0,'2025-11-23 16:44:03'),(60,16,10,NULL,'The method or property expo-file-system.getInfoAsync is not available on web, are you sure you\'ve linked all the native dependencies properly?',NULL,NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:44:06',0,'2025-11-23 16:44:06'),(61,16,16,NULL,NULL,'uploads/quiz_answers/audio_20251123_134425_ab0df827.m4a',NULL,NULL,'manual_review',NULL,NULL,NULL,NULL,'2025-11-23 13:44:25',0,'2025-11-23 16:44:25'),(62,8,17,18,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 21:53:00',1,'2025-11-24 00:53:00'),(63,27,17,18,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 22:04:22',1,'2025-11-24 01:04:22'),(64,27,17,18,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 22:04:29',1,'2025-11-24 01:04:29'),(65,28,17,18,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 22:08:33',1,'2025-11-24 01:08:33'),(66,28,18,20,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-23 22:12:43',1,'2025-11-24 01:12:43'),(67,31,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 09:17:25',1,'2025-11-24 12:17:25'),(68,31,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 09:17:29',1,'2025-11-24 12:17:29'),(69,31,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 09:18:13',1,'2025-11-24 12:18:13'),(70,31,6,NULL,'Sobre como o subconsciente influencia nas minhas decisões',NULL,NULL,NULL,'manual_review','Avaliação automática indisponível.',NULL,NULL,NULL,'2025-11-24 09:18:35',0,'2025-11-24 12:18:35'),(71,31,14,NULL,NULL,NULL,'uploads/quiz_answers/image_20251124_091853_23d06e1b.png',NULL,'manual_review','Avaliação automática indisponível.',NULL,NULL,NULL,'2025-11-24 09:18:53',0,'2025-11-24 12:18:53'),(72,32,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 09:45:38',1,'2025-11-24 12:45:38'),(73,32,6,NULL,'Aprendi sobre como meu subconsciente e influente',NULL,NULL,NULL,'manual_review','Avaliação automática indisponível.',NULL,NULL,NULL,'2025-11-24 09:46:22',0,'2025-11-24 12:46:22'),(74,32,14,NULL,NULL,NULL,'uploads/quiz_answers/image_20251124_094635_c7e886e6.png',NULL,'manual_review','Avaliação automática indisponível.',NULL,NULL,NULL,'2025-11-24 09:46:35',0,'2025-11-24 12:46:35'),(75,33,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 09:49:00',1,'2025-11-24 12:49:00'),(76,33,6,NULL,'o video me ensinou sobre como o subconsciente me influencia',NULL,NULL,NULL,'manual_review','Avaliação automática indisponível.',NULL,NULL,NULL,'2025-11-24 09:49:20',0,'2025-11-24 12:49:20'),(77,33,14,NULL,NULL,NULL,'uploads/quiz_answers/image_20251124_094933_cdd8f8ca.png',NULL,'manual_review','Avaliação automática indisponível.',NULL,NULL,NULL,'2025-11-24 09:49:33',0,'2025-11-24 12:49:33'),(78,34,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 09:57:51',1,'2025-11-24 12:57:51'),(79,34,6,NULL,'ewfouhwef weouifhweioufhwiuehf weufhiweuhf',NULL,NULL,NULL,'manual_review','Falha ao contatar o serviço de IA.',NULL,NULL,NULL,'2025-11-24 09:57:55',0,'2025-11-24 12:57:55'),(80,34,14,NULL,NULL,NULL,'uploads/quiz_answers/image_20251124_095804_11df6994.png',NULL,'manual_review','Falha ao contatar o serviço de IA.',NULL,NULL,NULL,'2025-11-24 09:58:05',0,'2025-11-24 12:58:05'),(81,35,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:02:47',1,'2025-11-24 13:02:47'),(82,35,6,NULL,'ewilqfhiwoef weuihfiuwehfwe',NULL,NULL,NULL,'manual_review','Falha ao contatar o serviço de IA.',NULL,NULL,NULL,'2025-11-24 10:02:58',0,'2025-11-24 13:02:58'),(83,35,14,NULL,NULL,NULL,'uploads/quiz_answers/image_20251124_100312_f28ed94c.png',NULL,'manual_review','Falha ao contatar o serviço de IA.',NULL,NULL,NULL,'2025-11-24 10:03:12',0,'2025-11-24 13:03:12'),(84,35,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:06:28',1,'2025-11-24 13:06:28'),(85,35,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:07:21',1,'2025-11-24 13:07:21'),(86,35,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:07:24',1,'2025-11-24 13:07:24'),(87,35,19,NULL,'iufweiojfwefj woifjiowejfiowefjweiofjiweo',NULL,NULL,NULL,'manual_review','Falha ao contatar o serviço de IA.',NULL,NULL,NULL,'2025-11-24 10:07:33',0,'2025-11-24 13:07:33'),(88,36,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:22:29',1,'2025-11-24 13:22:29'),(89,36,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:22:33',1,'2025-11-24 13:22:33'),(90,36,19,NULL,'ewifjweijf iwfjweoifj owejfoweij',NULL,NULL,NULL,'manual_review','Confiança baixa: A resposta não aborda a pergunta e parece ser um texto aleatório, sem conteúdo relevante sobre o que foi aprendido.','gpt-4o-mini',0.100,'{\"is_correct\":false,\"confidence\":0.1,\"feedback\":\"A resposta não aborda a pergunta e parece ser um texto aleatório, sem conteúdo relevante sobre o que foi aprendido.\"}','2025-11-24 10:22:49',0,'2025-11-24 13:22:49'),(91,36,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:24:40',1,'2025-11-24 13:24:40'),(92,36,6,NULL,'Aprendi a importancia do autoconhecimento, que isso me ajuda a tomar melhores decisões e entender minhas emoções',NULL,NULL,1,'valid','A resposta aborda o aprendizado sobre autoconhecimento e suas implicações, o que está alinhado com a pergunta.','gpt-4o-mini',0.900,'{\"is_correct\":true,\"confidence\":0.9,\"feedback\":\"A resposta aborda o aprendizado sobre autoconhecimento e suas implicações, o que está alinhado com a pergunta.\"}','2025-11-24 10:25:08',1,'2025-11-24 13:25:08'),(93,36,14,NULL,NULL,NULL,'uploads/quiz_answers/image_20251124_102527_8bfb3bc7.jpg',0,'invalid','A imagem não pode ser analisada em relação ao que foi pedido, pois não há informações suficientes sobre o que deveria ser atendido.','gpt-4o-mini',0.700,'{\"is_correct\":false,\"confidence\":0.7,\"feedback\":\"A imagem não pode ser analisada em relação ao que foi pedido, pois não há informações suficientes sobre o que deveria ser atendido.\"}','2025-11-24 10:25:28',0,'2025-11-24 13:25:28'),(94,37,3,10,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:36:07',1,'2025-11-24 13:36:07'),(95,37,4,14,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:36:09',1,'2025-11-24 13:36:09'),(96,37,5,16,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-24 10:36:28',1,'2025-11-24 13:36:28'),(97,37,6,NULL,'Aprendi sobre a importancia do autoconhecimento e como isso pode ajudar a entende melhor meus sentimentos',NULL,NULL,1,'valid','A resposta aborda o tema do autoconhecimento e sua relação com a compreensão dos sentimentos, o que está alinhado com a pergunta.','gpt-4o-mini',0.900,'{\"is_correct\":true,\"confidence\":0.9,\"feedback\":\"A resposta aborda o tema do autoconhecimento e sua relação com a compreensão dos sentimentos, o que está alinhado com a pergunta.\"}','2025-11-24 10:36:53',1,'2025-11-24 13:36:53'),(98,37,14,NULL,NULL,NULL,'uploads/quiz_answers/image_20251124_103706_454a395b.jpg',0,'invalid','Confiança baixa: Não é possível avaliar se a imagem atende ao que foi pedido sem informações adicionais sobre o que deveria ser analisado.','manual-admin',NULL,NULL,'2025-11-24 10:37:09',0,'2025-11-24 13:37:09'),(99,12,11,NULL,'Amei! É importante',NULL,NULL,NULL,'manual_review','Confiança baixa: A resposta não aborda especificamente o que foi gostado no filme, apenas expressa uma opinião positiva.','gpt-4o-mini',0.500,'{\"is_correct\":false,\"confidence\":0.5,\"feedback\":\"A resposta não aborda especificamente o que foi gostado no filme, apenas expressa uma opinião positiva.\"}','2025-11-25 10:18:02',0,'2025-11-25 13:18:02'),(100,42,18,20,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-25 11:33:57',1,'2025-11-25 14:33:57'),(101,42,17,18,NULL,NULL,NULL,1,'valid',NULL,NULL,NULL,NULL,'2025-11-25 11:34:44',1,'2025-11-25 14:34:44');

--
-- Table structure for table `user_rewards`
--

CREATE TABLE `user_rewards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `reward_id` int NOT NULL,
  `redeemed_at` datetime NOT NULL,
  `voucher_code` varchar(50) NOT NULL,
  `status` enum('pending','delivered','used') NOT NULL DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `reward_id` (`reward_id`),
  CONSTRAINT `user_rewards_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_rewards_ibfk_2` FOREIGN KEY (`reward_id`) REFERENCES `rewards` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_rewards`
--

INSERT INTO `user_rewards` VALUES (1,2,1,'2025-11-15 12:35:00','PSTR-AB12','delivered','2025-11-15 12:35:00'),(2,6,1,'2025-11-17 22:44:26','7CF6392DB473','pending','2025-11-18 01:44:26'),(3,15,1,'2025-11-23 11:39:55','99A5F328BC92','pending','2025-11-23 14:39:55'),(4,16,1,'2025-11-23 13:59:07','58647BD4012D','pending','2025-11-23 16:59:07');


