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

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

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

    /**
     * 记录ID
     */
    @TableId(value = "order_cost_item_id", type = IdType.ASSIGN_ID)
    private Long orderCostItemId;

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

    /**
     * 成本项目ID
     */
    @TableField(value = "cost_item_id")
    private Long costItemId;

    /**
     * 成本项目名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 单价
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 单位
     */
    @TableField(value = "unit")
    private String unit;

    /**
     * 数量
     */
    @TableField(value = "count")
    private Integer count;

    /**
     * 费用承担方:1-我方,2-对方
     */
    @TableField(value = "payer_type")
    private OrderCostPayerTypeEnum payerType;

    /**
     * 项目类型：1_辅料类型；2_人工类型
     */
    @TableField(value = "type")
    private CostItemTypeEnum type;

    /**
     * 录入规则：1_填数量；2_选纸箱；3_数量和金额
     */
    @TableField(value = "rule")
    private CostItemRuleEnum rule;

    /**
     * 创建时间
     */
    @TableField(value = "created_at")
    private LocalDateTime createdAt;

}

