package com.mosquito.project.persistence.entity;

import jakarta.persistence.*;
import java.time.OffsetDateTime;

/**
 * 风控告警实体
 */
@Entity
@Table(name = "risk_alerts")
public class RiskAlertEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "alert_type", nullable = false, length = 50)
    private String alertType;

    @Column(name = "risk_level", nullable = false, length = 20)
    private String riskLevel;

    @Column(nullable = false, length = 200)
    private String title;

    @Column(columnDefinition = "TEXT")
    private String description;

    @Column(name = "related_user_id")
    private Long relatedUserId;

    @Column(name = "related_activity_id")
    private Long relatedActivityId;

    @Column(name = "related_rule_id")
    private Long relatedRuleId;

    @Column(name = "related_data", columnDefinition = "TEXT")
    private String relatedData;

    @Column(name = "department_id")
    private Long departmentId;

    @Column(nullable = false, length = 20)
    private String status = "PENDING";

    @Column(name = "handler_id")
    private Long handlerId;

    @Column(name = "handler_comment", columnDefinition = "TEXT")
    private String handlerComment;

    @Column(name = "handled_at")
    private OffsetDateTime handledAt;

    @Column(name = "created_at", nullable = false)
    private OffsetDateTime createdAt;

    @Column(name = "updated_at", nullable = false)
    private OffsetDateTime updatedAt;

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public String getAlertType() { return alertType; }
    public void setAlertType(String alertType) { this.alertType = alertType; }
    public String getRiskLevel() { return riskLevel; }
    public void setRiskLevel(String riskLevel) { this.riskLevel = riskLevel; }
    public String getTitle() { return title; }
    public void setTitle(String title) { this.title = title; }
    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }
    public Long getRelatedUserId() { return relatedUserId; }
    public void setRelatedUserId(Long relatedUserId) { this.relatedUserId = relatedUserId; }
    public Long getRelatedActivityId() { return relatedActivityId; }
    public void setRelatedActivityId(Long relatedActivityId) { this.relatedActivityId = relatedActivityId; }
    public Long getRelatedRuleId() { return relatedRuleId; }
    public void setRelatedRuleId(Long relatedRuleId) { this.relatedRuleId = relatedRuleId; }
    public String getRelatedData() { return relatedData; }
    public void setRelatedData(String relatedData) { this.relatedData = relatedData; }
    public Long getDepartmentId() { return departmentId; }
    public void setDepartmentId(Long departmentId) { this.departmentId = departmentId; }
    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }
    public Long getHandlerId() { return handlerId; }
    public void setHandlerId(Long handlerId) { this.handlerId = handlerId; }
    public String getHandlerComment() { return handlerComment; }
    public void setHandlerComment(String handlerComment) { this.handlerComment = handlerComment; }
    public OffsetDateTime getHandledAt() { return handledAt; }
    public void setHandledAt(OffsetDateTime handledAt) { this.handledAt = handledAt; }
    public OffsetDateTime getCreatedAt() { return createdAt; }
    public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; }
    public OffsetDateTime getUpdatedAt() { return updatedAt; }
    public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; }
}
