-- MySQL dump 10.13  Distrib 8.0.45, for Linux (x86_64)
--
-- Host: localhost    Database: catalogonline
-- ------------------------------------------------------
-- Server version	8.0.45-0ubuntu0.22.04.1

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

DROP TABLE IF EXISTS `product_stock_logs`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `product_stock_logs` (
  `stock_log_id` int NOT NULL AUTO_INCREMENT,
  `product_id` int DEFAULT NULL,
  `action_type` varchar(255) DEFAULT NULL,
  `qty_before` int DEFAULT NULL,
  `qty_change` int DEFAULT NULL,
  `qty_after` int DEFAULT NULL,
  `unit_price` decimal(10,2) DEFAULT NULL,
  `remark` text,
  `created_by` int DEFAULT NULL,
  `ref_type` varchar(50) DEFAULT NULL,
  `ref_id` int DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`stock_log_id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `product_stock_logs`
--

LOCK TABLES `product_stock_logs` WRITE;
/*!40000 ALTER TABLE `product_stock_logs` DISABLE KEYS */;
INSERT INTO `product_stock_logs` VALUES (1,10,'adjust',NULL,20,20,139.00,'Edit product',1,NULL,NULL,'2026-01-27 15:56:01','2026-01-27 15:56:01'),(2,10,'adjust',20,10,30,139.00,'Edit product',1,NULL,NULL,'2026-01-29 10:23:41','2026-01-29 10:23:41'),(3,8,'adjust',NULL,10,10,89.00,'Edit product',1,NULL,NULL,'2026-01-29 10:35:52','2026-01-29 10:35:52'),(4,10,'adjust',30,-27,3,200.00,'Edit product',1,NULL,NULL,'2026-01-29 13:44:51','2026-01-29 13:44:51'),(5,30,'init',0,10,10,100.00,'Initial stock',1,NULL,NULL,'2026-01-29 14:25:19','2026-01-29 14:25:19'),(11,3,'adjust',10,10,10,0.00,'Add stock',1,NULL,NULL,'2026-01-30 14:50:34','2026-01-30 14:50:34'),(12,31,'init',0,10,10,100.00,'Initial stock',1,NULL,NULL,'2026-01-30 14:52:10','2026-01-30 14:52:10'),(13,31,'adjust',10,12,22,89.00,'Add stock',1,NULL,NULL,'2026-01-30 14:54:08','2026-01-30 14:54:08'),(14,3,'restock',10,20,30,120.00,'testremark',1,NULL,NULL,'2026-02-02 11:45:43','2026-02-02 11:45:43'),(15,23,'restock',0,20,20,199.00,NULL,1,NULL,NULL,'2026-02-02 13:43:32','2026-02-02 13:43:32'),(16,11,'restock',0,30,30,66.00,NULL,1,NULL,NULL,'2026-02-04 13:55:31','2026-02-04 13:55:31'),(17,8,'restock',10,5,15,89.00,NULL,75,NULL,NULL,'2026-02-05 11:57:56','2026-02-05 11:57:56'),(18,8,'restock',15,5,20,89.00,NULL,75,NULL,NULL,'2026-02-05 11:58:22','2026-02-05 11:58:22'),(19,32,'INIT',0,50,50,3999.00,'Initial stock',1,'product',32,'2026-03-23 16:18:58','2026-03-23 16:18:58'),(20,33,'IN',0,20,20,3243.00,'Restock',1,'stock',2,'2026-03-26 11:19:48','2026-03-26 11:19:48'),(21,33,'IN',20,30,50,3243.00,'Restock',1,'stock',3,'2026-03-26 11:21:36','2026-03-26 11:21:36'),(22,33,'OUT',50,-30,20,0.00,'Delete restock',1,'stock',3,'2026-03-26 11:32:33','2026-03-26 11:32:33'),(23,33,'IN',20,30,50,3243.00,'Restock',1,'stock',4,'2026-03-26 11:33:22','2026-03-26 11:33:22'),(24,34,'IN',0,50,50,5390.00,'Restock',1,'stock',5,'2026-04-01 10:49:02','2026-04-01 10:49:02'),(25,34,'IN',50,50,100,5380.00,'Restock',1,'stock',6,'2026-04-02 11:16:21','2026-04-02 11:16:21'),(26,34,'OUT',100,-50,50,0.00,'Delete restock',1,'stock',6,'2026-04-02 11:18:58','2026-04-02 11:18:58'),(27,7,'IN',NULL,20,20,199.00,'Restock',1,'stock',7,'2026-04-02 11:19:41','2026-04-02 11:19:41'),(28,7,'IN',20,30,50,199.00,'Restock',1,'stock',8,'2026-04-02 11:23:14','2026-04-02 11:23:14'),(29,7,'OUT',50,-30,20,0.00,'Delete restock',1,'stock',8,'2026-04-02 11:23:18','2026-04-02 11:23:18'),(30,7,'OUT',20,-20,0,0.00,'Rollback old restock',1,'stock',7,'2026-04-02 11:30:46','2026-04-02 11:30:46'),(31,7,'IN',0,20,20,199.00,'Restock',1,'stock',7,'2026-04-02 11:30:46','2026-04-02 11:30:46'),(32,7,'OUT',20,-20,0,0.00,'Rollback old restock',1,'stock',7,'2026-04-02 11:30:56','2026-04-02 11:30:56'),(33,7,'IN',0,20,20,199.00,'Restock',1,'stock',7,'2026-04-02 11:30:56','2026-04-02 11:30:56'),(34,7,'OUT',20,-20,0,0.00,'Rollback old restock',1,'stock',7,'2026-04-02 11:35:58','2026-04-02 11:35:58'),(35,7,'IN',0,20,20,200.00,'Restock',1,'stock',7,'2026-04-02 11:35:58','2026-04-02 11:35:58');
/*!40000 ALTER TABLE `product_stock_logs` 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-04-17 10:00:08
