export class Subscription {
  constructor({ magentoUserId, phone, email, topics = [], notifyWhatsapp, notifySms, notifyEmail }) {
    this.magentoUserId = magentoUserId;
    this.phone = phone;
    this.email = email;
    this.topics = Array.isArray(topics) ? topics : [topics];
    this.notifyWhatsapp = notifyWhatsapp;
    this.notifySms = notifySms;
    this.notifyEmail = notifyEmail;
  }

  addTopic(newTopic) {
    if (!this.topics.includes(newTopic)) {
      this.topics.push(newTopic);
    }
  }
}
