CREATE TABLE IF NOT EXISTS oos_transfer_tasks (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    source_date VARCHAR(50) NULL,
    area VARCHAR(50) NULL,
    kode_item VARCHAR(100) NOT NULL,
    nama_item TEXT NULL,
    qty_penjualan_3bln_nasional INT DEFAULT 0,
    cabang_tujuan_oos VARCHAR(50) NOT NULL,
    donor VARCHAR(50) NULL,
    stok_donor INT DEFAULT 0,
    qty_transfer INT DEFAULT 0,
    supplier VARCHAR(255) NULL,
    status ENUM('Open','In Progress','Done','Rejected','Eskalasi Purchasing') DEFAULT 'Open',
    keterangan TEXT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

    INDEX idx_kode_item (kode_item),
    INDEX idx_cabang_tujuan (cabang_tujuan_oos),
    INDEX idx_donor (donor),
    INDEX idx_status (status)
);
