package com.jeequan.jeepay.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jeequan.jeepay.core.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * <p>
 * 会员账户流水表
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2023-04-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_member_account_history")
public class MemberAccountHistory extends BaseModel {

    public static final LambdaQueryWrapper<MemberAccountHistory> gw(){
        return new LambdaQueryWrapper<>();
    }

    private static final long serialVersionUID=1L;

    // 业务类型：1-支付充值, 2-现金充值, 3-消费, 4-消费退款, 5-人工调账
    public static final byte BIZ_RECHARGE_PAY = 1;
    public static final byte BIZ_RECHARGE_CASH = 2;
    public static final byte BIZ_CONSUME = 3;
    public static final byte BIZ_CONSUME_REFUND = 4;
    public static final byte BIZ_MANUAL = 5;

    /**
     * 记录ID
     */
    @TableId(value = "hid", type = IdType.AUTO)
    private Long hid;

    /**
     * 会员ID
     */
    private String mbrId;

    /**
     * 会员名称快照
     */
    private String mbrName;

    /**
     * 会员手机号 快照
     */
    private String mbrTel;

    /**
     * 所属商户
     */
    private String mchNo;

    /**
     * 门店ID（快照）
     */
    private String storeId;

    /**
     * 码牌ID（快照）
     */
    private Long qrcId;

    /**
     * 变动前账户余额, 单位：分
     */
    private Long beforeAmount;

    /**
     * 变动金额, 单位：分
     */
    private Long changeAmount;

    /**
     * 变动后账户余额, 单位：分
     */
    private Long afterAmount;

    /**
     * 业务类型：1-支付充值, 2-现金充值, 3-消费, 4-消费退款, 5-人工调账
     */
    private Byte bizType;

    /**
     * 关联订单号
     */
    private String relaBizOrderId;

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

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新时间
     */
    private Date updatedAt;


}
