package com.storlead.trade.entity;

import com.alibaba.fastjson.annotation.JSONField;
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.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.mybatis.entity.SysBaseField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

@Data
@TableName("marketing_campaign")
public class MarketingCampaignEntity extends SysBaseField {
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "活动名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "活动类型（1潜客开发、2客户培养、3客户唤醒、4产品推广、5节日营销、6展会跟进）")
    @TableField("type")
    private Integer type;

    @ApiModelProperty(value = "优先级（1紧急、2高优先、3中等、4低优先）")
    @TableField("priority")
    private Integer priority;

    @ApiModelProperty(value = "开始日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    @TableField("begin_data")
    private LocalDate beginData;

    @ApiModelProperty(value = "结束日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JSONField(format ="yyyy-MM-dd")
    @TableField("end_date")
    private LocalDate endDate;

    @ApiModelProperty(value = "负责人id")
    @TableField("supervisor")
    private Long supervisor;

    @ApiModelProperty(value = "关联商机")
    @TableField("link_to_opportunity")
    private Long linkToOpportunity;

    @ApiModelProperty(value = "活动描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "发送量")
    @TableField("send_volume")
    private Integer sendVolume;

    @ApiModelProperty(value = "打开率")
    @TableField("open_rate")
    private Double openRate;

    @ApiModelProperty(value = "回复率")
    @TableField("reply_rate")
    private Double replyRate;

    @ApiModelProperty(value = "商机数")
    @TableField("opportunity_count")
    private Integer opportunityCount;

    @ApiModelProperty(value = "渠道配置")
    @TableField("channel_configuration")
    private Integer channelConfiguration;

    @ApiModelProperty(value = "发送邮箱")
    @TableField("email_address")
    private String emailAddress;

    @ApiModelProperty(value = "发送时间")
    @TableField("email_sent_time")
    private String emailSentTime;

    @ApiModelProperty(value = "邮件模板")
    @TableField("email_template")
    private String emailTemplate;

    @ApiModelProperty(value = "每批发送量")
    @TableField("email_batch_size")
    private Integer emailBatchSize;

    @ApiModelProperty(value = "邮件主题")
    @TableField("email_subject")
    private String emailSubject;

    @ApiModelProperty(value = "是否追踪邮件打开（1是0否）")
    @TableField("track_config_open")
    private Integer trackConfigOpen;

    @ApiModelProperty(value = "是否追踪链接点击（1是0否）")
    @TableField("track_config_click")
    private Integer trackConfigClick;

    @ApiModelProperty(value = "是否追踪回复（1是0否）")
    @TableField("track_config_reply")
    private Integer trackConfigReply;

    @ApiModelProperty(value = "SOP序列id")
    @TableField("sop_id")
    private Integer sopId;

    @ApiModelProperty(value = "未打开邮件跟进规则（1是0否）")
    @TableField("follow_up_rules_not_opened")
    private Integer followUpRulesNotOpened;

    @ApiModelProperty(value = "未打开邮件跟进天数")
    @TableField("follow_up_rules_not_opened_days")
    private String followUpRulesNotOpenedDays;

    @ApiModelProperty(value = "未回复邮件跟进规则（1是0否）")
    @TableField("follow_up_rules_not_replied")
    private Integer followUpRulesNotReplied;

    @ApiModelProperty(value = "未回复邮件跟进天数")
    @TableField("follow_up_rules_not_replied_days")
    private String followUpRulesNotRepliedDays;

    @ApiModelProperty(value = "未点击链接跟进规则（1是0否）")
    @TableField("follow_up_rules_link_not_clicked")
    private Integer followUpRulesLinkNotClicked;

    @ApiModelProperty(value = "未点击链接跟进天数")
    @TableField("follow_up_rules_link_not_clicked_days")
    private String followUpRulesLinkNotClickedDays;

    @ApiModelProperty(value = "客户回复后自动停止（1是0否）")
    @TableField("follow_up_rules_replied")
    private Integer followUpRulesReplied;

    @ApiModelProperty(value = "客户预约后停止（1是0否）")
    @TableField("follow_up_rules_appointment_booked")
    private Integer followUpRulesAppointmentBooked;

    @ApiModelProperty(value = "A/B测试（1是0否）")
    @TableField("a_b_testing")
    private Integer aBTesting;

    @ApiModelProperty(value = "智能调度类型")
    @TableField("smart_scheduling_type")
    private String smartSchedulingType;

    @ApiModelProperty(value = "智能调度开始日期")
    @TableField("smart_scheduling_start_date")
    private LocalDate smartSchedulingStartDate;

    @ApiModelProperty(value = "智能调度开始时间")
    @TableField("smart_scheduling_start_time")
    private String smartSchedulingStartTime;

    @ApiModelProperty(value = "是否已确认内容合规")
    @TableField("has_content_compliant")
    private Integer hasContentCompliant;

    @ApiModelProperty(value = "是否已确认发送时间合理")
    @TableField("has_schedule_approved")
    private Integer hasScheduleApproved;

    @ApiModelProperty(value = "是否符合GDPR")
    @TableField("has_gdpr_compliant")
    private Integer hasGdprCompliant;

    @ApiModelProperty(value = "是否包含退订链接")
    @TableField("has_unsubscribe_link")
    private Integer hasUnsubscribeLink;

    @ApiModelProperty(value = "进度百分比")
    @TableField("progress_percent")
    private Double progressPercent;

    @ApiModelProperty(value = "状态 0未开始 1运行中 2暂停 3完成")
    @TableField("status")
    private Integer status;

//    @ApiModelProperty(value = "创建者")
//    @TableField("create_by")
//    private Long createBy;
//
//    @ApiModelProperty(value = "更新者")
//    @TableField("update_by")
//    private Long updateBy;
//
//    @ApiModelProperty(value = "创建时间")
//    @TableField("create_time")
//    private LocalDateTime createTime;
//
//    @ApiModelProperty(value = "更新时间")
//    @TableField("update_time")
//    private LocalDateTime updateTime;
}