package com.red.circle.other.infra.common.activity.send;

import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
import com.red.circle.common.business.enums.SendPropsOrigin;
import com.red.circle.other.infra.database.rds.entity.activity.PropsActivityRewardConfig;

/**
 * 发送活动道具,奖品.
 *
 * @author pengliang on 2021/7/2
 */
public class SendRewardSingle extends SendRewardAbstract {

  private static final long serialVersionUID = 1L;

  /**
   * 奖品.
   */
  private PropsActivityRewardConfig rewardConfig;

  public SendRewardSingle(PropsActivityRewardConfig rewardConfig) {
    this.rewardConfig = rewardConfig;
  }

  public PropsActivityRewardConfig getRewardConfig() {
    return rewardConfig;
  }

  public void setRewardConfig(PropsActivityRewardConfig rewardConfig) {
    this.rewardConfig = rewardConfig;
  }


  public static Builder builder() {
    return new Builder();
  }

  public static class Builder extends SendRewardAbstract {

    private PropsActivityRewardConfig rewardConfig;

    public Builder rewardConfig(PropsActivityRewardConfig rewardConfig) {
      this.rewardConfig = rewardConfig;
      return this;
    }

    public Builder trackId(Long trackId) {
      this.setTrackId(trackId);
      return this;
    }

    public Builder acceptUserId(Long acceptUserId) {
      this.setAcceptUserId(acceptUserId);
      return this;
    }

    public Builder origin(SendPropsOrigin origin) {
      this.setOrigin(origin);
      return this;
    }

    public Builder sysOrigin(SysOriginPlatformEnum sysOrigin) {
      this.setSysOrigin(sysOrigin);
      return this;
    }

    public SendRewardSingle build() {
      SendRewardSingle sendRewardSingle = new SendRewardSingle(this.rewardConfig);
      sendRewardSingle.setTrackId(this.getTrackId());
      sendRewardSingle.setAcceptUserId(this.getAcceptUserId());
      sendRewardSingle.setOrigin(this.getOrigin());
      sendRewardSingle.setSysOrigin(this.getSysOrigin());
      return sendRewardSingle;
    }

  }
}
