package com.yimeng.okr.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("okr_objective")
public class OkrObjective {

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

    private Long periodId;
    private Long userId;
    private Long deptId;

    private String title;
    private String status;
    private Integer version;
    private String alignedObjectiveIds;
    private String snapshotJson;
    private Long reviewedBy;
    private LocalDateTime reviewedAt;

    private String level;            // COMPANY / DEPARTMENT / TEAM / INDIVIDUAL
    private Long parentObjectiveId;  // 对齐的上级目标ID
    private Integer sortOrder;       // 同级排序
    private Double progress;         // 汇总进度 0-100

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}
