--
-- Host: localhost    Database: keska_db
-- ------------------------------------------------------


--
-- Table structure for table `activity_logs`
--

CREATE TABLE `activity_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `action` varchar(100) NOT NULL,
  `table_name` varchar(50) DEFAULT NULL,
  `record_id` int(11) DEFAULT NULL,
  `old_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`old_values`)),
  `new_values` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`new_values`)),
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_user_action` (`user_id`,`action`),
  KEY `idx_created_at` (`created_at`),
  CONSTRAINT `activity_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `activity_logs`
--

INSERT INTO `activity_logs` VALUES (1,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36','2026-02-10 08:34:39'),(2,1,'logout','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36','2026-02-10 14:52:54'),(3,1,'login','users',1,NULL,NULL,'::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36','2026-02-10 14:52:57');

--
-- Table structure for table `all_payments_consolidated`
--

CREATE TABLE `all_payments_consolidated` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payment_date` date NOT NULL,
  `payment_name` varchar(200) NOT NULL,
  `detail` text DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL,
  `source` varchar(50) NOT NULL,
  `source_id` int(11) NOT NULL,
  `status` enum('pending','paid','overdue','uncertain') DEFAULT 'pending',
  `category` varchar(50) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_payment_date` (`payment_date`),
  KEY `idx_source` (`source`,`source_id`),
  KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `all_payments_consolidated`
--


--
-- Table structure for table `bank_bch`
--

CREATE TABLE `bank_bch` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bank_name` varchar(100) NOT NULL COMMENT 'Banka ad├ä┬▒',
  `amount` decimal(15,2) NOT NULL COMMENT 'Bor├â┬ğ tutar├ä┬▒',
  `due_date` date NOT NULL COMMENT 'Vade tarihi',
  `status` enum('BEKLEMEDE','├âÔÇôDEME') DEFAULT 'BEKLEMEDE' COMMENT '├âÔÇôdeme durumu',
  `payment_date` date DEFAULT NULL COMMENT '├âÔÇôdenme tarihi',
  `reference_number` varchar(100) DEFAULT NULL COMMENT 'Referans/Dekont numaras├ä┬▒',
  `description` text DEFAULT NULL COMMENT 'A├â┬ğ├ä┬▒klama',
  `created_by` int(11) DEFAULT NULL COMMENT 'Kayd├ä┬▒ olu├à┼©turan kullan├ä┬▒c├ä┬▒',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`),
  KEY `idx_due_date` (`due_date`),
  KEY `idx_status` (`status`),
  KEY `idx_bank_name` (`bank_name`),
  CONSTRAINT `bank_bch_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci COMMENT='BCH tek seferlik banka ├â┬Âdemeleri';

--
-- Dumping data for table `bank_bch`
--

INSERT INTO `bank_bch` VALUES (37,'ZIRAAT BANK-BCH',0.00,'2026-02-10','','2026-02-10',NULL,'300 bin odendi KMH lar ile',NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(38,'AKBANK-BCH',350000.00,'2026-02-18','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(39,'ZIRAAT BANK-BCH',200000.00,'2026-04-17','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(40,'HALK BANK-BCH',300000.00,'2026-05-07','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(41,'HALK BANK-BCH',500000.00,'2026-05-26','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(42,'ZIRAAT BANK-BCH',100000.00,'2026-05-26','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(43,'HALK BANK-BCH',575000.00,'2026-06-05','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(44,'ZIRAAT BANK-BCH',100000.00,'2026-06-12','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(45,'AKBANK-BCH',350000.00,'2026-06-13','BEKLEMEDE',NULL,NULL,NULL,NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28');

--
-- Table structure for table `bank_installment_loans`
--

CREATE TABLE `bank_installment_loans` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bank_name` varchar(100) NOT NULL COMMENT 'Banka ad├ä┬▒',
  `loan_amount` decimal(15,2) NOT NULL COMMENT 'Toplam kredi tutar├ä┬▒',
  `monthly_payment` decimal(15,2) NOT NULL COMMENT 'Ayl├ä┬▒k taksit tutar├ä┬▒',
  `total_installments` int(11) NOT NULL COMMENT 'Toplam taksit say├ä┬▒s├ä┬▒',
  `remaining_installments` int(11) NOT NULL COMMENT 'Kalan taksit say├ä┬▒s├ä┬▒',
  `start_date` date NOT NULL COMMENT 'Kredi ba├à┼©lang├ä┬▒├â┬ğ tarihi',
  `next_payment_date` date NOT NULL COMMENT 'Sonraki ├â┬Âdeme tarihi',
  `status` enum('DEVAM ED├ä┬░YOR','KRED├ä┬░','TAMAMLANDI') DEFAULT 'DEVAM ED├ä┬░YOR' COMMENT 'Kredi durumu',
  `description` text DEFAULT NULL COMMENT 'A├â┬ğ├ä┬▒klama',
  `created_by` int(11) DEFAULT NULL COMMENT 'Kayd├ä┬▒ olu├à┼©turan kullan├ä┬▒c├ä┬▒',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`),
  KEY `idx_next_payment` (`next_payment_date`),
  KEY `idx_status` (`status`),
  KEY `idx_bank_name` (`bank_name`),
  CONSTRAINT `bank_installment_loans_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci COMMENT='Ayl├ä┬▒k e├à┼© taksitli krediler';

--
-- Dumping data for table `bank_installment_loans`
--

INSERT INTO `bank_installment_loans` VALUES (25,'GARANTI BANK',500000.00,35427.77,1,1,'2026-01-01','2026-03-01','','Odeme gunu: 1',NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(26,'IS BANKASI',600000.00,63251.77,1,1,'2026-01-01','2026-03-17','','Odeme gunu: 17',NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(27,'ZIRAAT BANK',500000.00,59106.73,1,1,'2026-01-01','2026-03-20','','Odeme gunu: 20',NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(28,'HALK BANKASI',850000.00,56896.20,1,1,'2026-01-01','2026-03-05','','Odeme gunu: 5',NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(29,'YAPI KREDI',500000.00,31398.79,1,1,'2026-01-01','2026-03-19','','Odeme gunu: 19',NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28'),(30,'ZIRAAT BANK',500000.00,57783.21,1,1,'2026-01-01','2026-03-10','','Odeme gunu: 10',NULL,'2026-02-10 14:05:28','2026-02-10 14:05:28');

--
-- Table structure for table `bank_installment_payments`
--

CREATE TABLE `bank_installment_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `loan_id` int(11) NOT NULL COMMENT 'Kredi ID (bank_installment_loans)',
  `payment_number` int(11) NOT NULL COMMENT 'Taksit numaras├ä┬▒ (1, 2, 3...)',
  `payment_date` date NOT NULL COMMENT 'Planlanan ├â┬Âdeme tarihi',
  `amount` decimal(15,2) NOT NULL COMMENT 'Taksit tutar├ä┬▒',
  `status` enum('BEKLEMEDE','├âÔÇôDEND├ä┬░') DEFAULT 'BEKLEMEDE' COMMENT '├âÔÇôdeme durumu',
  `paid_date` date DEFAULT NULL COMMENT 'Ger├â┬ğek ├â┬Âdenme tarihi',
  `description` text DEFAULT NULL COMMENT 'A├â┬ğ├ä┬▒klama',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_loan_payment` (`loan_id`,`payment_date`),
  KEY `idx_status` (`status`),
  KEY `idx_payment_date` (`payment_date`),
  CONSTRAINT `bank_installment_payments_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `bank_installment_loans` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci COMMENT='Taksitli kredi ├â┬Âdeme detaylar├ä┬▒';

--
-- Dumping data for table `bank_installment_payments`
--

INSERT INTO `bank_installment_payments` VALUES (7,25,1,'2026-03-01',35427.77,'BEKLEMEDE',NULL,NULL,'2026-02-10 14:05:28'),(8,26,1,'2026-03-17',63251.77,'BEKLEMEDE',NULL,NULL,'2026-02-10 14:05:28'),(9,27,1,'2026-03-20',59106.73,'BEKLEMEDE',NULL,NULL,'2026-02-10 14:05:28'),(10,28,1,'2026-03-05',56896.20,'BEKLEMEDE',NULL,NULL,'2026-02-10 14:05:28'),(11,29,1,'2026-03-19',31398.79,'BEKLEMEDE',NULL,NULL,'2026-02-10 14:05:28'),(12,30,1,'2026-03-10',57783.21,'BEKLEMEDE',NULL,NULL,'2026-02-10 14:05:28');

--
-- Table structure for table `bank_transactions`
--

CREATE TABLE `bank_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bank_id` int(11) NOT NULL,
  `account_category` enum('bch','kmh','installment_loan','credit_card') DEFAULT NULL,
  `transaction_type` enum('borrow','payment','adjustment') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `transaction_date` date NOT NULL,
  `description` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`),
  KEY `idx_bank_trans` (`bank_id`,`transaction_date`),
  KEY `idx_account_category` (`account_category`),
  CONSTRAINT `bank_transactions_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`) ON DELETE CASCADE,
  CONSTRAINT `bank_transactions_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `bank_transactions`
--


--
-- Table structure for table `banks`
--

CREATE TABLE `banks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `bank_name` varchar(100) NOT NULL,
  `limit_amount` decimal(15,2) NOT NULL DEFAULT 0.00,
  `used_amount` decimal(15,2) DEFAULT 0.00,
  `available_amount` decimal(15,2) GENERATED ALWAYS AS (`limit_amount` - `used_amount`) STORED,
  `account_type` enum('kmh') DEFAULT 'kmh' COMMENT 'Art├ä┬▒k sadece KMH i├â┬ğin kullan├ä┬▒l├ä┬▒yor',
  `account_subtype` varchar(50) DEFAULT NULL COMMENT 'Alt tip: B├ä┬░REYSEL, T├ä┬░CAR├ä┬░ vb.',
  `status` enum('BEKLEMEDE','├âÔÇôDEND├ä┬░') DEFAULT 'BEKLEMEDE' COMMENT 'Genel durum',
  `last_update_date` date DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_bank_name` (`bank_name`),
  KEY `idx_account_type` (`account_type`),
  KEY `idx_status` (`status`),
  KEY `idx_account_subtype` (`account_subtype`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `banks`
--

INSERT INTO `banks` VALUES (1,'HALK BANK-B─░REYSEL',350000.00,271000.00,79000.00,'kmh',NULL,'BEKLEMEDE',NULL,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(2,'HALK BANK-T─░CAR─░',100000.00,92000.00,8000.00,'kmh',NULL,'BEKLEMEDE',NULL,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(3,'GARANT─░ BANK',150000.00,98000.00,52000.00,'kmh',NULL,'BEKLEMEDE',NULL,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(4,'AKBANK',50000.00,0.00,50000.00,'kmh',NULL,'BEKLEMEDE',NULL,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(5,'─░┼Ş BANK',250000.00,53500.00,196500.00,'kmh',NULL,'BEKLEMEDE',NULL,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(6,'Z─░RAAT BANK',30000.00,0.00,30000.00,'kmh',NULL,'BEKLEMEDE',NULL,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(7,'YAPI KRED─░',100000.00,90000.00,10000.00,'kmh',NULL,'BEKLEMEDE',NULL,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08');

--
-- Table structure for table `credit_card_payments`
--

CREATE TABLE `credit_card_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `card_id` int(11) NOT NULL,
  `year` int(11) NOT NULL,
  `month` int(11) NOT NULL CHECK (`month` between 1 and 12),
  `minimum_payment` decimal(15,2) DEFAULT NULL,
  `total_amount` decimal(15,2) DEFAULT NULL,
  `payment_status` enum('pending','paid','partial') DEFAULT 'pending',
  `paid_amount` decimal(15,2) DEFAULT 0.00,
  `payment_date` date DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_card_month` (`card_id`,`year`,`month`),
  KEY `idx_payment_date` (`year`,`month`),
  CONSTRAINT `credit_card_payments_ibfk_1` FOREIGN KEY (`card_id`) REFERENCES `credit_cards` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `credit_card_payments`
--


--
-- Table structure for table `import_history`
--

CREATE TABLE `import_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `filename` varchar(255) NOT NULL,
  `file_path` varchar(500) DEFAULT NULL,
  `imported_by` int(11) DEFAULT NULL,
  `import_type` varchar(50) DEFAULT NULL,
  `records_imported` int(11) DEFAULT 0,
  `status` enum('success','partial','failed') DEFAULT 'success',
  `error_log` text DEFAULT NULL,
  `imported_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `imported_by` (`imported_by`),
  KEY `idx_imported_at` (`imported_at`),
  CONSTRAINT `import_history_ibfk_1` FOREIGN KEY (`imported_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `import_history`
--


--
-- Table structure for table `monthly_payment_details`
--

CREATE TABLE `monthly_payment_details` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payment_id` int(11) NOT NULL,
  `year` int(11) NOT NULL,
  `month` int(11) NOT NULL CHECK (`month` between 1 and 12),
  `amount` decimal(15,2) DEFAULT NULL,
  `status` enum('pending','paid','uncertain') DEFAULT 'pending',
  `payment_date` date DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_payment_month` (`payment_id`,`year`,`month`),
  KEY `idx_month_year` (`year`,`month`),
  CONSTRAINT `monthly_payment_details_ibfk_1` FOREIGN KEY (`payment_id`) REFERENCES `monthly_payments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `monthly_payment_details`
--


--
-- Table structure for table `monthly_payments`
--

CREATE TABLE `monthly_payments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `payment_name` varchar(100) NOT NULL,
  `payment_day` int(11) DEFAULT NULL CHECK (`payment_day` between 1 and 31),
  `category` enum('kdv','sgk','rent','electricity','water','gas','phone','internet','salary','other') DEFAULT 'other',
  `is_recurring` tinyint(1) DEFAULT 1,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_payment_name` (`payment_name`),
  KEY `idx_category` (`category`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `monthly_payments`
--

INSERT INTO `monthly_payments` VALUES (1,'KDV',25,'kdv',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(2,'SGK',30,'sgk',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(3,'Vergi',25,'other',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(4,'Kira',1,'rent',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(5,'Elektrik',5,'electricity',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(6,'Su',10,'water',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(7,'Do─şalgaz',5,'gas',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(8,'Telefon',5,'phone',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(9,'─░nternet',5,'internet',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(10,'Maa┼şlar',1,'salary',1,NULL,'2026-02-10 08:54:08','2026-02-10 08:54:08');

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

CREATE TABLE `notifications` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `title` varchar(200) NOT NULL,
  `message` text NOT NULL,
  `type` enum('warning','info','danger','success') DEFAULT 'info',
  `is_read` tinyint(1) DEFAULT 0,
  `related_payment_source` varchar(50) DEFAULT NULL,
  `related_payment_id` int(11) DEFAULT NULL,
  `notify_date` date DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_user_read` (`user_id`,`is_read`),
  KEY `idx_notify_date` (`notify_date`),
  CONSTRAINT `notifications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

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


--
-- Table structure for table `received_checks`
--

CREATE TABLE `received_checks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `customer_name` varchar(200) NOT NULL,
  `bank_name` varchar(100) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL,
  `due_date` date NOT NULL,
  `check_number` varchar(100) DEFAULT NULL,
  `status` enum('BEKLEMEDE','TAHSIL_EDILDI','IADE','CIRO_EDILDI') DEFAULT 'BEKLEMEDE',
  `description` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_due_date` (`due_date`),
  KEY `idx_status` (`status`),
  KEY `idx_customer_name` (`customer_name`),
  KEY `created_by` (`created_by`),
  CONSTRAINT `received_checks_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `received_checks`
--

INSERT INTO `received_checks` VALUES (1,'MUHAMMET BAH├çE','Z─░RAAT B',100000.00,'2026-02-16',NULL,'BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:35:18'),(2,'AL─░ M─░MARLIK MEHMET MER─░├ç','DEN─░ZBANK',200000.00,'2026-03-13',NULL,'BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(3,'MURAT YILDIZ','QNB',280000.00,'2026-05-22',NULL,'BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(4,'MURAT YILDIZ','QNB',280000.00,'2026-06-19',NULL,'BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(5,'MURAT YILDIZ','QNB',290000.00,'2026-07-24',NULL,'BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40');

--
-- Table structure for table `supplier_checks`
--

CREATE TABLE `supplier_checks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_id` int(11) NOT NULL,
  `supplier_transaction_id` int(11) NOT NULL,
  `check_number` varchar(100) NOT NULL,
  `bank_name` varchar(100) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL,
  `issue_date` date NOT NULL,
  `due_date` date NOT NULL,
  `status` enum('BEKLEMEDE','TAHSIL_EDILDI','IADE') DEFAULT 'BEKLEMEDE',
  `description` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_supplier_transaction` (`supplier_transaction_id`),
  KEY `idx_due_date` (`due_date`),
  KEY `idx_status` (`status`),
  KEY `idx_supplier` (`supplier_id`),
  KEY `created_by` (`created_by`),
  CONSTRAINT `supplier_checks_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_checks_ibfk_2` FOREIGN KEY (`supplier_transaction_id`) REFERENCES `supplier_transactions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_checks_ibfk_3` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `supplier_checks`
--

INSERT INTO `supplier_checks` VALUES (1,19,26,'Belirsiz','AKBANK',19500.00,'2026-02-27','2026-02-27','BEKLEMEDE',NULL,1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(2,31,27,'Belirsiz','HALK B',190000.00,'2026-03-06','2026-03-06','BEKLEMEDE',NULL,1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(3,32,28,'Belirsiz','─░┼Ş BANK',45000.00,'2026-03-18','2026-03-18','BEKLEMEDE',NULL,1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(4,33,29,'Belirsiz','Z─░RAAT B',45000.00,'2026-03-20','2026-03-20','BEKLEMEDE',NULL,1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(5,32,30,'Belirsiz','─░┼Ş BANK',45000.00,'2026-04-21','2026-04-21','BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(6,33,31,'Belirsiz','Z─░RAAT B',45000.00,'2026-04-24','2026-04-24','BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(7,23,32,'Belirsiz','─░┼Ş BANK',75000.00,'2026-04-24','2026-04-24','BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(8,23,33,'Belirsiz','─░┼Ş BANK',100000.00,'2026-05-29','2026-05-29','BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(9,23,34,'Belirsiz','─░┼Ş BANK',150000.00,'2026-06-25','2026-06-25','BEKLEMEDE',NULL,1,'2026-02-10 14:34:40','2026-02-10 14:34:40');

--
-- Table structure for table `supplier_transactions`
--

CREATE TABLE `supplier_transactions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_id` int(11) NOT NULL,
  `transaction_type` enum('purchase','payment','refund','adjustment') NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `transaction_date` date NOT NULL,
  `reference_number` varchar(100) DEFAULT NULL,
  `description` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`),
  KEY `idx_supplier_trans` (`supplier_id`,`transaction_date`),
  KEY `idx_trans_type` (`transaction_type`),
  KEY `idx_trans_date` (`transaction_date`),
  CONSTRAINT `supplier_transactions_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_transactions_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `supplier_transactions`
--

INSERT INTO `supplier_transactions` VALUES (1,1,'purchase',65000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(2,2,'purchase',100000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(3,3,'purchase',93000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(4,4,'purchase',93000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(5,5,'purchase',2448.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(6,6,'purchase',802083.72,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(7,7,'purchase',14575.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(8,8,'purchase',7296.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(9,9,'purchase',2490.71,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(10,10,'purchase',663456.80,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(11,11,'purchase',45000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(12,12,'purchase',25000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(13,13,'purchase',50000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(14,14,'purchase',53634.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(15,15,'purchase',20000.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(16,16,'purchase',47806.80,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(17,17,'purchase',137166.00,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(18,18,'purchase',95527.31,'2026-02-10',NULL,'─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(19,19,'purchase',19500.00,'2026-02-27','AKBANK','─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(20,20,'purchase',190000.00,'2026-03-06','HALK B','─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(21,21,'purchase',45000.00,'2026-03-20','Z─░RAAT B','─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(22,22,'purchase',45000.00,'2026-04-24','Z─░RAAT B','─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(23,23,'purchase',75000.00,'2026-04-24','─░┼Ş BANK','─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(24,24,'purchase',100000.00,'2026-05-29','─░┼Ş BANK','─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(25,25,'purchase',150000.00,'2026-06-25','─░┼Ş BANK','─░lk bor├ğ kayd─▒ (otomatik migration)',1,'2026-02-10 12:13:36','2026-02-10 12:13:36'),(26,19,'payment',19500.00,'2026-02-27',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(27,31,'payment',190000.00,'2026-03-06',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(28,32,'payment',45000.00,'2026-03-18',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(29,33,'payment',45000.00,'2026-03-20',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(30,32,'payment',45000.00,'2026-04-21',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(31,33,'payment',45000.00,'2026-04-24',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(32,23,'payment',75000.00,'2026-04-24',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(33,23,'payment',100000.00,'2026-05-29',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:40','2026-02-10 14:34:40'),(34,23,'payment',150000.00,'2026-06-25',NULL,'├ûdeme Y├Ântemi: ├çek',1,'2026-02-10 14:34:40','2026-02-10 14:34:40');

--
-- Table structure for table `suppliers`
--

CREATE TABLE `suppliers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `supplier_name` varchar(200) NOT NULL,
  `invoice_number` varchar(100) DEFAULT NULL,
  `amount` decimal(15,2) NOT NULL,
  `due_date` date DEFAULT NULL,
  `description` text DEFAULT NULL,
  `status` enum('pending','paid','overdue','payment_requested') DEFAULT 'pending',
  `payment_date` date DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `created_by` (`created_by`),
  KEY `idx_due_date` (`due_date`),
  KEY `idx_status` (`status`),
  KEY `idx_supplier_name` (`supplier_name`),
  CONSTRAINT `suppliers_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `suppliers`
--

INSERT INTO `suppliers` VALUES (1,'AT1 GEOTEKN─░K',NULL,65000.00,NULL,'├Âdeme talep etti','pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(2,'BTM Makina - Muhammet A├çIKG├ûZ',NULL,100000.00,NULL,'├ûDEME TALEP ETT─░','pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(3,'Ceri Makina - Fikret ├ûzt├╝rk',NULL,93000.00,NULL,'├Âdeme talep etti','pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(4,'Ceri Teknik Makina',NULL,93000.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(5,'├çetin D├£Z - Bestchem',NULL,2448.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(6,'├ç├Âz├╝m Laboratuvar',NULL,802083.72,NULL,'son gelen ekstre','pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(7,'├çTM Derece Sa─şl─▒k',NULL,14575.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(8,'Derece OSGB',NULL,7296.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(9,'EROL KAYA - Mali M├╝┼şavir',NULL,2490.71,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(10,'FURKAN SONDAJ',NULL,663456.80,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(11,'Hasan Usta (ASLAN)',NULL,45000.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(12,'H├╝seyin DANA─ŞI',NULL,25000.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(13,'─░skender Sevencan Sondaj',NULL,50000.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(14,'KAV Oto Hidrolik ya┼ş',NULL,53634.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(15,'Okan U├ç├ûZ',NULL,20000.00,NULL,'eski bor├ğ,├Âdenmesi gerekiyor','pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(16,'├ûNC├£ OTOMASYON',NULL,47806.80,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(17,'YER TEKN─░K ORKUN',NULL,137166.00,NULL,NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(18,'YE┼Ş─░LLER TEKN─░K',NULL,95527.31,NULL,'├Âdeme talep ediyor','pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(19,'CENSAN SONDAJ','AKBANK',19500.00,'2026-02-27',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(20,'YE┼Ş─░LLER PN├ûMAT─░K','HALK B',190000.00,'2026-03-06',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(21,'KAV OTO Hidrolik Ya┼ş','Z─░RAAT B',45000.00,'2026-03-20',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(22,'KAV OTO Hidrolik Ya┼ş','Z─░RAAT B',45000.00,'2026-04-24',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(23,'Furkan Sondaj Ekipmanlar─▒','─░┼Ş BANK',75000.00,'2026-04-24',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(24,'Furkan Sondaj Ekipmanlar─▒','─░┼Ş BANK',100000.00,'2026-05-29',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(25,'Furkan Sondaj Ekipmanlar─▒','─░┼Ş BANK',150000.00,'2026-06-25',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(26,'MUHAMMET BAH├çE (Al─▒nan ├çek)','Z─░RAAT B',-100000.00,'2026-02-16',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(28,'MURAT YILDIZ (Al─▒nan ├çek)','QNB',-280000.00,'2026-05-22',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(29,'MURAT YILDIZ (Al─▒nan ├çek)','QNB',-280000.00,'2026-06-19',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(30,'MURAT YILDIZ (Al─▒nan ├çek)','QNB',-290000.00,'2026-07-24',NULL,'pending',NULL,1,'2026-02-10 08:54:08','2026-02-10 08:54:08'),(31,'YE┼Ş─░LER PN├ûMAT─░K',NULL,0.00,NULL,'├çek i├ğe aktar─▒m─▒ s─▒ras─▒nda otomatik olu┼şturuldu','pending',NULL,1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(32,'ARTER M├£H - LABORATUVAR',NULL,0.00,NULL,'├çek i├ğe aktar─▒m─▒ s─▒ras─▒nda otomatik olu┼şturuldu','pending',NULL,1,'2026-02-10 14:34:39','2026-02-10 14:34:39'),(33,'KAV OTO Hidrolik Ya─ş',NULL,0.00,NULL,'├çek i├ğe aktar─▒m─▒ s─▒ras─▒nda otomatik olu┼şturuldu','pending',NULL,1,'2026-02-10 14:34:39','2026-02-10 14:34:39');

--
-- Table structure for table `system_settings`
--

CREATE TABLE `system_settings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text DEFAULT NULL,
  `setting_type` enum('string','number','boolean','json') DEFAULT 'string',
  `description` varchar(255) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `setting_key` (`setting_key`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;

--
-- Dumping data for table `system_settings`
--

INSERT INTO `system_settings` VALUES (1,'app_name','KESKA Mali Takip Sistemi','string','Uygulama ad─▒','2026-02-10 07:53:18'),(2,'currency','TL','string','Para birimi','2026-02-10 07:53:18'),(3,'date_format','d.m.Y','string','Tarih format─▒','2026-02-10 07:53:18'),(4,'notification_days','7,3,1','string','Bildirim g├╝nleri (virg├╝lle ay─▒r)','2026-02-10 07:53:18'),(5,'enable_notifications','1','boolean','Bildirimleri aktif et','2026-02-10 07:53:18');

--
-- Temporary table structure for view `v_all_payments`
--

/*!50001 DROP VIEW IF EXISTS `v_all_payments`*/;
/*!50001 CREATE VIEW `v_all_payments` AS SELECT
 1 AS `source`,
  1 AS `source_id`,
  1 AS `payment_date`,
  1 AS `payment_name`,
  1 AS `detail`,
  1 AS `amount`,
  1 AS `status`,
  1 AS `category` */;

--
-- Temporary table structure for view `v_dashboard_summary`
--

/*!50001 DROP VIEW IF EXISTS `v_dashboard_summary`*/;
/*!50001 CREATE VIEW `v_dashboard_summary` AS SELECT
 1 AS `today_count`,
  1 AS `today_amount`,
  1 AS `week_count`,
  1 AS `week_amount`,
  1 AS `month_count`,
  1 AS `month_amount`,
  1 AS `overdue_count`,
  1 AS `overdue_amount` */;

--
-- Final view structure for view `v_all_payments`
--

/*!50001 DROP VIEW IF EXISTS `v_all_payments`*/;

--
-- Final view structure for view `v_dashboard_summary`
--

/*!50001 DROP VIEW IF EXISTS `v_dashboard_summary`*/;


