// Copyright (C) 2026 Ordinary Labs, LLC.
//
// SPDX-License-Identifier: AGPL-3.0-only

pub use crate::api::*;
use serde::{Deserialize, Serialize};

#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[cfg_attr(feature = "docs", derive(schemars::JsonSchema))]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct StorageLimits {
    /// Maximum total storage for all apps and api.
    ///
    /// Unit: bytes.
    ///
    /// Default: 10 GB
    pub max_storage: u64,
    /// Maximum per-app storage.
    ///
    /// Unit: bytes.
    ///
    /// Default: 50 MB
    pub max_app_storage: u64,

    pub assets: AssetsLimits,
    pub artifact: ArtifactLimits,
    pub cache: CacheLimits,
    pub content: ContentLimits,
    pub model: ModelLimits,
    pub secrets: SecretsLimits,
}

impl Default for StorageLimits {
    fn default() -> Self {
        Self {
            max_storage: 20_000_000_000,
            max_app_storage: 50_000_000,

            assets: AssetsLimits::default(),
            artifact: ArtifactLimits::default(),
            cache: CacheLimits::default(),
            content: ContentLimits::default(),
            model: ModelLimits::default(),
            secrets: SecretsLimits::default(),
        }
    }
}
