package com.red.circle.order.infra.database.rds.entity.order;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.sql.Timestamp;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * ios购买记录
 * </p>
 *
 * @author pengliang
 * @since 2020-04-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("order_apple_latest_receipt")
public class OrderAppleLatestReceipt implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 主键标识
   */
  @TableId(value = "id", type = IdType.ASSIGN_ID)
  private Long id;

  /**
   * 来源系统
   */
  @TableField("sys_origin")
  private String sysOrigin;

  /**
   * 用户id
   */
  @TableField("user_id")
  private Long userId;

  /**
   * 取消事务的时间
   */
  @TableField("cancellation_date_ms")
  private Long cancellationDateMs;

  /**
   * 退款交易的原因
   */
  @TableField("cancellation_reason")
  private Integer cancellationReason;

  /**
   * 过期时间
   */
  @TableField("expires_date_ms")
  private Timestamp expiresDateMs;

  /**
   * 指示自动续费订阅是否处于介绍价格期的指标
   */
  @TableField("is_in_intro_offer_period")
  private Boolean inIntroOfferPeriod;

  /**
   * 指示订阅是否处于免费试用期的指标
   */
  @TableField("is_trial_period")
  private Boolean trialPeriod;

  /**
   * 由于升级而取消订阅的指示器
   */
  @TableField("is_upgraded")
  private Boolean upgraded;

  /**
   * 原始应用程序购买的时间
   */
  @TableField("original_purchase_date_ms")
  private Long originalPurchaseDateMs;

  /**
   * 原订单id
   */
  @TableField("original_transaction_id")
  private String originalTransactionId;

  /**
   * 产品id
   */
  @TableField("product_id")
  private String productId;

  /**
   * 购买时间
   */
  @TableField("purchase_date_ms")
  private Timestamp purchaseDateMs;

  /**
   * 用户赎回的订阅发行的标识符
   */
  @TableField("promotional_offer_id")
  private String promotionalOfferId;

  /**
   * 购买的易耗品数量
   */
  @TableField("quantity")
  private String quantity;

  /**
   * 订阅所属订阅组的标识符
   */
  @TableField("subscription_group_identifier")
  private String subscriptionGroupIdentifier;

  /**
   * 交易id
   */
  @TableField("transaction_id")
  private String transactionId;

  /**
   * 网格列id
   */
  @TableField("web_order_line_item_id")
  private String webOrderLineItemId;

  /**
   * 创建时间
   */
  @TableField("create_time")
  private Timestamp createTime;

  /**
   * 修改时间
   */
  @TableField("update_time")
  private Timestamp updateTime;

  /**
   * 收据状态
   */
  @TableField("status")
  private Integer status;

  /**
   * base64收据
   */
  @TableField(value = "latest_receipt", select = false)
  private String latestReceipt;

}
