USE `skillst1_rngkqnhl_printportal`;

-- V11: Admin Staff Wallet Management
CREATE TABLE IF NOT EXISTS `staff_wallet_admin_log` (
  `id` INT AUTO_INCREMENT PRIMARY KEY,
  `staff_id` INT NOT NULL,
  `admin_id` INT NOT NULL,
  `type` ENUM('CREDIT','DEBIT') NOT NULL,
  `amount` DECIMAL(12,2) NOT NULL,
  `balance_before` DECIMAL(12,2) NOT NULL DEFAULT 0,
  `balance_after` DECIMAL(12,2) NOT NULL DEFAULT 0,
  `remarks` VARCHAR(255) NULL,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  INDEX (`staff_id`),
  INDEX (`admin_id`),
  INDEX (`created_at`)
);
