-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 12, 2025 at 05:45 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!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 */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `tips`
--

-- --------------------------------------------------------

--
-- Table structure for table `tips`
--

CREATE TABLE `tips` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `tag` enum('free','paid') NOT NULL,
  `category` varchar(255) NOT NULL,
  `matches` text NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `author` varchar(255) NOT NULL,
  `odds_source` varchar(100) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tips`
--

INSERT INTO `tips` (`id`, `title`, `tag`, `category`, `matches`, `amount`, `author`, `odds_source`, `created_at`, `updated_at`) VALUES
(25, 'VIP Ticker #22', 'paid', 'VIP Ticket', '[{\"team1\":\"Heidenheim\",\"team2\":\"Bochum\",\"prediction\":\"Over 1.5\",\"odds\":\"1.25\"},{\"team1\":\"Torino FC\",\"team2\":\"Venezia\",\"prediction\":\"Over 0.5\",\"odds\":\"1.11\"},{\"team1\":\"Man City\",\"team2\":\"Wolves\",\"prediction\":\"Over 2.5\",\"odds\":\"1.57\"}]', 10000.00, 'Munasingo Matovu', 'Champion Bet', '2025-05-02 16:18:17', '2025-05-02 16:18:17'),
(26, 'Saturday VIP Ticket', 'paid', 'VIP Ticket', '[{\"team1\":\"Alaves\",\"team2\":\"Atl. Madrid\",\"prediction\":\"X2\",\"odds\":\"1.29\"},{\"team1\":\"Lecce\",\"team2\":\"Napoli\",\"prediction\":\"2\",\"odds\":\"1.53\"},{\"team1\":\"Inter\",\"team2\":\"Verona\",\"prediction\":\"1\",\"odds\":\"1.40\"}]', 10000.00, 'Munasingo Matovu', 'Champion Bet', '2025-05-03 00:22:20', '2025-05-03 00:22:20'),
(27, 'Free Ticket #35', 'free', 'Free Ticket', '[{\"team1\":\"Derby County\",\"team2\":\"Stoke\",\"prediction\":\"1\",\"odds\":\"2.06\"}]', 0.00, 'Freemium', 'VBet', '2025-05-03 11:18:33', '2025-05-03 11:18:33'),
(29, 'Free Ticket #36', 'free', 'Free Ticket', '[{\"team1\":\"Al Ahli\",\"team2\":\"Kawasaki Frontale\",\"prediction\":\"1 or Over 3.5\",\"odds\":\"2.5\"}]', 0.00, 'Freemium', 'Bet365', '2025-05-03 12:13:13', '2025-05-03 12:13:13'),
(30, 'Pred Test', 'free', 'Free Ticket', '[{\"team1\":\"Arsenal\",\"team2\":\"Real Madrid\",\"prediction\":\"1\",\"odds\":\"3\"}]', 0.00, 'Freemium', '22Bet', '2025-05-03 14:29:59', '2025-05-03 14:29:59');

-- --------------------------------------------------------

--
-- Table structure for table `tipster_stats`
--

CREATE TABLE `tipster_stats` (
  `author` varchar(255) NOT NULL,
  `total_predictions` int(11) NOT NULL DEFAULT 0,
  `correct_predictions` int(11) NOT NULL DEFAULT 0,
  `success_rate` decimal(5,2) NOT NULL DEFAULT 0.00,
  `last_updated` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tipster_stats`
--

INSERT INTO `tipster_stats` (`author`, `total_predictions`, `correct_predictions`, `success_rate`, `last_updated`) VALUES
('Freemium', 1, 1, 100.00, '2025-05-03 15:30:47'),
('Munasingo Matovu', 3, 2, 66.67, '2025-05-03 15:30:47');

-- --------------------------------------------------------

--
-- Table structure for table `tips_unlock`
--

CREATE TABLE `tips_unlock` (
  `id` int(11) NOT NULL,
  `msisdn` varchar(20) NOT NULL,
  `tip_id` int(11) NOT NULL,
  `transaction_id` varchar(50) NOT NULL,
  `unlock_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1=unlocked',
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tips_unlock`
--

INSERT INTO `tips_unlock` (`id`, `msisdn`, `tip_id`, `transaction_id`, `unlock_status`, `created_at`) VALUES
(14, '256701123456', 25, '123455432112345', 1, '2025-05-12 18:30:08');

-- --------------------------------------------------------

--
-- Table structure for table `tip_predictions`
--

CREATE TABLE `tip_predictions` (
  `id` int(11) NOT NULL,
  `tip_id` int(11) DEFAULT NULL,
  `author` varchar(255) NOT NULL,
  `match_data` text NOT NULL,
  `prediction_outcome` enum('pending','correct','wrong') NOT NULL DEFAULT 'pending',
  `match_date` date NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `tip_predictions`
--

INSERT INTO `tip_predictions` (`id`, `tip_id`, `author`, `match_data`, `prediction_outcome`, `match_date`, `created_at`, `updated_at`) VALUES
(1, 26, 'Munasingo Matovu', '{\"team1\":\"Alaves\",\"team2\":\"Atl. Madrid\",\"prediction\":\"X2\",\"odds\":\"1.29\"}', 'correct', '2025-05-03', '2025-05-03 14:31:20', '2025-05-03 14:44:48'),
(2, 26, 'Munasingo Matovu', '{\"team1\":\"Lecce\",\"team2\":\"Napoli\",\"prediction\":\"2\",\"odds\":\"1.53\"}', 'wrong', '2025-05-03', '2025-05-03 14:31:20', '2025-05-03 14:45:10'),
(3, 26, 'Munasingo Matovu', '{\"team1\":\"Inter\",\"team2\":\"Verona\",\"prediction\":\"1\",\"odds\":\"1.40\"}', 'correct', '2025-05-03', '2025-05-03 14:31:20', '2025-05-03 14:45:15'),
(4, 30, 'Freemium', '{\"team1\":\"Arsenal\",\"team2\":\"Real Madrid\",\"prediction\":\"1\",\"odds\":\"3\"}', 'correct', '2025-05-03', '2025-05-03 15:14:21', '2025-05-03 15:23:20');

-- --------------------------------------------------------

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `id` int(10) UNSIGNED NOT NULL,
  `msisdn` varchar(20) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `tip_id` int(11) DEFAULT NULL,
  `transaction_id` varchar(50) NOT NULL,
  `naration` varchar(255) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0=pending, 1=success, 2=failed',
  `tip_unlocked` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0=locked, 1=unlocked',
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `transactions`
--

INSERT INTO `transactions` (`id`, `msisdn`, `amount`, `tip_id`, `transaction_id`, `naration`, `status`, `tip_unlocked`, `created_at`, `updated_at`) VALUES
(29, '256701123456', 10000.00, 25, '123455432112345', 'Tips', 1, 1, '2025-05-12 17:38:40', '2025-05-12 18:30:08');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `tips`
--
ALTER TABLE `tips`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tipster_stats`
--
ALTER TABLE `tipster_stats`
  ADD PRIMARY KEY (`author`);

--
-- Indexes for table `tips_unlock`
--
ALTER TABLE `tips_unlock`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tip_predictions`
--
ALTER TABLE `tip_predictions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `author` (`author`),
  ADD KEY `tip_id` (`tip_id`);

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `tips`
--
ALTER TABLE `tips`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `tips_unlock`
--
ALTER TABLE `tips_unlock`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `tip_predictions`
--
ALTER TABLE `tip_predictions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
COMMIT;

/*!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 */;
