package com.red.circle.order.inner.model.dto.inapp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.red.circle.order.inner.model.enums.inapp.InAppPurchaseCollectionReceiptStatus;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 内收收款单据.
 *
 * @author pengliang on 2022/10/26
 */
@Data
@Accessors(chain = true)
public class InAppPurchaseCollectionReceiptDTO implements Serializable {

  @Serial
  private static final long serialVersionUID = 1L;

  /**
   * 收单id.
   */
  private String id;

  /**
   * 来源系统
   */
  private String sysOrigin;

  /**
   * 接收用户.
   */
  private Long acceptUserId;

  /**
   * 金额.
   */
  private BigDecimal amount;

  /**
   * 金额 美元.
   */
  private BigDecimal amountUsd;

  /**
   * 美元 汇率.
   */
  private BigDecimal usdExchangeRate;

  /**
   * 货币.
   */
  private String currency;

  /**
   * 标题.
   */
  private String title;

  /**
   * 描述.
   */
  private String describe;

  /**
   * 内部描述.
   */
  private String internalDescribe;

  /**
   * CREATE：创建状态，等待支付
   * </p>
   * SUCCESS：付款成功
   * </p>
   * FAIL: 付款失败
   * </p>
   * CLOSE: 关闭订单
   * </p>
   * 订单状态.
   */
  private InAppPurchaseCollectionReceiptStatus status;

  /**
   * 购买产品.
   */
  private List<InAppPurchaseProductDTO> products;

  /**
   * 自定义支付渠道.
   */
  private List<InAppPurchaseCountryAssociatedChannelsDTO> customChannels;

  /**
   * 支付国家id.
   */
  private Long payCountryId;

  /**
   * 有效期.
   */
  @JsonFormat(shape = Shape.NUMBER)
  private Timestamp expiredTime;

  /**
   * lockTime>now() 锁定状态, 上锁.
   */
  private Timestamp lockTime;

  /**
   * 创建时间.
   */
  private Timestamp createTime;

  /**
   * 修改时间
   */
  private Timestamp updateTime;

  /**
   * 创建用户.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long createUser;

  /**
   * 修改用户.
   */
  @JsonSerialize(using = ToStringSerializer.class)
  private Long updateUser;


}
