//! `SeaORM` Entity, manually maintained

use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "subscriptions")]
pub struct Model {
    pub created_at: DateTimeWithTimeZone,
    pub updated_at: DateTimeWithTimeZone,
    #[sea_orm(primary_key)]
    pub id: i32,
    pub channel_type: String,
    pub target: String,
    pub display_name: Option<String>,
    pub status: String,
    #[sea_orm(column_type = "JsonBinary", nullable)]
    pub filters: Option<Json>,
    #[sea_orm(column_type = "Text", nullable)]
    pub secret: Option<String>,
    #[sea_orm(column_type = "Text", nullable)]
    pub notes: Option<String>,
    pub confirm_token: Option<String>,
    pub manage_token: Option<String>,
    #[sea_orm(column_type = "JsonBinary", nullable)]
    pub metadata: Option<Json>,
    pub verified_at: Option<String>,
    pub last_notified_at: Option<String>,
    pub failure_count: Option<i32>,
    pub last_delivery_status: Option<String>,
}

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

impl ActiveModelBehavior for ActiveModel {}
