CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    nama VARCHAR(100),
    email VARCHAR(100) UNIQUE,
    no_hp VARCHAR(20),
    password VARCHAR(255),
    role ENUM('penjual','pembeli','admin')
);

CREATE TABLE produk (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT,
    nama_produk VARCHAR(255),
    harga INT,
    deskripsi TEXT
);

CREATE TABLE transaksi (
    id INT AUTO_INCREMENT PRIMARY KEY,
    produk_id INT,
    pembeli_id INT,
    status ENUM('menunggu_pembayaran','dibayar','dikirim','selesai','dispute'),
    bukti_transfer VARCHAR(255)
);

CREATE TABLE dispute (
    id INT AUTO_INCREMENT PRIMARY KEY,
    transaksi_id INT,
    pesan TEXT,
    status ENUM('open','selesai')
);