const QRCode = require("qrcode");

async function generateDataUrl(payload) {
  // payload is a JS object; you may store fewer/more fields
  const str = JSON.stringify(payload);
  return QRCode.toDataURL(str);
}

module.exports = { generateDataUrl };
