import { observable, makeObservable } from 'mobx';
import { IRateplan, IRateplanCategory, IRefillCategory, IServicepackCategory } from 'typings';

export default class Rateplan {
  constructor(state: IRateplan) {
    this.id = state.id;
    this.title = state.title;
    this.shortTitle = state.shortTitle;
    this.typeId = state.typeId;
    this.price = state.price;
    this.description = state.description;
    this.isPrepaid = state.isPrepaid;
    this.receiptText = state.receiptText;
    this.isVip = state.isVip;
    this.includedDataAmountInMb = state.includedDataAmountInMb;
    this.availableRefills = state.availableRefills;
    this.availableServicepacks = state.availableServicepacks;
    this.availableRateplans = state.availableRateplans;
    this.mobileCount = state.mobileCount;
    this.internetCount = state.internetCount;
    this.numberForwardCount = state.numberForwardCount;
    this.backupCount = state.backupCount;

    makeObservable(this, {
      id: observable,
      title: observable,
      shortTitle: observable,
      typeId: observable,
      price: observable,
      description: observable,
      isPrepaid: observable,
      receiptText: observable,
      isVip: observable,
      includedDataAmountInMb: observable,
      availableRefills: observable,
      availableServicepacks: observable,
      availableRateplans: observable,
      mobileCount: observable,
      internetCount: observable,
      numberForwardCount: observable,
      backupCount: observable,
    });
  }

  id: string;

  title: string;

  shortTitle: string;

  typeId: string;

  price: number;

  description: string;

  isPrepaid: boolean;

  receiptText: string;

  isVip: boolean;

  includedDataAmountInMb: number;

  availableRefills: Array<IRefillCategory>;

  availableServicepacks: Array<IServicepackCategory>;

  availableRateplans: Array<IRateplanCategory>;

  mobileCount: number;

  internetCount: number;

  numberForwardCount: number;

  backupCount: number;
}
