const { Address } = require("../../models");

const addAddress = async (data) => {
  let address = Address.create(data);
  return address;
};

const updateAddress = async (id, data) => {
  Address.update(data, {
    where: {
      id: id,
    },
  });
};

const deleteAddress = async (id) => {
  Address.destroy({
    where: {
      id: id,
    },
  });
};

module.exports = {
  addAddress,
  updateAddress,
  deleteAddress,
};
