package query.hessian.accounts;

import gametool.entity.operator.ItemActionStatus;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

/**
 * Information about item action, used in api only.
 * Fields are public because it's value object.
 *
 * @see gametool.entity.operator.ItemAction
 * @author andrey.kuprishov
 */
@SuppressWarnings({"PublicField", "ClassWithTooManyFields"})
public class ItemActionInfo implements Serializable {
  private static final long serialVersionUID = 73252152016137317L;
  /**
   * Unique id of item action in gametool.
   */
  public long id = -1L;
  /**
   * Timestamp when action was created.
   */
  public long createdAt = -1L;
  /**
   * Timestamp, gametool periodically performs all pending actions with performAt less than current moment.
   */
  public long performAt = -1L;
  /**
   * Shard name where action should be performed.
   */
  @NotNull
  public String shard = StringUtils.EMPTY;
  /**
   * Id of avatar on shard (unique inside shard only).
   */
  public long avatarId = -1L;
  /**
   * Id of item resource.
   */
  public int itemResourceId = -1;
  /**
   * Id of rune resource, 0 if no rune in item.
   */
  public int runeResourceId = -1;
  /**
   * Stack count for stackable items. For sinle unstackable item it should be set to 1.
   */
  public int stackCount = -1;
  /**
   * Counter for items that contain counters. If counter not supported its value should be -1.
   */
  public int counter = -1;
  /**
   * Status of item action.
   */
  @NotNull
  public ItemActionStatus status = ItemActionStatus.Pending;
  /**
   * Debug information for API users. Contains last error of action performing.
   */
  @NotNull
  public String debugInfo = StringUtils.EMPTY;
}
