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_amount_flow")
@Accessors(chain = true)
public class MkDistributionAmountFlow implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * manual_recharge充值 self_recharge自助充值 refund退款 manual_sub手动扣减 sub统扣减
     */
    private String type;

    /**
     * 主店id
     */
    private Long mainShopId;

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

    /**
     * 变动后金额
     */
    private BigDecimal amount;

    /**
     * 变动金额
     */
    private BigDecimal changeAmount;

    /**
     * 关联id
     */
    private Long sourceId;

    /**
     * 备注
     */
    private String remark;

    /**
     * 操作人账号
     */
    private String opAccount;

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

}
