package com.bohuikeji.delivery.backstage.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.TFranchiseeInformation;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.serializer.Decimal2Serializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

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

/**
 * 加盟商门店钱包详情表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TStoreWalletDetail对象", description="钱包详情表")
public class TStoreWalletDetail extends EntityBase<TStoreWalletDetail> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增id")
    @TableId(value = "detail_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer detailId;


    @ApiModelProperty(value = "加盟商id")
    @TableField("fran_id")
    @TableShowField(value = "所属区域",show = true)
    @TableKeyField(table = "t_franchisee_information",keyShowFields = "fran_name",where = "fran_id in(##FRAN_IDS##)",key = TFranchiseeInformation.class)
    @TableQueryField(like = false)
    @TableNewField(block = SelectBlock.class,edit = false,add = false)
    private Integer franId;

    @ApiModelProperty(value = "明细类型")
    @TableField("detail_type")
    @TableShowField("明细类型")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String detailType;

    @ApiModelProperty(value = "钱包类型")
    @TableField("walllet_type")
    @TableShowField("钱包类型")
    @TableNewField(edit = false)
    @TableQueryField(show = false)
    private String wallletType;

    @ApiModelProperty(value = "操作金额")
    @TableField("detail_price")
    @TableShowField("操作金额")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String detailPrice;

    @ApiModelProperty(value = "余额")
    @TableField("detail_balance")
    @TableShowField(value = "余额")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    @JSONField(serializeUsing = Decimal2Serializer.class)
    private BigDecimal detailBalance=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "操作时间")
    @TableField("date_time")
    @TableShowField(value = "操作时间")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String dateTime;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @TableShowField("创建时间")
    @TableNewField(edit = false)
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime createTime;
}
