const dbcontroller = require('../db');

const createEvents = async function (data) {
  try {
    data.events.forEach(async event => {
      await dbcontroller.addEvent(data.id, data.msn, event)
    });
    return { success: true }
  } catch (e) {
    throw new Error(e.message)
  }
}

module.exports = {
  createEvents,
}
