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.OrderRebateCalcMethodEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.PurchaseOrderStateEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 采购单返点客户表
 */
@Data
@TableName("order_rebate")
@EqualsAndHashCode(callSuper = true)
public class OrderRebateDO extends BaseDO<OrderPackageDO> {

	/**
	 * 记录ID
	 */
	@TableId(value = "order_rebate_id", type = IdType.NONE)
	private Long orderRebateId;

	/**
	 * 订单ID
	 */
	@TableField("order_id")
	private Long orderId;

	/**
	 * 客户ID
	 */
	@TableField("customer_id")
	private Long customerId;

	/**
	 * 经销商ID
	 */
	@TableField("dealer_id")
	private Long dealerId;

	/**
	 * 客户名称
	 */
	@TableField("name")
	private String name;

	/**
	 * 返点计算方式：1_按净重计算；2_固定金额；
	 */
	@TableField("calc_method")
	private OrderRebateCalcMethodEnum calcMethod;

	/**
	 * 返点净重
	 */
	@TableField("net_weight")
	private BigDecimal netWeight;

	/**
	 * 返点单价
	 */
	@TableField("unit_price")
	private BigDecimal unitPrice;

	/**
	 * 返点金额
	 */
	@TableField("amount")
	private BigDecimal amount;

	/**
	 * 是否付款
	 */
	@TableField(value = "is_paid")
	private Boolean isPaid;

	@TableField(exist = false)
	private PurchaseOrderStateEnum poState;

	@TableField(exist = false)
	private OrderCompanyDO orderCompanyDO;

	@TableField(exist = false)
	private PurchaseOrderDO purchaseOrderDO;
}
