package com.repair.model.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author ceshi
 * @since 2023-07-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="RepairConsumables对象", description="")
public class RepairConsumables implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "维修记录ID")
    @NotNull(message = "报修记录ID不能为空")
    private Integer recordId;

    @ApiModelProperty(value = "物品类型IDID")
    @NotNull(message = "物品类型ID不能为空")
    private Integer articleId;

    @ApiModelProperty(value = "耗材ID")
    @NotBlank(message = "耗材数据不能为空")
    private Integer consumeId;

    @ApiModelProperty(value = "耗材名称")
    @NotBlank(message = "耗材名称不能为空")
    private String consumeName;

    @ApiModelProperty(value = "耗材单价")
    @NotNull(message = "耗材单价不能为空")
    private BigDecimal price;

    @ApiModelProperty(value = "耗材数量")
    @NotNull(message = "耗材数量不能为空")
    private Double number;

    @ApiModelProperty(value = "合计费用")
    @NotNull(message = "合计费用不能为空")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "改价人")
    private String changeUser;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonIgnore
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonIgnore
    private Date updateTime;

    @ApiModelProperty(value = "创建人员")
    @TableField(fill = FieldFill.INSERT)
    @JsonIgnore
    private String createUser;

    @ApiModelProperty(value = "更新人员")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonIgnore
    private String updateUser;

    @ApiModelProperty(value = "逻辑删除 未删除：0；删除：1")
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    @JsonIgnore
    private Integer deleted;
}
