/**
   * Adicionar comunicação realizada. Verifica se há saldo suficiente antes de fazer a comunicação.
   * For this cellphone be able to make a communication it needs to: Be in a compatible mode with
   * the the type of communication Have enough Balance
   *
   * @param sms the made communication
   * @throws NotEnoughBalanceException the not enough balance exception
   * @throws IncompatibleModeException the incompatible mode for communication exception
   */
  @Override
  public void addMadeSMS(SMS sms) throws NotEnoughBalanceException, IncompatibleModeException {
    final boolean ableToCommunicate = getMode().ableToSendSms();
    if (!ableToCommunicate) {
      throw new IncompatibleModeException("Incompatible Mode", this.getOperator().getSeqNumber());
    }

    if (this.getBalance() - sms.getCost() < 0) {
      throw new NotEnoughBalanceException(
          "Erro: Saldo Insuficiente", this.getOperator().getSeqNumber());
    }

    // Ok, update balance and registry sms
    this.setBalance(this.getBalance() - sms.getCost());
    super.addMadeSMS(sms);
    super.setLastComunication(sms);
  }