package com.xunhong.erp.turbo.biz.infrastructure.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xunhong.erp.turbo.api.biz.dto.enums.DealerTypeEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * @author shenyifei
 */
@Data
@TableName(value = "dealer")
@EqualsAndHashCode(callSuper = true)
public class DealerDO extends BaseDO<DealerDO> {

	/**
	 * 经销商ID
	 */
	@TableId(value = "dealer_id", type = IdType.ASSIGN_ID)
	private Long dealerId;

	/**
	 * 经销商简称
	 */
	@TableField(value = "short_name")
	private String shortName;

	/**
	 * 经销商全称
	 */
	@TableField(value = "full_name")
	private String fullName;

	/**
	 * 经销商类型：1_市场；2_超市；
	 */
	@TableField(value = "dealer_type")
	private DealerTypeEnum dealerType;

	/**
	 * 是否开启分成
	 */
	@TableField(value = "enable_share")
	private Boolean enableShare;

	/**
	 * 分成比例
	 */
	@TableField(value = "share_ratio")
	private BigDecimal shareRatio;

	/**
	 * 运费是否作为成本
	 */
	@TableField(value = "freight_cost_flag")
	private Boolean freightCostFlag;

	/**
	 * 草帘是否作为成本
	 */
	@TableField(value = "straw_mat_cost_flag")
	private Boolean strawMatCostFlag;

	/**
	 * 发货单合计金额是否含包装费
	 */
	@TableField(value = "include_packing_flag")
	private Boolean includePackingFlag;

	/**
	 * 单据类型：delivery-发货单, purchase-采购底单, cost-成本单
	 */
	@TableField(value = "document_types")
	private String documentTypes;

	/**
	 * 应收金额
	 */
	@TableField(value = "receivable")
	private BigDecimal receivable;

	/**
	 * 备注
	 */
	@TableField(value = "remark")
	private String remark;

	/**
	 * 状态：1_启用；0_禁用；
	 */
	@TableField(value = "status")
	private Boolean status;

	/**
	 * 发货单模板
	 */
	@TableField(value = "delivery_template")
	private String deliveryTemplate;

	/**
	 * 排序
	 */
	@TableField(value = "sort")
	private BigDecimal sort;

	/**
	 * 是否开启计提税金
	 */
	@TableField(value = "enable_accrual_tax")
	private Boolean enableAccrualTax;

	/**
	 * 计提税金比例
	 */
	@TableField(value = "accrual_tax_ratio")
	private BigDecimal accrualTaxRatio;

	/**
	 * 是否开启公司返点
	 */
	@TableField(value = "enable_company_rebate")
	private Boolean enableCompanyRebate;

	/**
	 * 公司返点比例
	 */
	@TableField(value = "company_rebate_ratio")
	private BigDecimal companyRebateRatio;

	/**
	 * 付款账户列表
	 */
	@TableField(exist = false)
	private List<DealerPaymentAccountDO> dealerPaymentAccountDOList;
}
