--
-- Host: localhost    Database: qc_ci4
-- ------------------------------------------------------


--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `display_name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `is_system` tinyint(1) DEFAULT 0,
  `status` enum('active','inactive') DEFAULT 'active',
  `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 `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'administrator','Administrator','Full access ke semua fitur',1,'active','2026-01-26 10:29:45','2026-01-26 10:29:45'),(2,'supervisor','Supervisor','Approve/reject inspections & view reports',1,'active','2026-01-26 10:29:45','2026-01-26 10:29:45'),(3,'qc_staff','QC Staff','Create inspections',1,'active','2026-01-26 10:29:45','2026-01-26 10:29:45'),(4,'manager','Manager','View reports & analytics',1,'active','2026-01-26 10:29:45','2026-01-26 10:29:45'),(5,'rnd','RND','R&D dan development',0,'active','2026-01-27 01:52:49','2026-01-27 01:52:49'),(10,'marketing','Marketing','',0,'active','2026-01-27 02:37:50','2026-01-27 02:37:50');

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (1,'view_inspection','Melihat data inspeksi','2025-12-26 06:10:16'),(2,'create_inspection','Membuat inspeksi baru','2025-12-26 06:10:16'),(3,'edit_inspection','Edit inspeksi','2025-12-26 06:10:16'),(4,'delete_inspection','Hapus inspeksi','2025-12-26 06:10:16'),(5,'approve_inspection','Approve/Reject inspeksi','2025-12-26 06:10:16'),(6,'manage_forms','Mengelola form template','2025-12-26 06:10:16'),(7,'manage_users','Mengelola user dan hak akses','2025-12-26 06:10:16'),(8,'view_reports','Melihat laporan','2025-12-26 06:10:16'),(9,'export_data','Export data','2025-12-26 06:10:16'),(37,'verify_qr_code','Verifikasi keaslian QR Code','2025-12-29 04:22:26'),(38,'create_quotation','Membuat quotation','2025-12-31 02:06:17'),(39,'view_quotation','Melihat quotation','2025-12-31 02:06:17'),(40,'export_quotation','Export quotation ke Excel','2025-12-31 02:06:17'),(41,'edit_quotation','Edit Quotation yang sudah dibuat','2025-12-31 03:04:12'),(42,'delete_quotation','Hapus Quotation','2025-12-31 03:04:12'),(43,'export_reports','Export Laporan ke berbagai format','2025-12-31 03:04:12'),(44,'create_form','Buat Form Template baru','2025-12-31 03:04:12'),(45,'edit_form','Edit Form Template','2025-12-31 03:04:12'),(46,'delete_form','Hapus Form Template','2025-12-31 03:04:12'),(47,'manage_roles','Kelola Role dan Permission sistem','2025-12-31 03:04:12'),(48,'manage_credentials','Reset password dan manajemen akun administrator','2025-12-31 03:04:12'),(49,'setup_logo','Setup/Upload logo perusahaan','2025-12-31 03:04:12'),(50,'manage_products','Kelola Master Data Produk','2025-12-31 03:04:12'),(51,'manage_suppliers','Kelola Master Data Supplier','2025-12-31 03:04:12'),(52,'manage_buyers','Kelola Master Data Buyer','2025-12-31 03:04:12'),(53,'view_report','Melihat dan mengakses laporan inspeksi','2026-01-02 07:09:11'),(54,'view_inspection_list','Melihat daftar inspeksi','2026-01-02 07:12:10'),(55,'update_quotation_status','Mengubah status quotation','2026-01-02 07:47:05'),(56,'view_dev_project','Melihat daftar dan detail development project','2026-01-12 04:39:22'),(57,'create_dev_project','Membuat development project baru','2026-01-12 04:39:22'),(58,'edit_dev_project','Mengedit development project','2026-01-12 04:39:22'),(59,'delete_dev_project','Menghapus development project','2026-01-12 04:39:22'),(60,'view_dev_requirement','Melihat daftar dan detail requirement','2026-01-12 04:39:22'),(61,'create_dev_requirement','Membuat development requirement baru','2026-01-12 04:39:22'),(62,'edit_dev_requirement','Mengedit development requirement','2026-01-12 04:39:22'),(63,'submit_dev_product','Submit produk development baru','2026-01-12 04:39:22'),(64,'review_dev_product','Review dan approve produk development','2026-01-12 04:39:22'),(65,'add_dev_feedback','Menambah feedback buyer untuk produk','2026-01-12 04:39:22'),(66,'add_dev_comment','Menambah internal comment untuk diskusi','2026-01-12 04:39:22'),(67,'convert_dev_product','Konversi development product ke main product','2026-01-12 04:39:22'),(68,'manage_dev_conversion','Mengelola konversi produk development','2026-01-12 04:39:22'),(69,'view_assessment','Melihat daftar dan detail penilaian buyer','2026-01-12 08:24:18'),(70,'create_assessment','Membuat penilaian buyer baru','2026-01-12 08:24:18'),(71,'edit_assessment','Mengedit penilaian buyer','2026-01-12 08:24:18'),(72,'view_product_catalog','Akses untuk melihat dan mencari produk dalam katalog','2026-01-27 03:54:45');

--
-- Table structure for table `role_permissions`
--

CREATE TABLE `role_permissions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `role` varchar(50) NOT NULL,
  `permission_id` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_role_permission` (`role`,`permission_id`),
  KEY `permission_id` (`permission_id`),
  KEY `idx_role` (`role`),
  CONSTRAINT `role_permissions_ibfk_1` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=421 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_permissions`
--

INSERT INTO `role_permissions` VALUES (69,'supervisor',1,'2025-12-29 04:22:26'),(70,'supervisor',5,'2025-12-29 04:22:26'),(71,'supervisor',8,'2025-12-29 04:22:26'),(72,'supervisor',37,'2025-12-29 04:22:26'),(73,'manager',1,'2025-12-29 04:22:26'),(74,'manager',8,'2025-12-29 04:22:26'),(75,'manager',9,'2025-12-29 04:22:26'),(90,'manager',38,'2025-12-31 02:07:51'),(91,'manager',39,'2025-12-31 02:07:51'),(92,'manager',40,'2025-12-31 02:07:51'),(215,'supervisor',53,'2026-01-02 07:09:11'),(216,'manager',53,'2026-01-02 07:09:11'),(218,'supervisor',54,'2026-01-02 07:12:10'),(219,'manager',54,'2026-01-02 07:12:10'),(266,'supervisor',55,'2026-01-02 07:47:05'),(281,'supervisor',56,'2026-01-12 04:39:22'),(282,'manager',56,'2026-01-12 04:39:22'),(285,'supervisor',57,'2026-01-12 04:39:22'),(288,'supervisor',58,'2026-01-12 04:39:22'),(290,'supervisor',59,'2026-01-12 04:39:22'),(293,'supervisor',60,'2026-01-12 04:39:22'),(294,'manager',60,'2026-01-12 04:39:22'),(297,'supervisor',61,'2026-01-12 04:39:22'),(300,'supervisor',62,'2026-01-12 04:39:22'),(303,'supervisor',63,'2026-01-12 04:39:22'),(305,'supervisor',64,'2026-01-12 04:39:22'),(308,'supervisor',65,'2026-01-12 04:39:22'),(309,'manager',65,'2026-01-12 04:39:22'),(312,'supervisor',66,'2026-01-12 04:39:22'),(313,'manager',66,'2026-01-12 04:39:22'),(315,'supervisor',67,'2026-01-12 04:39:22'),(317,'supervisor',68,'2026-01-12 04:39:22'),(320,'supervisor',69,'2026-01-12 08:24:18'),(321,'manager',69,'2026-01-12 08:24:18'),(324,'supervisor',70,'2026-01-12 08:24:18'),(325,'manager',70,'2026-01-12 08:24:18'),(327,'supervisor',71,'2026-01-12 08:24:18'),(341,'rnd',66,'2026-01-27 03:06:32'),(342,'rnd',65,'2026-01-27 03:06:32'),(343,'rnd',67,'2026-01-27 03:06:32'),(344,'rnd',57,'2026-01-27 03:06:32'),(345,'rnd',61,'2026-01-27 03:06:32'),(346,'rnd',59,'2026-01-27 03:06:32'),(347,'rnd',58,'2026-01-27 03:06:32'),(348,'rnd',62,'2026-01-27 03:06:32'),(349,'rnd',68,'2026-01-27 03:06:32'),(350,'rnd',64,'2026-01-27 03:06:32'),(351,'rnd',63,'2026-01-27 03:06:32'),(352,'rnd',56,'2026-01-27 03:06:32'),(353,'rnd',60,'2026-01-27 03:06:32'),(354,'rnd',50,'2026-01-27 03:06:32'),(356,'manager',72,'2026-01-27 03:54:45'),(357,'supervisor',72,'2026-01-27 03:54:45'),(359,'marketing',38,'2026-01-27 04:02:25'),(360,'marketing',42,'2026-01-27 04:02:25'),(361,'marketing',41,'2026-01-27 04:02:25'),(362,'marketing',40,'2026-01-27 04:02:25'),(363,'marketing',55,'2026-01-27 04:02:25'),(364,'marketing',39,'2026-01-27 04:02:25'),(365,'marketing',69,'2026-01-27 04:02:25'),(366,'marketing',72,'2026-01-27 04:02:25'),(371,'administrator',5,'2026-01-28 06:25:41'),(372,'administrator',2,'2026-01-28 06:25:41'),(373,'administrator',4,'2026-01-28 06:25:41'),(374,'administrator',3,'2026-01-28 06:25:41'),(375,'administrator',1,'2026-01-28 06:25:41'),(376,'administrator',54,'2026-01-28 06:25:41'),(377,'administrator',38,'2026-01-28 06:25:41'),(378,'administrator',42,'2026-01-28 06:25:41'),(379,'administrator',41,'2026-01-28 06:25:41'),(380,'administrator',40,'2026-01-28 06:25:41'),(381,'administrator',55,'2026-01-28 06:25:41'),(382,'administrator',39,'2026-01-28 06:25:41'),(383,'administrator',66,'2026-01-28 06:25:41'),(384,'administrator',65,'2026-01-28 06:25:41'),(385,'administrator',67,'2026-01-28 06:25:41'),(386,'administrator',57,'2026-01-28 06:25:41'),(387,'administrator',61,'2026-01-28 06:25:41'),(388,'administrator',59,'2026-01-28 06:25:41'),(389,'administrator',58,'2026-01-28 06:25:41'),(390,'administrator',62,'2026-01-28 06:25:41'),(391,'administrator',68,'2026-01-28 06:25:41'),(392,'administrator',64,'2026-01-28 06:25:41'),(393,'administrator',63,'2026-01-28 06:25:41'),(394,'administrator',56,'2026-01-28 06:25:41'),(395,'administrator',60,'2026-01-28 06:25:41'),(396,'administrator',70,'2026-01-28 06:25:41'),(397,'administrator',71,'2026-01-28 06:25:41'),(398,'administrator',69,'2026-01-28 06:25:41'),(399,'administrator',44,'2026-01-28 06:25:41'),(400,'administrator',46,'2026-01-28 06:25:41'),(401,'administrator',45,'2026-01-28 06:25:41'),(402,'administrator',6,'2026-01-28 06:25:41'),(403,'administrator',9,'2026-01-28 06:25:41'),(404,'administrator',43,'2026-01-28 06:25:41'),(405,'administrator',53,'2026-01-28 06:25:41'),(406,'administrator',8,'2026-01-28 06:25:41'),(407,'administrator',52,'2026-01-28 06:25:41'),(408,'administrator',50,'2026-01-28 06:25:41'),(409,'administrator',51,'2026-01-28 06:25:41'),(410,'administrator',72,'2026-01-28 06:25:41'),(411,'administrator',48,'2026-01-28 06:25:41'),(412,'administrator',47,'2026-01-28 06:25:41'),(413,'administrator',7,'2026-01-28 06:25:41'),(414,'administrator',49,'2026-01-28 06:25:41'),(415,'administrator',37,'2026-01-28 06:25:41'),(416,'qc_staff',2,'2026-02-04 03:40:51'),(417,'qc_staff',3,'2026-02-04 03:40:51'),(418,'qc_staff',1,'2026-02-04 03:40:51'),(419,'qc_staff',54,'2026-02-04 03:40:51'),(420,'qc_staff',37,'2026-02-04 03:40:51');

--
-- Table structure for table `company_info`
--

CREATE TABLE `company_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `company_name` varchar(255) NOT NULL,
  `address` text DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `fax` varchar(20) DEFAULT NULL,
  `mobile` varchar(20) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `pic_name` varchar(255) DEFAULT NULL,
  `pic_title` varchar(100) DEFAULT NULL,
  `logo_path` varchar(500) DEFAULT NULL,
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `company_info`
--

INSERT INTO `company_info` VALUES (1,'Suryo Anggoro P','Slamet Riyadi Street 280 Gumpang Kartsasura Central Java-INDONESIA','62-271-726111','62-271-726444','+62 838-671-805-39','suryo@suwastama.co.id',NULL,'Suryo Anggoro P','SUWASTAMA Marketing Department',NULL,'2025-12-30 06:13:58');


