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 = "repo_tag")]
pub struct Model {
    #[sea_orm(primary_key)]
    #[sea_orm(column_name = "repo_uuid")]
    pub repo: RepoId,
    #[sea_orm(primary_key)]
    pub name: String,
    pub oid: String,
    pub color: Option<String>,
    pub description: Option<String>,
    pub created_at: DateTimeUtc,
    pub tagger_name: String,
    pub tagger_email: String,
    #[sea_orm(column_name = "tagger_uuid")]
    pub tagger: Option<UserId>,
}

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

impl ActiveModelBehavior for ActiveModel {}
