package com.czg.market.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import java.io.Serial;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 分销记录表 实体类。
 *
 * @author ww
 * @since 2025-10-27
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("mk_distribution_flow")
@Accessors(chain = true)
public class MkDistributionFlow implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 店铺用户id
     */
    private Long shopUserId;


    /**
     * 店铺id
     */
    private Long shopId;

    /**
     * 分销员id
     */
    private Long distributionUserId;

    /**
     * 等级id
     */
    private Long levelId;

    /**
     * 等级
     */
    private Integer level;

    private String sourceNickName;

    /**
     * 订单编号
     */
    private String orderNo;

    private Long sourceId;
    /**
     * 订单总金额
     */
    private BigDecimal amount;

    /**
     * 奖励金额
     */
    private BigDecimal rewardAmount;
    private String billNo;

    /**
     * order订单 recharge充值
     */
    private String type;

    /**
     * pending待入账 success已入账
     */
    private String status;

    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @Column(onInsertValue = "now()", onUpdateValue = "now()")
    private LocalDateTime updateTime;

    /**
     * 来源用户id
     */
    private Long sourceShopUserId;

    private String nickName;

    /**
     * 分成比例
     */
    private BigDecimal commission;
    private LocalDateTime deliverTime;
    private Long userId;
}
