package com.njzscloud.supervisory.money.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 资金变动明细
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("money_change_detail")
public class MoneyChangeDetailEntity {

    /**
     * Id
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 归属用户 Id
     */
    private Long userId;

    /**
     * 资金账户 Id
     */
    private Long moneyAccountId;

    /**
     * 变动前金额
     */
    private BigDecimal oldMoney;

    /**
     * 变动金额; 有正负
     */
    private BigDecimal delta;

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

    /**
     * 变动类型; 字典代码：money_change_category
     */
    private MoneyChangeCategory moneyChangeCategory;

    /**
     * 扩展信息
     */
    private String extendInfo;

    /**
     * 备注
     */
    private String memo;

    /**
     * 创建人 Id; sys_user.id
     */
    @TableField(fill = FieldFill.INSERT)
    private Long creatorId;

    /**
     * 修改人 Id; sys_user.id
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long modifierId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifyTime;

    /**
     * 是否删除; 0-->未删除、1-->已删除
     */
    @TableLogic
    private Boolean deleted;

}
