const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('database.sqlite');
const data = {
  id: Date.now(),
  timestamp: new Date().toLocaleString('en-GB'),
  username: "admin",
  action: "تجربة النظام",
  module: "تجربة",
  record_id: "1",
  details: "هذه حركة تجريبية للتأكد من عمل السجل"
};
db.run("CREATE TABLE IF NOT EXISTS activity_logs (id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT NOT NULL)", () => {
  db.run("INSERT INTO activity_logs (data) VALUES (?)", [JSON.stringify(data)], (err) => {
    if (err) console.error(err);
    else console.log("Test record inserted!");
  });
});
