/*M!999999\- enable the sandbox mode */ 
-- MariaDB dump 10.19  Distrib 10.11.16-MariaDB, for linux-systemd (x86_64)
--
-- Host: localhost    Database: ahpbot_kheyrabadi
-- ------------------------------------------------------
-- Server version	10.11.16-MariaDB

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

DROP TABLE IF EXISTS `admin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `admin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `one_month` varchar(32) DEFAULT NULL,
  `two_months` varchar(32) DEFAULT NULL,
  `user` varchar(64) NOT NULL,
  `pass` varchar(64) NOT NULL,
  `text` text DEFAULT NULL,
  `text2` text DEFAULT NULL,
  `text3` text DEFAULT NULL,
  `admin_list` text DEFAULT NULL,
  `block_list` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `admin`
--

LOCK TABLES `admin` WRITE;
/*!40000 ALTER TABLE `admin` DISABLE KEYS */;
INSERT INTO `admin` VALUES
(1,'1000','1000','admin','5bfd1e04db7adafc4908107e1cb08c0d','سلام به ربات خوش آمدید \r\n\r\nدکمه ی دریافت هدیه رو بزنید','♦️ لطفا بر روی اشتراک گذاری شماره کلیک کنید ','تشکر بابت به اشتراکی گذاری شماره با شما تماس خواهیم گرفت','5803067539','6546546');
/*!40000 ALTER TABLE `admin` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `broadcast_queue`
--

DROP TABLE IF EXISTS `broadcast_queue`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `broadcast_queue` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `from_chat_id` varchar(64) NOT NULL,
  `message_id` int(11) NOT NULL,
  `target_chat_id` varchar(64) NOT NULL,
  `status` enum('pending','sent','failed') NOT NULL DEFAULT 'pending',
  `created_at` int(11) NOT NULL,
  `sent_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `status` (`status`),
  KEY `created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `broadcast_queue`
--

LOCK TABLES `broadcast_queue` WRITE;
/*!40000 ALTER TABLE `broadcast_queue` DISABLE KEYS */;
/*!40000 ALTER TABLE `broadcast_queue` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shop_categories`
--

DROP TABLE IF EXISTS `shop_categories`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `shop_categories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(128) NOT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shop_categories`
--

LOCK TABLES `shop_categories` WRITE;
/*!40000 ALTER TABLE `shop_categories` DISABLE KEYS */;
INSERT INTO `shop_categories` VALUES
(1,'دسته بندی تست',0,1),
(2,'لوازم دیجیتال',2,1),
(3,'ممبر آپلودر',2,1);
/*!40000 ALTER TABLE `shop_categories` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shop_orders`
--

DROP TABLE IF EXISTS `shop_orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `shop_orders` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_chatid` varchar(64) NOT NULL,
  `product_id` int(11) NOT NULL,
  `product_title` varchar(256) NOT NULL,
  `category_title` varchar(128) DEFAULT NULL,
  `price` decimal(14,0) NOT NULL DEFAULT 0,
  `discount_code` varchar(64) DEFAULT NULL,
  `discount_amount` decimal(14,0) NOT NULL DEFAULT 0,
  `full_name` varchar(256) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `address` text DEFAULT NULL,
  `payment_method` enum('wallet','card') NOT NULL DEFAULT 'card',
  `status` enum('pending_payment','pending_verify','paid','rejected','cancelled') NOT NULL DEFAULT 'pending_payment',
  `receipt_file` varchar(256) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  `paid_at` int(11) DEFAULT NULL,
  `processed_by` varchar(64) DEFAULT NULL,
  `admin_note` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_chatid` (`user_chatid`),
  KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shop_orders`
--

LOCK TABLES `shop_orders` WRITE;
/*!40000 ALTER TABLE `shop_orders` DISABLE KEYS */;
INSERT INTO `shop_orders` VALUES
(1,'5625196705',1,'محصول تست یک','دسته بندی تست',5000,'gsdfg','09022692479','fasdf','wallet','paid',NULL,1782663945,1782663945,NULL,NULL),
(2,'6849497001',1,'محصول تست یک','دسته بندی تست',5000,'Bcnx','09362969718','Bcnxnx','wallet','paid',NULL,1782746368,1782746368,NULL,NULL);
/*!40000 ALTER TABLE `shop_orders` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shop_products`
--

DROP TABLE IF EXISTS `shop_products`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `shop_products` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category_id` int(11) NOT NULL,
  `title` varchar(256) NOT NULL,
  `price` decimal(14,0) NOT NULL DEFAULT 0,
  `description` text DEFAULT NULL,
  `sort_order` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `category_id` (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shop_products`
--

LOCK TABLES `shop_products` WRITE;
/*!40000 ALTER TABLE `shop_products` DISABLE KEYS */;
INSERT INTO `shop_products` VALUES
(1,1,'محصول تست یک',5000,'توضیحات مربوطه',0,1),
(2,2,'تست دو',60000000,'Hdhjdjhhd',2,1),
(3,1,'ممبر آپلودر',60000,'',0,1),
(4,3,'تست دو',6000000,'fhihjkghjk',2,1);
/*!40000 ALTER TABLE `shop_products` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `shop_settings`
--

DROP TABLE IF EXISTS `shop_settings`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `shop_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(64) NOT NULL,
  `setting_value` text DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `setting_key` (`setting_key`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `shop_settings`
--

LOCK TABLES `shop_settings` WRITE;
/*!40000 ALTER TABLE `shop_settings` DISABLE KEYS */;
INSERT INTO `shop_settings` VALUES
(1,'payment_card','6037-9971-XXXX-XXXX'),
(2,'payment_card_holder','نام صاحب حساب'),
(3,'support_username','AHPBot_support'),
(4,'bot_name','فروشگاه'),
(5,'welcome_text','سلام 👋\r\nبه ربات فروشگاهی خوش آمدید.\r\nاز منوی زیر استفاده کنید:');
/*!40000 ALTER TABLE `shop_settings` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `discount_codes`
--

DROP TABLE IF EXISTS `discount_codes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `discount_codes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(64) NOT NULL,
  `discount_type` enum('percent','fixed') NOT NULL DEFAULT 'percent',
  `discount_value` decimal(14,2) NOT NULL DEFAULT 0,
  `max_uses` int(11) DEFAULT NULL,
  `used_count` int(11) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1,
  `expires_at` int(11) DEFAULT NULL,
  `created_at` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `telfamily` varchar(128) DEFAULT NULL,
  `telname` varchar(128) DEFAULT NULL,
  `username` varchar(128) DEFAULT NULL,
  `chatid` varchar(64) NOT NULL,
  `req1` varchar(128) DEFAULT NULL,
  `req2` varchar(128) DEFAULT NULL,
  `req3` varchar(128) DEFAULT NULL,
  `balance` decimal(14,0) NOT NULL DEFAULT 0,
  `phone` varchar(20) DEFAULT NULL,
  `full_name` varchar(256) DEFAULT NULL,
  `address` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES
(1,'','AHPBot Support','AHPBot_support','5625196705','','','',6000,NULL,NULL),
(2,'','Matin','matinshirani01','5803067539','','','',0,NULL,NULL),
(3,'Pakdel','Amir hosein','ahpbot_sale','6849497001','','','',4999995000,NULL,NULL),
(4,'','moshsvre','mosshhaavr','5658245243','','','',0,NULL,NULL),
(5,'موبایل عرش','بازرگانی','Arshmobileorg','292645116','buy_product','1','',0,NULL,NULL),
(6,'','Majid','majid_mitra_collective','78647237',NULL,NULL,NULL,0,NULL,NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `wallet_receipts`
--

DROP TABLE IF EXISTS `wallet_receipts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `wallet_receipts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_chatid` varchar(64) NOT NULL,
  `photo_file` varchar(256) DEFAULT NULL,
  `amount` decimal(14,0) DEFAULT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `created_at` int(11) NOT NULL,
  `processed_at` int(11) DEFAULT NULL,
  `processed_by` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_chatid` (`user_chatid`),
  KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `wallet_receipts`
--

LOCK TABLES `wallet_receipts` WRITE;
/*!40000 ALTER TABLE `wallet_receipts` DISABLE KEYS */;
INSERT INTO `wallet_receipts` VALUES
(1,'5625196705','image1782659921230.png',5000000,'approved',1782659921,1782659947,'5803067539'),
(2,'5625196705','image1782663973484.png',6000,'approved',1782663973,1782663996,'5803067539'),
(3,'6849497001','image1782746202849.png',NULL,'rejected',1782746202,1782746839,NULL),
(4,'6849497001','image1782746307305.png',5000000000,'approved',1782746308,1782746341,'5803067539');
/*!40000 ALTER TABLE `wallet_receipts` 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 2026-08-25 19:14:41
