package com.gxwebsoft.shop.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 分销商资金明细表
 *
 * @author 科技小王子
 * @since 2025-08-11 23:51:41
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ShopDealerCapital对象", description = "分销商资金明细表")
@TableName("shop_dealer_capital")
public class ShopDealerCapital implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "订单编号")
    private String no;

    @Schema(description = "分销商用户ID")
    private Integer userId;

    @Schema(description = "变动类型 1-操作冻结账户余额 2-操作提现账户余额【直接结算】 3-解冻 4-退款")
    private Integer type;

    @Schema(description = "分销商昵称")
    @TableField(exist = false)
    private String nickName;

    @Schema(description = "关联订单编号")
    private String orderNo;

    @Schema(description = "订单状态")
    @TableField(exist = false)
    private Integer orderStatus;

    @Schema(description = "资金流动类型 (10分销收入 11团队管理津贴收入 12分红收入 13现场推广收入 20提现支出 30转账支出 40转账收入 50佣金解冻 60配送奖励 70佣金退回【退单】)")
    private Integer flowType;

    @Schema(description = "变更金额")
    private BigDecimal money;

    @Schema(description = "变更后金额")
    private BigDecimal moneyAfter;

    @Schema(description = "变更冻结金额")
    private BigDecimal freezeMoney;

    @Schema(description = "变更冻结后金额")
    private BigDecimal freezeMoneyAfter;

    @Schema(description = "描述")
    private String comments;

    @Schema(description = "对方用户ID")
    private Integer toUserId;

    @Schema(description = "对方昵称")
    @TableField(exist = false)
    private String toNickName;

    @Schema(description = "结算月份")
    private String month;

    @Schema(description = "商城ID")
    private Integer tenantId;

    @Schema(description = "创建人")
    private Integer creator;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "是否删除 0-未删 1-已删")
    @TableLogic
    private Integer deleted;

}
