CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  email VARCHAR(100),
  password VARCHAR(255),
  balance INT DEFAULT 0,
  api_key VARCHAR(64),
  role ENUM('user','admin') DEFAULT 'user'
);

CREATE TABLE transactions (
  id INT AUTO_INCREMENT PRIMARY KEY,
  reference_no VARCHAR(50),
  transaction_id VARCHAR(50),
  user_id INT,
  amount INT,
  fee INT,
  net_amount INT,
  status ENUM('PENDING','SUCCESS','FAILED') DEFAULT 'PENDING',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE notices (
  id INT AUTO_INCREMENT PRIMARY KEY,
  message TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);