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;

/**
 * <p>
 * 加盟商门店钱包
 * </p>
 *
 * @author 10552
 * @since 2019-12-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TStoreWallet对象", description="客户钱包")
public class TStoreWallet extends EntityBase<TStoreWallet> {

    private static final long serialVersionUID = 1L;

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

    @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("wallet_price")
    @TableShowField(value = "钱包金额(￥)",show = true)
    @TableNewField(edit = false)
    @JSONField(serializeUsing = Decimal2Serializer.class)
    private BigDecimal walletPrice=new BigDecimal("0.00").setScale(2, BigDecimal.ROUND_DOWN);

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @TableShowField(value = "创建时间")
    @TableNewField(edit = false)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "钱包状态(现金钱包，考核钱包)")
    @TableField("wallet_type")
    @TableShowField("钱包类型")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String walletType;

    @ApiModelProperty(value = "钱包状态(正常,冻结，退款)")
    @TableField("wallet_state")
    @TableShowField("钱包状态")
    @TableNewField(edit = false)
    @TableQueryField(like = false)
    private String walletState;

    /**
     * url路径
     */
    @ApiModelProperty(value="url路径",name="url")
    @TableField(exist = false)
    private String urlone;

}
