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

import com.baomidou.mybatisplus.annotation.*;
import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
import com.njzscloud.supervisory.biz.constant.BizObj;
import com.njzscloud.supervisory.expense.contant.GoodsScope;
import com.njzscloud.supervisory.expense.contant.Scope;
import com.njzscloud.supervisory.expense.contant.StationsScope;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

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

/**
 * 付费项配置
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName(value = "expense_items_config", autoResultMap = true)
public class ExpenseItemsConfigEntity {

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

    /**
     * 付费项类型; 字典代码：expense_item_category
     */
    private String expenseItemCategory;

    /**
     * 付费项名称; expense_item_category
     */
    private String expenseItemName;

    /**
     * 单价; 单位：元
     */
    private BigDecimal unitPrice;

    /**
     * 单位; 字典代码：unit
     */
    private String unit;

    /**
     * 计费策略; 字典代码：money_strategy
     */
    private String moneyStrategy;

    /**
     * 计费配置 Id
     */
    private Long moneyConfigId;

    /**
     * 是否可用; 0-->否、1-->是
     */
    private Boolean canuse;

    /**
     * 适用范围; 适用范围; all -->所有客户 customer_type-->指定客户类型 customer -->指定客户
     */
    private Scope scope;

    /**
     * 客户类型
     */
    private BizObj bizObj;

    /**
     * 公司ids
     */
    @TableField(typeHandler = JsonTypeHandler.class)
    private List<String> companyIds;

    /**
     * 产品范围;字典代码：goods_scope all ->所有产品  goods ->指定产品
     */
    private GoodsScope goodsScope;

    /**
     * 产品ids
     */
    @TableField(typeHandler = JsonTypeHandler.class)
    private List<String> goodsIds;

    /**
     * 站点范围;字典代码：station_scope all -->所有站点  stations -->指定站点
     */
    private StationsScope stationScope;

    /**
     * 站点ids
     */
    @TableField(typeHandler = JsonTypeHandler.class)
    private List<String> stationIds;

    /**
     * 计费类型 fixed -> 固定计费 elasticity -> 弹性计费
     */
    private String billingType;

    /**
     * 基础磅重; 单位：吨
     */
    private BigDecimal basicWeight;

    /**
     * 基础单价; 单位：元
     */
    private BigDecimal basicPrice;

    /**
     * 每档磅重; 单位：吨
     */
    private BigDecimal everyWeight;

    /**
     * 每档单价; 单位：元
     */
    private BigDecimal everyPrice;

    /**
     * 税率
     */
    private BigDecimal taxRate;

    /**
     * 创建人 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;

}
