package org.hzhub.crm.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hzhub.common.mybatis.core.domain.BaseEntity;
import org.hzhub.crm.domain.CrmLeadFollow;

import java.util.Date;

/**
 * CRM线索跟进记录业务对象 crm_lead_follow
 *
 * @author hzhub
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = CrmLeadFollow.class, reverseConvertGenerate = false)
public class CrmLeadFollowBo extends BaseEntity {

    /**
     * 跟进ID
     */
    private Long followId;

    /**
     * 线索ID
     */
    @NotNull(message = "线索ID不能为空")
    private Long leadId;

    /**
     * 跟进方式（字典：crm_follow_type）
     */
    @NotBlank(message = "跟进方式不能为空")
    private String followType;

    /**
     * 跟进内容
     */
    @NotBlank(message = "跟进内容不能为空")
    @Size(min = 0, max = 2000, message = "跟进内容长度不能超过{max}个字符")
    private String content;

    /**
     * AI摘要
     */
    private String aiSummary;

    /**
     * 下次跟进时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date nextFollowTime;

    /**
     * 跟进人（关联 sys_user）
     */
    private Long followUserId;

    public CrmLeadFollowBo(Long followId) {
        this.followId = followId;
    }
}