package com.erp.supplier.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("supplier_ratings")
public class SupplierRating {

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 供应商ID */
    private Long supplierId;

    /** 评价周期: monthly/quarterly/annual */
    private String ratingPeriod;

    /** 评价年份 */
    private Integer ratingYear;

    /** 评价月份(季度评价时存储季度) */
    private Integer ratingMonth;

    /** 质量评分(0-100) */
    private BigDecimal qualityScore;

    /** 交期评分(0-100) */
    private BigDecimal deliveryScore;

    /** 价格评分(0-100) */
    private BigDecimal priceScore;

    /** 服务评分(0-100) */
    private BigDecimal serviceScore;

    /** 综合评分(0-100) */
    private BigDecimal overallScore;

    /** 供应商等级: A/B/C/D */
    private String grade;

    /** 评价人ID */
    private Long evaluatorId;

    /** 评价人姓名 */
    private String evaluatorName;

    /** 评价时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime evaluationTime;

    /** 优点 */
    private String strengths;

    /** 不足 */
    private String weaknesses;

    /** 改进建议 */
    private String suggestions;

    /** 备注 */
    private String remark;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    /** 更新时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    /** 逻辑删除标记 */
    @TableLogic
    private Integer deleted;
}
