package com.tmerclub.cloud.multishop.mongo;

import com.tmerclub.cloud.api.payment.constant.PaySysType;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;

/**
 * 对应MongoDB存储商家余额日志emp
 * @author 菠萝凤梨
 */
@Document("shop_wallet_log")
@CompoundIndexes({
        @CompoundIndex(name = "shopId_reason_idx", def = "{'shopId':1, 'reason':1}")
})
public class MongoShopWalletLogBO {

    @Id
    @Schema(description = "店铺钱包id")
    private Long walletLogId;

    @Schema(description = "店铺id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long shopId;
    /**
     * 支付系统类型
     * @see PaySysType
     */
    @Schema(description = "支付系统类型", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer paySysType;

    @Schema(description = "关联订单id")
    private Long orderId;

    @Schema(description = "关联退款单id")
    private Long refundId;

    @Schema(description = "商家收支类型 0支出 1收入")
    private Integer shopIoType;

    @Schema(description = "平台收支类型 0支出 1收入")
    private Integer platformIoType;

    @Schema(description = "金额类型 0 未结算金额 1可提现金额 2冻结金额", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer amountType;

    @Schema(description = "商家改变金额")
    private Long shopChangeAmount;

    @Schema(description = "平台改变金额")
    private Long platformChangeAmount;

    @Schema(description = "原因 ShopWalletChangeReason", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer reason;

    @Schema(description = "用户金额（支付实付金额，退款实际申请金额）", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long userAmount;

    @Schema(description = "平台补贴金额", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long platformAmount;

    @Schema(description = "分销占用金额", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long distributionAmount;

    @Schema(description = "商家的平台佣金", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long shopPlatformCommission;

    @Schema(description = "平台佣金", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long platformCommission;

    @Schema(description = "商家优惠金额", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long shopReduceAmount;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "店铺名称")
    private String shopName;

    @Schema(description = "通联充值单号")
    private Long bizOrderNo;

    @Schema(description = "通联充值状态 0.待支付 1.申请成功(还没确认)  2.充值成功 3.充值失败")
    private Integer allinpayStatus;

    @Schema(description = "通联支付失败原因")
    private String payFailMessage;

    public Long getWalletLogId() {
        return walletLogId;
    }

    public void setWalletLogId(Long walletLogId) {
        this.walletLogId = walletLogId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Integer getPaySysType() {
        return paySysType;
    }

    public void setPaySysType(Integer paySysType) {
        this.paySysType = paySysType;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getRefundId() {
        return refundId;
    }

    public void setRefundId(Long refundId) {
        this.refundId = refundId;
    }

    public Integer getShopIoType() {
        return shopIoType;
    }

    public void setShopIoType(Integer shopIoType) {
        this.shopIoType = shopIoType;
    }

    public Integer getPlatformIoType() {
        return platformIoType;
    }

    public void setPlatformIoType(Integer platformIoType) {
        this.platformIoType = platformIoType;
    }

    public Integer getAmountType() {
        return amountType;
    }

    public void setAmountType(Integer amountType) {
        this.amountType = amountType;
    }

    public Long getShopChangeAmount() {
        return shopChangeAmount;
    }

    public void setShopChangeAmount(Long shopChangeAmount) {
        this.shopChangeAmount = shopChangeAmount;
    }

    public Long getPlatformChangeAmount() {
        return platformChangeAmount;
    }

    public void setPlatformChangeAmount(Long platformChangeAmount) {
        this.platformChangeAmount = platformChangeAmount;
    }

    public Integer getReason() {
        return reason;
    }

    public void setReason(Integer reason) {
        this.reason = reason;
    }

    public Long getUserAmount() {
        return userAmount;
    }

    public void setUserAmount(Long userAmount) {
        this.userAmount = userAmount;
    }

    public Long getPlatformAmount() {
        return platformAmount;
    }

    public void setPlatformAmount(Long platformAmount) {
        this.platformAmount = platformAmount;
    }

    public Long getDistributionAmount() {
        return distributionAmount;
    }

    public void setDistributionAmount(Long distributionAmount) {
        this.distributionAmount = distributionAmount;
    }

    public Long getShopPlatformCommission() {
        return shopPlatformCommission;
    }

    public void setShopPlatformCommission(Long shopPlatformCommission) {
        this.shopPlatformCommission = shopPlatformCommission;
    }

    public Long getPlatformCommission() {
        return platformCommission;
    }

    public void setPlatformCommission(Long platformCommission) {
        this.platformCommission = platformCommission;
    }

    public Long getShopReduceAmount() {
        return shopReduceAmount;
    }

    public void setShopReduceAmount(Long shopReduceAmount) {
        this.shopReduceAmount = shopReduceAmount;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Long getBizOrderNo() {
        return bizOrderNo;
    }

    public void setBizOrderNo(Long bizOrderNo) {
        this.bizOrderNo = bizOrderNo;
    }

    public Integer getAllinpayStatus() {
        return allinpayStatus;
    }

    public void setAllinpayStatus(Integer allinpayStatus) {
        this.allinpayStatus = allinpayStatus;
    }

    public String getPayFailMessage() {
        return payFailMessage;
    }

    public void setPayFailMessage(String payFailMessage) {
        this.payFailMessage = payFailMessage;
    }

    @Override
    public String toString() {
        return "MongoShopWalletLogBO{" +
                "walletLogId=" + walletLogId +
                ", shopId=" + shopId +
                ", paySysType=" + paySysType +
                ", orderId=" + orderId +
                ", refundId=" + refundId +
                ", shopIoType=" + shopIoType +
                ", platformIoType=" + platformIoType +
                ", amountType=" + amountType +
                ", shopChangeAmount=" + shopChangeAmount +
                ", platformChangeAmount=" + platformChangeAmount +
                ", reason=" + reason +
                ", userAmount=" + userAmount +
                ", platformAmount=" + platformAmount +
                ", distributionAmount=" + distributionAmount +
                ", shopPlatformCommission=" + shopPlatformCommission +
                ", platformCommission=" + platformCommission +
                ", shopReduceAmount=" + shopReduceAmount +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", shopName='" + shopName + '\'' +
                ", bizOrderNo=" + bizOrderNo +
                ", allinpayStatus=" + allinpayStatus +
                ", payFailMessage='" + payFailMessage + '\'' +
                '}';
    }
}
