use crate::{DateTimeUtc, RepoId, UserId};
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "pull_request_review_comment")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub repo: RepoId,
    #[sea_orm(primary_key)]
    pub number: i64,
    #[sea_orm(primary_key)]
    pub id: i64,
    /// Optional reviewer association.
    pub review: Option<UserId>,
    /// File path for inline comments.
    pub path: Option<String>,
    /// "LEFT" or "RIGHT" for side-by-side positioning.
    pub side: Option<String>,
    /// Line number in the new (right) file.
    pub line: Option<i64>,
    /// Line number in the old (left) file.
    pub old_line: Option<i64>,
    pub body: String,
    pub author: UserId,
    /// Whether this comment thread has been resolved.
    pub resolved: bool,
    /// ID of the parent comment this replies to (null = root comment).
    pub in_reply_to: Option<i64>,
    pub created_at: DateTimeUtc,
    pub updated_at: DateTimeUtc,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}
