use crate::{
cdk::types::Principal,
dto::{error::Error, placement::scaling::ScalingRegistryResponse},
workflow::placement::scaling::{ScalingWorkflow, query::ScalingQuery},
};
pub struct ScalingApi;
impl ScalingApi {
pub async fn create_worker(pool: &str) -> Result<Principal, Error> {
ScalingWorkflow::create_worker(pool)
.await
.map_err(Error::from)
}
pub fn plan_create_worker(pool: &str) -> Result<bool, Error> {
ScalingWorkflow::plan_create_worker(pool).map_err(Error::from)
}
#[must_use]
pub fn registry() -> ScalingRegistryResponse {
ScalingQuery::registry()
}
}