use crate::{DateTimeUtc, Decimal, WorkspaceId};
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "workspace_billing")]
pub struct Model {
    #[sea_orm(primary_key, column_name = "workspace_id")]
    pub workspace_id: WorkspaceId,
    #[sea_orm(column_type = "Decimal(Some((20, 4)))")]
    pub balance: Decimal,
    #[sea_orm(column_type = "Text")]
    pub currency: String,
    #[sea_orm(column_type = "Decimal(Some((20, 4)))")]
    pub monthly_quota: Decimal,
    #[sea_orm(column_type = "Decimal(Some((20, 4)))")]
    pub total_spent: Decimal,
    pub updated_at: DateTimeUtc,
    pub created_at: DateTimeUtc,
}

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

impl ActiveModelBehavior for ActiveModel {}
