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.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
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", autoResultMap = true)
@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 = "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 = "setting", typeHandler = JacksonTypeHandler.class)
	private DealerSettingDO setting;

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