/*
 * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
 */
package kr.co.zumo.app.lifeplus.view.presenter.signup;

import android.util.Log;

import kr.co.zumo.app.R;
import kr.co.zumo.app.lifeplus.view.Event;
import kr.co.zumo.app.lifeplus.view.presenter.SignUpPresenter;
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
import kr.co.zumo.app.lifeplus.bean.SignUpButtonBean;
import kr.co.zumo.app.lifeplus.bean.SignUpCoinBean;
import kr.co.zumo.app.lifeplus.bean.TextBean;

/**
 * SignUpStepComplete
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 9. 14.]   [최초 작성]
 * @since 2018. 9. 14.
 */
public class SignUpStepComplete extends SignUpStep {
  public SignUpStepComplete(SignUpPresenter model) {
    super(model);
  }

  @Override
  void __start() {
    presenter.addItem(new SignUpItem(SignUpItem.SIGN_UP_DIVIDER, new TextBean(ResourceUtil.getString(R.string.sign_up_completed)).toJson()));
    presenter.addItem(new SignUpItem(SignUpItem.SIGN_UP_TEXT, SignUpItem.ALIGN_START, new TextBean(ResourceUtil.getString(R.string.sign_up_completed_message, "한화")).toJson()));
    presenter.addItem(new SignUpItem(SignUpItem.SIGN_UP_COIN, SignUpItem.ALIGN_START, new SignUpCoinBean(ResourceUtil.getString(R.string.coupon_message, "한화"), R.drawable.coupon_image).toJson()))



    ;
    presenter.addItem(new SignUpItem(SignUpItem.SIGN_UP_BUTTON, SignUpItem.ALIGN_CENTER, new SignUpButtonBean(ResourceUtil.getString(R.string.sign_up_start_lifeplus), SignUpItem.BUTTON_ID_JOINED).toJson(), (holder, eventId, type, param) -> {
      Log.i("APP# SignUpStepComplete | onSignUpHolderEvent", "| eventId: " + eventId + ", type: " + type);

      if (SignUpItem.BUTTON_ID_JOINED == type) {
        presenter.onEvent(new Event.Builder(Event.JOINED).build());
      }

    }));
  }

  @Override
  void __validate() {
    isValidated = true;
  }

  @Override
  void __dispose() {
  }
}
